!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Hls=e():t.Hls=e()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=110)}([function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){(function(i){!function(r,i){t.exports=e=i()}(0,function(){var t=t||function(t,e){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==i&&i.crypto&&(n=i.crypto),!n)try{n=r(117)}catch(t){}var a=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),s={},f=s.lib={},c=f.Base=function(){return{extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),h=f.WordArray=c.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=void 0!=e?e:4*t.length},toString:function(t){return(t||d).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var a=0;a>>2]>>>24-a%4*8&255;e[i+a>>>2]|=o<<24-(i+a)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-n%4*8&255;i.push((a>>>4).toString(16)),i.push((15&a).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new h.init(r,e/2)}},l=u.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(a))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new h.init(r,e)}},p=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return l.parse(unescape(encodeURIComponent(t)))}},b=f.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,i=this._data,n=i.words,a=i.sigBytes,o=this.blockSize,s=4*o,f=a/s;f=e?t.ceil(f):t.max((0|f)-this._minBufferSize,0);var c=f*o,u=t.min(4*c,a);if(c){for(var d=0;d "+e}function a(t){var e=self.console[t];return e?function(){for(var r=arguments.length,i=Array(r),a=0;a1?e-1:0),i=1;i=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function b(t){return+t!=t&&(t=0),a.alloc(+t)}function g(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(i)return H(t).length;e=(""+e).toLowerCase(),i=!0}}function v(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,r);case"utf8":case"utf-8":return D(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function y(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function m(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=a.from(e,i)),a.isBuffer(e))return 0===e.length?-1:_(t,e,r,i,n);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,i,n){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,f=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,s/=2,f/=2,r/=2}var c;if(n){var h=-1;for(c=r;cs&&(r=s-f),c=r;c>=0;c--){for(var u=!0,d=0;dn&&(i=n):i=n;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");i>a/2&&(i=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(n+s<=r){var f,c,h,u;switch(s){case 1:a<128&&(o=a);break;case 2:f=t[n+1],128==(192&f)&&(u=(31&a)<<6|63&f)>127&&(o=u);break;case 3:f=t[n+1],c=t[n+2],128==(192&f)&&128==(192&c)&&(u=(15&a)<<12|(63&f)<<6|63&c)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:f=t[n+1],c=t[n+2],h=t[n+3],128==(192&f)&&128==(192&c)&&128==(192&h)&&(u=(15&a)<<18|(63&f)<<12|(63&c)<<6|63&h)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}return I(i)}function I(t){var e=t.length;if(e<=$)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii)&&(r=i);for(var n="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,i,n,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function B(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,a=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function N(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,a=Math.min(t.length-r,4);n>>8*(i?n:3-n)&255}function F(t,e,r,i,n,a){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,i,n){return n||F(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(t,e,r,i,23,4),r+4}function j(t,e,r,i,n){return n||F(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(t,e,r,i,52,8),r+8}function G(t){if(t=K(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function K(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var r,i=t.length,n=null,a=[],o=0;o55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function q(t){for(var e=[],r=0;r>8,n=r%256,a.push(n),a.push(i);return a}function W(t){return Z.toByteArray(G(t))}function Y(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function X(t){return t!==t}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var Z=r(118),J=r(119),Q=r(63);e.Buffer=a,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=i(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return o(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return f(null,t,e,r)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,i=e.length,n=0,o=Math.min(r,i);n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},a.prototype.compare=function(t,e,r,i,n){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;for(var o=n-i,s=r-e,f=Math.min(o,s),c=this.slice(i,n),h=t.slice(e,r),u=0;un)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":return E(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(n*=256);)i+=this[t+--e]*n;return i},a.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var i=this[t],n=1,a=0;++a=n&&(i-=Math.pow(2,8*e)),i},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var i=e,n=1,a=this[t+--i];i>0&&(n*=256);)a+=this[t+--i]*n;return n*=128,a>=n&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),J.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),J.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),J.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),J.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e|=0,r|=0,!i){P(this,t,e,r,Math.pow(2,8*r)-1,0)}var n=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+n]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e|=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,i){if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--n)t[n+e]=this[n+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return i}function s(t,e,r,i){for(var n=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return n}function f(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}function c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],a=0|e.words[0],o=n*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,u=67108863&f,d=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=d;l++){var p=c-l|0;n=0|t.words[p],a=0|e.words[l],o=n*a+u,h+=o/67108864|0,u=67108863&o}r.words[c]=0|u,f=0|h}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}function h(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,a=0;a>>26)|0,n+=o>>>26,o&=67108863}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}function u(t,e,r){return(new d).mulp(t,e,r)}function d(t,e){this.x=t,this.y=e}function l(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){l.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){l.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){l.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){l.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function m(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;var _;try{_=r(160).Buffer}catch(t){}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var n=0;"-"===t[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(n=0,a=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=o(t,r,r+6),this.words[i]|=n<>>26-a&4194303,(a+=24)>=26&&(a-=26,i++);r+6!==e&&(n=o(t,e,r+6),this.words[i]|=n<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var a=t.length-r,o=a%i,f=Math.min(a,a-o)+r,c=0,h=r;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var n=0,a=0,o=0;o>>24-n&16777215,r=0!==a||o!==this.length-1?w[6-f.length]+f+r:f+r,n+=2,n>=26&&(n-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=S[t],h=E[t];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var d=u.modn(h).toString(t);u=u.idivn(h),r=u.isZero()?d+r:w[c-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return i(void 0!==_),this.toArrayLike(_,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),a=r||Math.max(1,n);i(n<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===e,c=new t(a),h=this.clone();if(f){for(s=0;!h.isZero();s++)o=h.andln(255),h.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var i,n;r>0?(i=this,n=t):(i=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,l=0|o[1],p=8191&l,b=l>>>13,g=0|o[2],v=8191&g,y=g>>>13,m=0|o[3],_=8191&m,w=m>>>13,S=0|o[4],E=8191&S,A=S>>>13,T=0|o[5],R=8191&T,k=T>>>13,D=0|o[6],I=8191&D,M=D>>>13,x=0|o[7],L=8191&x,O=x>>>13,C=0|o[8],P=8191&C,B=C>>>13,N=0|o[9],F=8191&N,U=N>>>13,j=0|s[0],G=8191&j,K=j>>>13,z=0|s[1],H=8191&z,q=z>>>13,V=0|s[2],W=8191&V,Y=V>>>13,X=0|s[3],Z=8191&X,J=X>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],at=8191&nt,ot=nt>>>13,st=0|s[7],ft=8191&st,ct=st>>>13,ht=0|s[8],ut=8191&ht,dt=ht>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(u,G),n=Math.imul(u,K),n=n+Math.imul(d,G)|0,a=Math.imul(d,K);var gt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,G),n=Math.imul(p,K),n=n+Math.imul(b,G)|0,a=Math.imul(b,K),i=i+Math.imul(u,H)|0,n=n+Math.imul(u,q)|0,n=n+Math.imul(d,H)|0,a=a+Math.imul(d,q)|0;var vt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(v,G),n=Math.imul(v,K),n=n+Math.imul(y,G)|0,a=Math.imul(y,K),i=i+Math.imul(p,H)|0,n=n+Math.imul(p,q)|0,n=n+Math.imul(b,H)|0,a=a+Math.imul(b,q)|0,i=i+Math.imul(u,W)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(d,W)|0,a=a+Math.imul(d,Y)|0;var yt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(_,G),n=Math.imul(_,K),n=n+Math.imul(w,G)|0,a=Math.imul(w,K),i=i+Math.imul(v,H)|0,n=n+Math.imul(v,q)|0,n=n+Math.imul(y,H)|0,a=a+Math.imul(y,q)|0,i=i+Math.imul(p,W)|0,n=n+Math.imul(p,Y)|0,n=n+Math.imul(b,W)|0,a=a+Math.imul(b,Y)|0,i=i+Math.imul(u,Z)|0,n=n+Math.imul(u,J)|0,n=n+Math.imul(d,Z)|0,a=a+Math.imul(d,J)|0;var mt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(E,G),n=Math.imul(E,K),n=n+Math.imul(A,G)|0,a=Math.imul(A,K),i=i+Math.imul(_,H)|0,n=n+Math.imul(_,q)|0,n=n+Math.imul(w,H)|0,a=a+Math.imul(w,q)|0,i=i+Math.imul(v,W)|0,n=n+Math.imul(v,Y)|0,n=n+Math.imul(y,W)|0,a=a+Math.imul(y,Y)|0,i=i+Math.imul(p,Z)|0,n=n+Math.imul(p,J)|0,n=n+Math.imul(b,Z)|0,a=a+Math.imul(b,J)|0,i=i+Math.imul(u,$)|0,n=n+Math.imul(u,tt)|0,n=n+Math.imul(d,$)|0,a=a+Math.imul(d,tt)|0;var _t=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(R,G),n=Math.imul(R,K),n=n+Math.imul(k,G)|0,a=Math.imul(k,K),i=i+Math.imul(E,H)|0,n=n+Math.imul(E,q)|0,n=n+Math.imul(A,H)|0,a=a+Math.imul(A,q)|0,i=i+Math.imul(_,W)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(w,W)|0,a=a+Math.imul(w,Y)|0,i=i+Math.imul(v,Z)|0,n=n+Math.imul(v,J)|0,n=n+Math.imul(y,Z)|0,a=a+Math.imul(y,J)|0,i=i+Math.imul(p,$)|0,n=n+Math.imul(p,tt)|0,n=n+Math.imul(b,$)|0,a=a+Math.imul(b,tt)|0,i=i+Math.imul(u,rt)|0,n=n+Math.imul(u,it)|0,n=n+Math.imul(d,rt)|0,a=a+Math.imul(d,it)|0;var wt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(I,G),n=Math.imul(I,K),n=n+Math.imul(M,G)|0,a=Math.imul(M,K),i=i+Math.imul(R,H)|0,n=n+Math.imul(R,q)|0,n=n+Math.imul(k,H)|0,a=a+Math.imul(k,q)|0,i=i+Math.imul(E,W)|0,n=n+Math.imul(E,Y)|0,n=n+Math.imul(A,W)|0,a=a+Math.imul(A,Y)|0,i=i+Math.imul(_,Z)|0,n=n+Math.imul(_,J)|0,n=n+Math.imul(w,Z)|0,a=a+Math.imul(w,J)|0,i=i+Math.imul(v,$)|0,n=n+Math.imul(v,tt)|0,n=n+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,i=i+Math.imul(p,rt)|0,n=n+Math.imul(p,it)|0,n=n+Math.imul(b,rt)|0,a=a+Math.imul(b,it)|0,i=i+Math.imul(u,at)|0,n=n+Math.imul(u,ot)|0,n=n+Math.imul(d,at)|0,a=a+Math.imul(d,ot)|0;var St=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(L,G),n=Math.imul(L,K),n=n+Math.imul(O,G)|0,a=Math.imul(O,K),i=i+Math.imul(I,H)|0,n=n+Math.imul(I,q)|0,n=n+Math.imul(M,H)|0,a=a+Math.imul(M,q)|0,i=i+Math.imul(R,W)|0,n=n+Math.imul(R,Y)|0,n=n+Math.imul(k,W)|0,a=a+Math.imul(k,Y)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(E,J)|0,n=n+Math.imul(A,Z)|0,a=a+Math.imul(A,J)|0,i=i+Math.imul(_,$)|0,n=n+Math.imul(_,tt)|0,n=n+Math.imul(w,$)|0,a=a+Math.imul(w,tt)|0,i=i+Math.imul(v,rt)|0,n=n+Math.imul(v,it)|0,n=n+Math.imul(y,rt)|0,a=a+Math.imul(y,it)|0,i=i+Math.imul(p,at)|0,n=n+Math.imul(p,ot)|0,n=n+Math.imul(b,at)|0,a=a+Math.imul(b,ot)|0,i=i+Math.imul(u,ft)|0,n=n+Math.imul(u,ct)|0,n=n+Math.imul(d,ft)|0,a=a+Math.imul(d,ct)|0;var Et=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(P,G),n=Math.imul(P,K),n=n+Math.imul(B,G)|0,a=Math.imul(B,K),i=i+Math.imul(L,H)|0,n=n+Math.imul(L,q)|0,n=n+Math.imul(O,H)|0,a=a+Math.imul(O,q)|0,i=i+Math.imul(I,W)|0,n=n+Math.imul(I,Y)|0,n=n+Math.imul(M,W)|0,a=a+Math.imul(M,Y)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(R,J)|0,n=n+Math.imul(k,Z)|0,a=a+Math.imul(k,J)|0,i=i+Math.imul(E,$)|0,n=n+Math.imul(E,tt)|0,n=n+Math.imul(A,$)|0,a=a+Math.imul(A,tt)|0,i=i+Math.imul(_,rt)|0,n=n+Math.imul(_,it)|0,n=n+Math.imul(w,rt)|0,a=a+Math.imul(w,it)|0,i=i+Math.imul(v,at)|0,n=n+Math.imul(v,ot)|0,n=n+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,i=i+Math.imul(p,ft)|0,n=n+Math.imul(p,ct)|0,n=n+Math.imul(b,ft)|0,a=a+Math.imul(b,ct)|0,i=i+Math.imul(u,ut)|0,n=n+Math.imul(u,dt)|0,n=n+Math.imul(d,ut)|0,a=a+Math.imul(d,dt)|0;var At=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(F,G),n=Math.imul(F,K),n=n+Math.imul(U,G)|0,a=Math.imul(U,K),i=i+Math.imul(P,H)|0,n=n+Math.imul(P,q)|0,n=n+Math.imul(B,H)|0,a=a+Math.imul(B,q)|0,i=i+Math.imul(L,W)|0,n=n+Math.imul(L,Y)|0,n=n+Math.imul(O,W)|0,a=a+Math.imul(O,Y)|0,i=i+Math.imul(I,Z)|0,n=n+Math.imul(I,J)|0,n=n+Math.imul(M,Z)|0,a=a+Math.imul(M,J)|0,i=i+Math.imul(R,$)|0,n=n+Math.imul(R,tt)|0,n=n+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,i=i+Math.imul(E,rt)|0,n=n+Math.imul(E,it)|0,n=n+Math.imul(A,rt)|0,a=a+Math.imul(A,it)|0,i=i+Math.imul(_,at)|0,n=n+Math.imul(_,ot)|0,n=n+Math.imul(w,at)|0,a=a+Math.imul(w,ot)|0,i=i+Math.imul(v,ft)|0,n=n+Math.imul(v,ct)|0,n=n+Math.imul(y,ft)|0,a=a+Math.imul(y,ct)|0,i=i+Math.imul(p,ut)|0,n=n+Math.imul(p,dt)|0,n=n+Math.imul(b,ut)|0,a=a+Math.imul(b,dt)|0,i=i+Math.imul(u,pt)|0,n=n+Math.imul(u,bt)|0,n=n+Math.imul(d,pt)|0,a=a+Math.imul(d,bt)|0;var Tt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(F,H),n=Math.imul(F,q),n=n+Math.imul(U,H)|0,a=Math.imul(U,q),i=i+Math.imul(P,W)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(B,W)|0,a=a+Math.imul(B,Y)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(L,J)|0,n=n+Math.imul(O,Z)|0,a=a+Math.imul(O,J)|0,i=i+Math.imul(I,$)|0,n=n+Math.imul(I,tt)|0,n=n+Math.imul(M,$)|0,a=a+Math.imul(M,tt)|0,i=i+Math.imul(R,rt)|0,n=n+Math.imul(R,it)|0,n=n+Math.imul(k,rt)|0,a=a+Math.imul(k,it)|0,i=i+Math.imul(E,at)|0,n=n+Math.imul(E,ot)|0,n=n+Math.imul(A,at)|0,a=a+Math.imul(A,ot)|0,i=i+Math.imul(_,ft)|0,n=n+Math.imul(_,ct)|0,n=n+Math.imul(w,ft)|0,a=a+Math.imul(w,ct)|0,i=i+Math.imul(v,ut)|0,n=n+Math.imul(v,dt)|0,n=n+Math.imul(y,ut)|0,a=a+Math.imul(y,dt)|0,i=i+Math.imul(p,pt)|0,n=n+Math.imul(p,bt)|0,n=n+Math.imul(b,pt)|0,a=a+Math.imul(b,bt)|0;var Rt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(F,W),n=Math.imul(F,Y),n=n+Math.imul(U,W)|0,a=Math.imul(U,Y),i=i+Math.imul(P,Z)|0,n=n+Math.imul(P,J)|0,n=n+Math.imul(B,Z)|0,a=a+Math.imul(B,J)|0,i=i+Math.imul(L,$)|0,n=n+Math.imul(L,tt)|0,n=n+Math.imul(O,$)|0,a=a+Math.imul(O,tt)|0,i=i+Math.imul(I,rt)|0,n=n+Math.imul(I,it)|0,n=n+Math.imul(M,rt)|0,a=a+Math.imul(M,it)|0,i=i+Math.imul(R,at)|0,n=n+Math.imul(R,ot)|0,n=n+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,i=i+Math.imul(E,ft)|0,n=n+Math.imul(E,ct)|0,n=n+Math.imul(A,ft)|0,a=a+Math.imul(A,ct)|0,i=i+Math.imul(_,ut)|0,n=n+Math.imul(_,dt)|0,n=n+Math.imul(w,ut)|0,a=a+Math.imul(w,dt)|0,i=i+Math.imul(v,pt)|0,n=n+Math.imul(v,bt)|0,n=n+Math.imul(y,pt)|0,a=a+Math.imul(y,bt)|0;var kt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(F,Z),n=Math.imul(F,J),n=n+Math.imul(U,Z)|0,a=Math.imul(U,J),i=i+Math.imul(P,$)|0,n=n+Math.imul(P,tt)|0,n=n+Math.imul(B,$)|0,a=a+Math.imul(B,tt)|0,i=i+Math.imul(L,rt)|0,n=n+Math.imul(L,it)|0,n=n+Math.imul(O,rt)|0,a=a+Math.imul(O,it)|0,i=i+Math.imul(I,at)|0,n=n+Math.imul(I,ot)|0,n=n+Math.imul(M,at)|0,a=a+Math.imul(M,ot)|0,i=i+Math.imul(R,ft)|0,n=n+Math.imul(R,ct)|0,n=n+Math.imul(k,ft)|0,a=a+Math.imul(k,ct)|0,i=i+Math.imul(E,ut)|0,n=n+Math.imul(E,dt)|0,n=n+Math.imul(A,ut)|0,a=a+Math.imul(A,dt)|0,i=i+Math.imul(_,pt)|0,n=n+Math.imul(_,bt)|0,n=n+Math.imul(w,pt)|0,a=a+Math.imul(w,bt)|0;var Dt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(F,$),n=Math.imul(F,tt),n=n+Math.imul(U,$)|0,a=Math.imul(U,tt),i=i+Math.imul(P,rt)|0,n=n+Math.imul(P,it)|0,n=n+Math.imul(B,rt)|0,a=a+Math.imul(B,it)|0,i=i+Math.imul(L,at)|0,n=n+Math.imul(L,ot)|0,n=n+Math.imul(O,at)|0,a=a+Math.imul(O,ot)|0,i=i+Math.imul(I,ft)|0,n=n+Math.imul(I,ct)|0,n=n+Math.imul(M,ft)|0,a=a+Math.imul(M,ct)|0,i=i+Math.imul(R,ut)|0,n=n+Math.imul(R,dt)|0,n=n+Math.imul(k,ut)|0,a=a+Math.imul(k,dt)|0,i=i+Math.imul(E,pt)|0,n=n+Math.imul(E,bt)|0,n=n+Math.imul(A,pt)|0,a=a+Math.imul(A,bt)|0;var It=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(F,rt),n=Math.imul(F,it),n=n+Math.imul(U,rt)|0,a=Math.imul(U,it),i=i+Math.imul(P,at)|0,n=n+Math.imul(P,ot)|0,n=n+Math.imul(B,at)|0,a=a+Math.imul(B,ot)|0,i=i+Math.imul(L,ft)|0,n=n+Math.imul(L,ct)|0,n=n+Math.imul(O,ft)|0,a=a+Math.imul(O,ct)|0,i=i+Math.imul(I,ut)|0,n=n+Math.imul(I,dt)|0,n=n+Math.imul(M,ut)|0,a=a+Math.imul(M,dt)|0,i=i+Math.imul(R,pt)|0,n=n+Math.imul(R,bt)|0,n=n+Math.imul(k,pt)|0,a=a+Math.imul(k,bt)|0;var Mt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(F,at),n=Math.imul(F,ot),n=n+Math.imul(U,at)|0,a=Math.imul(U,ot),i=i+Math.imul(P,ft)|0,n=n+Math.imul(P,ct)|0,n=n+Math.imul(B,ft)|0,a=a+Math.imul(B,ct)|0,i=i+Math.imul(L,ut)|0,n=n+Math.imul(L,dt)|0,n=n+Math.imul(O,ut)|0,a=a+Math.imul(O,dt)|0,i=i+Math.imul(I,pt)|0,n=n+Math.imul(I,bt)|0,n=n+Math.imul(M,pt)|0,a=a+Math.imul(M,bt)|0;var xt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(F,ft),n=Math.imul(F,ct),n=n+Math.imul(U,ft)|0,a=Math.imul(U,ct),i=i+Math.imul(P,ut)|0,n=n+Math.imul(P,dt)|0,n=n+Math.imul(B,ut)|0,a=a+Math.imul(B,dt)|0,i=i+Math.imul(L,pt)|0,n=n+Math.imul(L,bt)|0,n=n+Math.imul(O,pt)|0,a=a+Math.imul(O,bt)|0;var Lt=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,i=Math.imul(F,ut),n=Math.imul(F,dt),n=n+Math.imul(U,ut)|0,a=Math.imul(U,dt),i=i+Math.imul(P,pt)|0,n=n+Math.imul(P,bt)|0,n=n+Math.imul(B,pt)|0,a=a+Math.imul(B,bt)|0;var Ot=(c+i|0)+((8191&n)<<13)|0;c=(a+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(F,pt),n=Math.imul(F,bt),n=n+Math.imul(U,pt)|0,a=Math.imul(U,bt);var Ct=(c+i|0)+((8191&n)<<13)|0;return c=(a+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,f[0]=gt,f[1]=vt,f[2]=yt,f[3]=mt,f[4]=_t,f[5]=wt,f[6]=St,f[7]=Et,f[8]=At,f[9]=Tt,f[10]=Rt,f[11]=kt,f[12]=Dt,f[13]=It,f[14]=Mt,f[15]=xt,f[16]=Lt,f[17]=Ot,f[18]=Ct,0!==c&&(f[19]=c,r.length++),r};Math.imul||(A=c),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?A(this,t,e):r<63?c(this,t,e):r<1024?h(this,t,e):u(this,t,e)},d.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,i=0;i>=1;return i},d.prototype.permute=function(t,e,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=n/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=f(t);if(0===e.length)return new a(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0);var n;n=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==h||c>=n);c--){var u=0|this.words[c];this.words[c]=h<<26-a|u>>>a,h=u&s}return f&&0!==h&&(f.words[f.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(f/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=this.length-t.length,i=this.clone(),n=t,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var s,f=i.length-n.length;if("mod"!==e){s=new a(null),s.length=f+1,s.words=new Array(s.length);for(var c=0;c=0;u--){var d=67108864*(0|i.words[n.length+u])+(0|i.words[n.length+u-1]);for(d=Math.min(d/o|0,67108863),i._ishlnsubmul(n,d,u);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,u),i.isZero()||(i.negative^=1);s&&(s.words[u]=d)}return s&&s.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},a.prototype.divmod=function(t,e,r){if(i(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var n,o,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e)},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},a.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new a(1),o=new a(0),s=new a(0),f=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),u=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(h),o.isub(u)),n.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(h),f.isub(u)),s.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),o.isub(f)):(r.isub(e),s.isub(n),f.isub(o))}return{a:s,b:f,gcd:r.iushln(c)}},a.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(e.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(e.iushrn(f);f-- >0;)n.isOdd()&&n.iadd(s),n.iushrn(1);for(var h=0,u=1;0==(r.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(r.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(o)):(r.isub(e),o.isub(n))}var d;return d=0===e.cmpn(1)?n:o,d.cmpn(0)<0&&d.iadd(t),d},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var a=e;e=r,r=a}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];r=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new y(t)},a.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var T={k256:null,p224:null,p192:null,p25519:null};l.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},l.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength()}while(e>this.n);var i=e0?r.isub(this.p):r.strip(),r},l.prototype.split=function(t,e){t.iushrn(this.n,0,e)},l.prototype.imulK=function(t){return t.imul(this.k)},n(p,l),p.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=a}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},p.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(T[t])return T[t];var e;if("k256"===t)e=new p;else if("p224"===t)e=new b;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new v}return T[t]=e,e},y.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},y.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},y.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var s=new a(1).toRed(this),f=s.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new a(2*h*h).toRed(this);0!==this.pow(h,c).cmp(f);)h.redIAdd(f);for(var u=this.pow(h,n),d=this.pow(t,n.addn(1).iushrn(1)),l=this.pow(t,n),p=o;0!==l.cmp(s);){for(var b=l,g=0;0!==b.cmp(s);g++)b=b.redSqr();i(g=0;i--){for(var c=e.words[i],h=f-1;h>=0;h--){var u=c>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==u||0!==o?(o<<=1,o|=u,(4===++s||0===i&&0===h)&&(n=this.mul(n,r[o]),s=0,o=0)):s=0}f=26}return n},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new m(t)},n(m,y),m.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},m.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},m.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},m.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},m.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)}).call(e,r(159)(t))},function(t,e,r){"use strict";r.d(e,"b",function(){return i}),r.d(e,"a",function(){return n});var i={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},n={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(18))}(0,function(t){t.lib.Cipher||function(e){var r=t,i=r.lib,n=i.Base,a=i.WordArray,o=i.BufferedBlockAlgorithm,s=r.enc,f=(s.Utf8,s.Base64),c=r.algo,h=c.EvpKDF,u=i.Cipher=o.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?E:_}return function(e){return{encrypt:function(r,i,n){return t(i).encrypt(e,r,i,n)},decrypt:function(r,i,n){return t(i).decrypt(e,r,i,n)}}}}()}),d=(i.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),r.mode={}),l=i.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),p=d.CBC=function(){function t(t,r,i){var n,a=this._iv;a?(n=a,this._iv=e):n=this._prevBlock;for(var o=0;o>>2];t.sigBytes-=e}},v=(i.BlockCipher=u.extend({cfg:u.cfg.extend({mode:p,padding:g}),reset:function(){var t;u.reset.call(this);var e=this.cfg,r=e.iv,i=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=i.createEncryptor:(t=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(i,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),i.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=r.format={},m=y.OpenSSL={stringify:function(t){var e,r=t.ciphertext,i=t.salt;return e=i?a.create([1398893684,1701076831]).concat(i).concat(r):r,e.toString(f)},parse:function(t){var e,r=f.parse(t),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(e=a.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),v.create({ciphertext:r,salt:e})}},_=i.SerializableCipher=n.extend({cfg:n.extend({format:m}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),a=n.finalize(e),o=n.cfg;return v.create({ciphertext:a,key:r,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),w=r.kdf={},S=w.OpenSSL={execute:function(t,e,r,i){i||(i=a.random(8));var n=h.create({keySize:e+r}).compute(t,i),o=a.create(n.words.slice(e),4*r);return n.sigBytes=4*e,v.create({key:n,iv:o,salt:i})}},E=i.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:S}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=i.kdf.execute(r,t.keySize,t.ivSize);i.iv=n.iv;var a=_.encrypt.call(this,t,e,n.key,i);return a.mixIn(n),a},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var n=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=n.iv,_.decrypt.call(this,t,e,n.key,i)}})}()})},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=r(2),a=r(7),o=r(5),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=new Set(["hlsEventGeneric","hlsHandlerDestroying","hlsHandlerDestroyed"]),c=function(){function t(e){i(this,t),this.hls=e,this.onEvent=this.onEvent.bind(this);for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a>8,o=255&n;a?r.push(a,o):r.push(o)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function o(t,e){for(var r="",i=0;i>>0}return a}function h(t,e){for(var r=new Array(4*t.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r}function u(t,e){return t>>>e|t<<32-e}function d(t,e){return t<>>32-e}function l(t,e){return t+e>>>0}function p(t,e,r){return t+e+r>>>0}function b(t,e,r,i){return t+e+r+i>>>0}function g(t,e,r,i,n){return t+e+r+i+n>>>0}function v(t,e,r,i){var n=t[e],a=t[e+1],o=i+a>>>0,s=(o>>0,t[e+1]=o}function y(t,e,r,i){return(e+i>>>0>>0}function m(t,e,r,i){return e+i>>>0}function _(t,e,r,i,n,a,o,s){var f=0,c=e;return c=c+i>>>0,f+=c>>0,f+=c>>0,f+=c>>0}function w(t,e,r,i,n,a,o,s){return e+i+a+s>>>0}function S(t,e,r,i,n,a,o,s,f,c){var h=0,u=e;return u=u+i>>>0,h+=u>>0,h+=u>>0,h+=u>>0,h+=u>>0}function E(t,e,r,i,n,a,o,s,f,c){return e+i+a+s+c>>>0}function A(t,e,r){return(e<<32-r|t>>>r)>>>0}function T(t,e,r){return(t<<32-r|e>>>r)>>>0}function R(t,e,r){return t>>>r}function k(t,e,r){return(t<<32-r|e>>>r)>>>0}var D=r(11),I=r(0);e.inherits=I,e.toArray=i,e.toHex=n,e.htonl=a,e.toHex32=o,e.zero2=s,e.zero8=f,e.join32=c,e.split32=h,e.rotr32=u,e.rotl32=d,e.sum32=l,e.sum32_3=p,e.sum32_4=b,e.sum32_5=g,e.sum64=v,e.sum64_hi=y,e.sum64_lo=m,e.sum64_4_hi=_,e.sum64_4_lo=w,e.sum64_5_hi=S,e.sum64_5_lo=E,e.rotr64_hi=A,e.rotr64_lo=T,e.shr64_hi=R,e.shr64_lo=k},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function n(t){if(h===setTimeout)return setTimeout(t,0);if((h===r||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function a(t){if(u===clearTimeout)return clearTimeout(t);if((u===i||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(t);try{return u(t)}catch(e){try{return u.call(null,t)}catch(e){return u.call(this,t)}}}function o(){b&&l&&(b=!1,l.length?p=l.concat(p):g=-1,p.length&&s())}function s(){if(!b){var t=n(o);b=!0;for(var e=p.length;e;){for(l=p,p=[];++g1)for(var r=1;r>>6-o%4*2,c=s|f;i[a>>>2]|=c<<24-a%4*8,a++}return n.create(i,a)}var r=t,i=r.lib,n=i.WordArray,a=r.enc;a.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,i=this._map;t.clamp();for(var n=[],a=0;a>>2]>>>24-a%4*8&255,s=e[a+1>>>2]>>>24-(a+1)%4*8&255,f=e[a+2>>>2]>>>24-(a+2)%4*8&255,c=o<<16|s<<8|f,h=0;h<4&&a+.75*h>>6*(3-h)&63));var u=i.charAt(64);if(u)for(;n.length%4;)n.push(u);return n.join("")},parse:function(t){var r=t.length,i=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var a=0;a65536)throw new Error("requested too many random bytes");var n=new e.Uint8Array(t);t>0&&s.getRandomValues(n);var a=o.from(n.buffer);return"function"==typeof r?i.nextTick(function(){r(null,a)}):a}var o=r(3).Buffer,s=e.crypto||e.msCrypto;s&&s.getRandomValues?t.exports=a:t.exports=n}).call(e,r(13),r(14))},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function n(t){return"number"==typeof t}function a(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!n(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,n,s,f,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var h=new Error('Uncaught, unspecified "error" event. ('+e+")");throw h.context=e,h}if(r=this._events[t],o(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),c=r.slice(),n=c.length,f=0;f0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,r){function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}var n=r(3).Buffer;i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,a=t.length,o=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=4294967295&r,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,r){!function(i,n){t.exports=e=n(r(1))}(0,function(t){return function(e){function r(t,e,r,i,n,a,o){var s=t+(e&r|~e&i)+n+o;return(s<>>32-a)+e}function i(t,e,r,i,n,a,o){var s=t+(e&i|r&~i)+n+o;return(s<>>32-a)+e}function n(t,e,r,i,n,a,o){var s=t+(e^r^i)+n+o;return(s<>>32-a)+e}function a(t,e,r,i,n,a,o){var s=t+(r^(e|~i))+n+o;return(s<>>32-a)+e}var o=t,s=o.lib,f=s.WordArray,c=s.Hasher,h=o.algo,u=[];!function(){for(var t=0;t<64;t++)u[t]=4294967296*e.abs(e.sin(t+1))|0}();var d=h.MD5=c.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var o=0;o<16;o++){var s=e+o,f=t[s];t[s]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var c=this._hash.words,h=t[e+0],d=t[e+1],l=t[e+2],p=t[e+3],b=t[e+4],g=t[e+5],v=t[e+6],y=t[e+7],m=t[e+8],_=t[e+9],w=t[e+10],S=t[e+11],E=t[e+12],A=t[e+13],T=t[e+14],R=t[e+15],k=c[0],D=c[1],I=c[2],M=c[3];k=r(k,D,I,M,h,7,u[0]),M=r(M,k,D,I,d,12,u[1]),I=r(I,M,k,D,l,17,u[2]),D=r(D,I,M,k,p,22,u[3]),k=r(k,D,I,M,b,7,u[4]),M=r(M,k,D,I,g,12,u[5]),I=r(I,M,k,D,v,17,u[6]),D=r(D,I,M,k,y,22,u[7]),k=r(k,D,I,M,m,7,u[8]),M=r(M,k,D,I,_,12,u[9]),I=r(I,M,k,D,w,17,u[10]),D=r(D,I,M,k,S,22,u[11]),k=r(k,D,I,M,E,7,u[12]),M=r(M,k,D,I,A,12,u[13]),I=r(I,M,k,D,T,17,u[14]),D=r(D,I,M,k,R,22,u[15]),k=i(k,D,I,M,d,5,u[16]),M=i(M,k,D,I,v,9,u[17]),I=i(I,M,k,D,S,14,u[18]),D=i(D,I,M,k,h,20,u[19]),k=i(k,D,I,M,g,5,u[20]),M=i(M,k,D,I,w,9,u[21]),I=i(I,M,k,D,R,14,u[22]),D=i(D,I,M,k,b,20,u[23]),k=i(k,D,I,M,_,5,u[24]),M=i(M,k,D,I,T,9,u[25]),I=i(I,M,k,D,p,14,u[26]),D=i(D,I,M,k,m,20,u[27]),k=i(k,D,I,M,A,5,u[28]),M=i(M,k,D,I,l,9,u[29]),I=i(I,M,k,D,y,14,u[30]),D=i(D,I,M,k,E,20,u[31]),k=n(k,D,I,M,g,4,u[32]),M=n(M,k,D,I,m,11,u[33]),I=n(I,M,k,D,S,16,u[34]),D=n(D,I,M,k,T,23,u[35]),k=n(k,D,I,M,d,4,u[36]),M=n(M,k,D,I,b,11,u[37]),I=n(I,M,k,D,y,16,u[38]),D=n(D,I,M,k,w,23,u[39]),k=n(k,D,I,M,A,4,u[40]),M=n(M,k,D,I,h,11,u[41]),I=n(I,M,k,D,p,16,u[42]),D=n(D,I,M,k,v,23,u[43]),k=n(k,D,I,M,_,4,u[44]),M=n(M,k,D,I,E,11,u[45]),I=n(I,M,k,D,R,16,u[46]),D=n(D,I,M,k,l,23,u[47]),k=a(k,D,I,M,h,6,u[48]),M=a(M,k,D,I,y,10,u[49]),I=a(I,M,k,D,T,15,u[50]),D=a(D,I,M,k,g,21,u[51]),k=a(k,D,I,M,E,6,u[52]),M=a(M,k,D,I,p,10,u[53]),I=a(I,M,k,D,w,15,u[54]),D=a(D,I,M,k,d,21,u[55]),k=a(k,D,I,M,m,6,u[56]),M=a(M,k,D,I,R,10,u[57]),I=a(I,M,k,D,v,15,u[58]),D=a(D,I,M,k,A,21,u[59]),k=a(k,D,I,M,b,6,u[60]),M=a(M,k,D,I,S,10,u[61]),I=a(I,M,k,D,l,15,u[62]),D=a(D,I,M,k,_,21,u[63]),c[0]=c[0]+k|0,c[1]=c[1]+D|0,c[2]=c[2]+I|0,c[3]=c[3]+M|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;r[n>>>5]|=128<<24-n%32;var a=e.floor(i/4294967296),o=i;r[15+(n+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,f=s.words,c=0;c<4;c++){var h=f[c];f[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return s},clone:function(){var t=c.clone.call(this);return t._hash=this._hash.clone(),t}});o.MD5=c._createHelper(d),o.HmacMD5=c._createHmacHelper(d)}(Math),t.MD5})},function(t,e,r){"use strict";(function(e){function i(t){c.call(this,"digest"),this._hash=t,this.buffers=[]}function n(t){c.call(this,"digest"),this._hash=t}var a=r(0),o=r(42),s=r(43),f=r(47),c=r(15);a(i,c),i.prototype._update=function(t){this.buffers.push(t)},i.prototype._final=function(){var t=e.concat(this.buffers),r=this._hash(t);return this.buffers=null,r},a(n,c),n.prototype._update=function(t){this._hash.update(t)},n.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return t=t.toLowerCase(),"md5"===t?new i(o):new n("rmd160"===t||"ripemd160"===t?new s:f(t))}}).call(e,r(4).Buffer)},function(t,e,r){(function(t){function r(t){return Array.isArray?Array.isArray(t):"[object Array]"===g(t)}function i(t){return"boolean"==typeof t}function n(t){return null===t}function a(t){return null==t}function o(t){return"number"==typeof t}function s(t){return"string"==typeof t}function f(t){return"symbol"==typeof t}function c(t){return void 0===t}function h(t){return"[object RegExp]"===g(t)}function u(t){return"object"==typeof t&&null!==t}function d(t){return"[object Date]"===g(t)}function l(t){return"[object Error]"===g(t)||t instanceof Error}function p(t){return"function"==typeof t}function b(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function g(t){return Object.prototype.toString.call(t)}e.isArray=r,e.isBoolean=i,e.isNull=n,e.isNullOrUndefined=a,e.isNumber=o,e.isString=s,e.isSymbol=f,e.isUndefined=c,e.isRegExp=h,e.isObject=u,e.isDate=d,e.isError=l,e.isFunction=p,e.isPrimitive=b,e.isBuffer=t.isBuffer}).call(e,r(4).Buffer)},function(t,e,r){(function(e){t.exports=function(t,r){for(var i=Math.min(t.length,r.length),n=new e(i),a=0;a=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a0||i>0;){var h=new a;h.update(c),h.update(t),e&&h.update(e),c=h.digest();var u=0;if(o>0){var d=s.length-o;u=Math.min(o,c.length),c.copy(s,d,0,u),o-=u}if(u0){var l=f.length-i,p=Math.min(i,c.length-u);c.copy(f,l,u,u+p),i-=p}}return c.fill(0),{key:s,iv:f}}var n=r(3).Buffer,a=r(140);t.exports=i},function(t,e,r){function i(t){s.isBuffer(t)||(t=s.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i>>24]^h[p>>>16&255]^u[b>>>8&255]^d[255&g]^e[v++],o=c[p>>>24]^h[b>>>16&255]^u[g>>>8&255]^d[255&l]^e[v++],s=c[b>>>24]^h[g>>>16&255]^u[l>>>8&255]^d[255&p]^e[v++],f=c[g>>>24]^h[l>>>16&255]^u[p>>>8&255]^d[255&b]^e[v++],l=a,p=o,b=s,g=f;return a=(i[l>>>24]<<24|i[p>>>16&255]<<16|i[b>>>8&255]<<8|i[255&g])^e[v++],o=(i[p>>>24]<<24|i[b>>>16&255]<<16|i[g>>>8&255]<<8|i[255&l])^e[v++],s=(i[b>>>24]<<24|i[g>>>16&255]<<16|i[l>>>8&255]<<8|i[255&p])^e[v++],f=(i[g>>>24]<<24|i[l>>>16&255]<<16|i[p>>>8&255]<<8|i[255&b])^e[v++],a>>>=0,o>>>=0,s>>>=0,f>>>=0,[a,o,s,f]}function o(t){this._key=i(t),this._reset()}var s=r(3).Buffer,f=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],i=[],n=[[],[],[],[]],a=[[],[],[],[]],o=0,s=0,f=0;f<256;++f){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[o]=c,i[c]=o;var h=t[o],u=t[h],d=t[u],l=257*t[c]^16843008*c;n[0][o]=l<<24|l>>>8,n[1][o]=l<<16|l>>>16,n[2][o]=l<<8|l>>>24,n[3][o]=l,l=16843009*d^65537*u^257*h^16843008*o,a[0][c]=l<<24|l>>>8,a[1][c]=l<<16|l>>>16,a[2][c]=l<<8|l>>>24,a[3][c]=l,0===o?o=s=1:(o=h^t[t[t[d^h]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:a}}();o.blockSize=16,o.keySize=32,o.prototype.blockSize=o.blockSize,o.prototype.keySize=o.keySize,o.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,i=4*(r+1),n=[],a=0;a>>24,o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o],o^=f[a/e|0]<<24):e>6&&a%e==4&&(o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o]),n[a]=n[a-e]^o}for(var s=[],h=0;h>>24]]^c.INV_SUB_MIX[1][c.SBOX[d>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[d>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&d]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},o.prototype.encryptBlockRaw=function(t){return t=i(t),a(t,this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},o.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=s.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},o.prototype.decryptBlock=function(t){t=i(t);var e=t[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),n=s.allocUnsafe(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[3],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[1],12),n},o.prototype.scrub=function(){n(this._keySchedule),n(this._invKeySchedule),n(this._key)},t.exports.AES=o},function(t,e,r){"use strict";var i=e;i.base=r(168),i.short=r(169),i.mont=r(170),i.edwards=r(171)},function(t,e,r){(function(e){function i(t){var r;"object"!=typeof t||e.isBuffer(t)||(r=t.passphrase,t=t.key),"string"==typeof t&&(t=new e(t));var i,o,f=s(t,r),c=f.tag,h=f.data;switch(c){case"CERTIFICATE":o=a.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(o||(o=a.PublicKey.decode(h,"der")),i=o.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPublicKey.decode(o.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return o.subjectPrivateKey=o.subjectPublicKey,{type:"ec",data:o};case"1.2.840.10040.4.1":return o.algorithm.params.pub_key=a.DSAparam.decode(o.subjectPublicKey.data,"der"),{type:"dsa",data:o.algorithm.params};default:throw new Error("unknown key id "+i)}throw new Error("unknown key type "+c);case"ENCRYPTED PRIVATE KEY":h=a.EncryptedPrivateKey.decode(h,"der"),h=n(h,r);case"PRIVATE KEY":switch(o=a.PrivateKey.decode(h,"der"),i=o.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return a.RSAPrivateKey.decode(o.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:o.algorithm.curve,privateKey:a.ECPrivateKey.decode(o.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return o.algorithm.params.priv_key=a.DSAparam.decode(o.subjectPrivateKey,"der"),{type:"dsa",params:o.algorithm.params};default:throw new Error("unknown key id "+i)}throw new Error("unknown key type "+c);case"RSA PUBLIC KEY":return a.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return a.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:a.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return h=a.ECPrivateKey.decode(h,"der"),{curve:h.parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+c)}}function n(t,r){var i=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=o[t.algorithm.decrypt.cipher.algo.join(".")],s=t.algorithm.decrypt.cipher.iv,h=t.subjectPrivateKey,u=parseInt(a.split("-")[1],10)/8,d=c.pbkdf2Sync(r,i,n,u),l=f.createDecipheriv(a,d,s),p=[];return p.push(l.update(h)),p.push(l.final()),e.concat(p)}var a=r(187),o=r(199),s=r(200),f=r(48),c=r(72);t.exports=i,i.signature=a.signature}).call(e,r(4).Buffer)},function(t,e,r){!function(i,n){t.exports=e=n(r(1))}(0,function(t){return function(){var e=t,r=e.lib,i=r.WordArray,n=r.Hasher,a=e.algo,o=[],s=a.SHA1=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],s=r[3],f=r[4],c=0;c<80;c++){if(c<16)o[c]=0|t[e+c];else{var h=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=h<<1|h>>>31}var u=(i<<5|i>>>27)+f+o[c];u+=c<20?1518500249+(n&a|~n&s):c<40?1859775393+(n^a^s):c<60?(n&a|n&s|a&s)-1894007588:(n^a^s)-899497514,f=s,s=a,a=n<<30|n>>>2,n=i,i=u}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+f|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(i+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA1=n._createHelper(s),e.HmacSHA1=n._createHmacHelper(s)}(),t.SHA1})},function(t,e,r){!function(i,n){t.exports=e=n(r(1))}(0,function(t){!function(){var e=t,r=e.lib,i=r.Base,n=e.enc,a=n.Utf8,o=e.algo;o.HMAC=i.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=a.parse(e));var r=t.blockSize,i=4*r;e.sigBytes>i&&(e=t.finalize(e)),e.clamp();for(var n=this._oKey=e.clone(),o=this._iKey=e.clone(),s=n.words,f=o.words,c=0;c0)r=n+1;else{if(!(o<0))return a;i=n-1}}return null}};e.a=i},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"b",function(){return a});var n=function(){function t(){i(this,t)}return t.isHeader=function(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},t.isFooter=function(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},t.getID3Data=function(e,r){for(var i=r,n=0;t.isHeader(e,r);){n+=10;n+=t._readSize(e,r+6),t.isFooter(e,r+10)&&(n+=10),r+=n}if(n>0)return e.subarray(i,i+n)},t._readSize=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,r|=(127&t[e+2])<<7,r|=127&t[e+3]},t.getTimeStamp=function(e){for(var r=t.getID3Frames(e),i=0;i1&&void 0!==arguments[1]&&arguments[1],r=t.length,i=void 0,n=void 0,a=void 0,o="",s=0;s>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:n=t[s++],o+=String.fromCharCode((31&i)<<6|63&n);break;case 14:n=t[s++],a=t[s++],o+=String.fromCharCode((15&i)<<12|(63&n)<<6|(63&a)<<0)}}return o},t}(),a=n._utf8ArrayToStr;e.a=n},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=r(29),a=r.n(n),o=r(61),s=function(){function t(t,e){for(var r=0;r>8*(15-r)&255;return e},t.prototype.fragmentDecryptdataFromLevelkey=function(t,e){var r=t;return t&&t.method&&t.uri&&!t.iv&&(r=new o.a,r.method=t.method,r.baseuri=t.baseuri,r.reluri=t.reluri,r.iv=this.createInitializationVector(e)),r},s(t,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=a.a.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(t){this._url=t}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var t=[];if(this.rawByteRange){var e=this.rawByteRange.split("@",2);if(1===e.length){var r=this.lastByteRangeEndOffset;t[0]=r||0}else t[0]=parseInt(e[1]);t[1]=parseInt(e[0])+t[0],this._byteRange=t}return t}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}},{key:"encrypted",get:function(){return!(!this.decryptdata||null===this.decryptdata.uri||null!==this.decryptdata.key)}}],[{key:"ElementaryStreamTypes",get:function(){return{AUDIO:"audio",VIDEO:"video"}}}]),t}();e.a=f},function(t,e,r){"use strict";function i(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,i=-271733879,n=-1732584194,h=271733878,u=0;u>16)+(e>>16)+(r>>16)<<16|65535&r}function h(t,e){return t<>>32-e}var u=r(120);t.exports=function(t){return u(t,i)}},function(t,e,r){"use strict";(function(e){function i(){u.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function n(t,e){return t<>>32-e}function a(t,e,r,i,a,o,s,f){return n(t+(e^r^i)+o+s|0,f)+a|0}function o(t,e,r,i,a,o,s,f){return n(t+(e&r|~e&i)+o+s|0,f)+a|0}function s(t,e,r,i,a,o,s,f){return n(t+((e|~r)^i)+o+s|0,f)+a|0}function f(t,e,r,i,a,o,s,f){return n(t+(e&i|r&~i)+o+s|0,f)+a|0}function c(t,e,r,i,a,o,s,f){return n(t+(e^(r|~i))+o+s|0,f)+a|0}var h=r(0),u=r(121);h(i,u),i.prototype._update=function(){for(var t=new Array(16),e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,h=this._c,u=this._d,d=this._e;r=a(r,i,h,u,d,t[0],0,11),h=n(h,10),d=a(d,r,i,h,u,t[1],0,14),i=n(i,10),u=a(u,d,r,i,h,t[2],0,15),r=n(r,10),h=a(h,u,d,r,i,t[3],0,12),d=n(d,10),i=a(i,h,u,d,r,t[4],0,5),u=n(u,10),r=a(r,i,h,u,d,t[5],0,8),h=n(h,10),d=a(d,r,i,h,u,t[6],0,7),i=n(i,10),u=a(u,d,r,i,h,t[7],0,9),r=n(r,10),h=a(h,u,d,r,i,t[8],0,11),d=n(d,10),i=a(i,h,u,d,r,t[9],0,13),u=n(u,10),r=a(r,i,h,u,d,t[10],0,14),h=n(h,10),d=a(d,r,i,h,u,t[11],0,15),i=n(i,10),u=a(u,d,r,i,h,t[12],0,6),r=n(r,10),h=a(h,u,d,r,i,t[13],0,7),d=n(d,10),i=a(i,h,u,d,r,t[14],0,9),u=n(u,10),r=a(r,i,h,u,d,t[15],0,8),h=n(h,10),d=o(d,r,i,h,u,t[7],1518500249,7),i=n(i,10),u=o(u,d,r,i,h,t[4],1518500249,6),r=n(r,10),h=o(h,u,d,r,i,t[13],1518500249,8),d=n(d,10),i=o(i,h,u,d,r,t[1],1518500249,13),u=n(u,10),r=o(r,i,h,u,d,t[10],1518500249,11),h=n(h,10),d=o(d,r,i,h,u,t[6],1518500249,9),i=n(i,10),u=o(u,d,r,i,h,t[15],1518500249,7),r=n(r,10),h=o(h,u,d,r,i,t[3],1518500249,15),d=n(d,10),i=o(i,h,u,d,r,t[12],1518500249,7),u=n(u,10),r=o(r,i,h,u,d,t[0],1518500249,12),h=n(h,10),d=o(d,r,i,h,u,t[9],1518500249,15),i=n(i,10),u=o(u,d,r,i,h,t[5],1518500249,9),r=n(r,10),h=o(h,u,d,r,i,t[2],1518500249,11),d=n(d,10),i=o(i,h,u,d,r,t[14],1518500249,7),u=n(u,10),r=o(r,i,h,u,d,t[11],1518500249,13),h=n(h,10),d=o(d,r,i,h,u,t[8],1518500249,12),i=n(i,10),u=s(u,d,r,i,h,t[3],1859775393,11),r=n(r,10),h=s(h,u,d,r,i,t[10],1859775393,13),d=n(d,10),i=s(i,h,u,d,r,t[14],1859775393,6),u=n(u,10),r=s(r,i,h,u,d,t[4],1859775393,7),h=n(h,10),d=s(d,r,i,h,u,t[9],1859775393,14),i=n(i,10),u=s(u,d,r,i,h,t[15],1859775393,9),r=n(r,10),h=s(h,u,d,r,i,t[8],1859775393,13),d=n(d,10),i=s(i,h,u,d,r,t[1],1859775393,15),u=n(u,10),r=s(r,i,h,u,d,t[2],1859775393,14),h=n(h,10),d=s(d,r,i,h,u,t[7],1859775393,8),i=n(i,10),u=s(u,d,r,i,h,t[0],1859775393,13),r=n(r,10),h=s(h,u,d,r,i,t[6],1859775393,6),d=n(d,10),i=s(i,h,u,d,r,t[13],1859775393,5),u=n(u,10),r=s(r,i,h,u,d,t[11],1859775393,12),h=n(h,10),d=s(d,r,i,h,u,t[5],1859775393,7),i=n(i,10),u=s(u,d,r,i,h,t[12],1859775393,5),r=n(r,10),h=f(h,u,d,r,i,t[1],2400959708,11),d=n(d,10),i=f(i,h,u,d,r,t[9],2400959708,12),u=n(u,10),r=f(r,i,h,u,d,t[11],2400959708,14),h=n(h,10),d=f(d,r,i,h,u,t[10],2400959708,15),i=n(i,10),u=f(u,d,r,i,h,t[0],2400959708,14),r=n(r,10),h=f(h,u,d,r,i,t[8],2400959708,15),d=n(d,10),i=f(i,h,u,d,r,t[12],2400959708,9),u=n(u,10),r=f(r,i,h,u,d,t[4],2400959708,8),h=n(h,10),d=f(d,r,i,h,u,t[13],2400959708,9),i=n(i,10),u=f(u,d,r,i,h,t[3],2400959708,14),r=n(r,10),h=f(h,u,d,r,i,t[7],2400959708,5),d=n(d,10),i=f(i,h,u,d,r,t[15],2400959708,6),u=n(u,10),r=f(r,i,h,u,d,t[14],2400959708,8),h=n(h,10),d=f(d,r,i,h,u,t[5],2400959708,6),i=n(i,10),u=f(u,d,r,i,h,t[6],2400959708,5),r=n(r,10),h=f(h,u,d,r,i,t[2],2400959708,12),d=n(d,10),i=c(i,h,u,d,r,t[4],2840853838,9),u=n(u,10),r=c(r,i,h,u,d,t[0],2840853838,15),h=n(h,10),d=c(d,r,i,h,u,t[5],2840853838,5),i=n(i,10),u=c(u,d,r,i,h,t[9],2840853838,11),r=n(r,10),h=c(h,u,d,r,i,t[7],2840853838,6),d=n(d,10),i=c(i,h,u,d,r,t[12],2840853838,8),u=n(u,10),r=c(r,i,h,u,d,t[2],2840853838,13),h=n(h,10),d=c(d,r,i,h,u,t[10],2840853838,12),i=n(i,10),u=c(u,d,r,i,h,t[14],2840853838,5),r=n(r,10),h=c(h,u,d,r,i,t[1],2840853838,12),d=n(d,10),i=c(i,h,u,d,r,t[3],2840853838,13),u=n(u,10),r=c(r,i,h,u,d,t[8],2840853838,14),h=n(h,10),d=c(d,r,i,h,u,t[11],2840853838,11),i=n(i,10),u=c(u,d,r,i,h,t[6],2840853838,8),r=n(r,10),h=c(h,u,d,r,i,t[15],2840853838,5),d=n(d,10),i=c(i,h,u,d,r,t[13],2840853838,6),u=n(u,10);var l=this._a,p=this._b,b=this._c,g=this._d,v=this._e;l=c(l,p,b,g,v,t[5],1352829926,8),b=n(b,10),v=c(v,l,p,b,g,t[14],1352829926,9),p=n(p,10),g=c(g,v,l,p,b,t[7],1352829926,9),l=n(l,10),b=c(b,g,v,l,p,t[0],1352829926,11),v=n(v,10),p=c(p,b,g,v,l,t[9],1352829926,13),g=n(g,10),l=c(l,p,b,g,v,t[2],1352829926,15),b=n(b,10),v=c(v,l,p,b,g,t[11],1352829926,15),p=n(p,10),g=c(g,v,l,p,b,t[4],1352829926,5),l=n(l,10),b=c(b,g,v,l,p,t[13],1352829926,7),v=n(v,10),p=c(p,b,g,v,l,t[6],1352829926,7),g=n(g,10),l=c(l,p,b,g,v,t[15],1352829926,8),b=n(b,10),v=c(v,l,p,b,g,t[8],1352829926,11),p=n(p,10),g=c(g,v,l,p,b,t[1],1352829926,14),l=n(l,10),b=c(b,g,v,l,p,t[10],1352829926,14),v=n(v,10),p=c(p,b,g,v,l,t[3],1352829926,12),g=n(g,10),l=c(l,p,b,g,v,t[12],1352829926,6),b=n(b,10),v=f(v,l,p,b,g,t[6],1548603684,9),p=n(p,10),g=f(g,v,l,p,b,t[11],1548603684,13),l=n(l,10),b=f(b,g,v,l,p,t[3],1548603684,15),v=n(v,10),p=f(p,b,g,v,l,t[7],1548603684,7),g=n(g,10),l=f(l,p,b,g,v,t[0],1548603684,12),b=n(b,10),v=f(v,l,p,b,g,t[13],1548603684,8),p=n(p,10),g=f(g,v,l,p,b,t[5],1548603684,9),l=n(l,10),b=f(b,g,v,l,p,t[10],1548603684,11),v=n(v,10),p=f(p,b,g,v,l,t[14],1548603684,7),g=n(g,10),l=f(l,p,b,g,v,t[15],1548603684,7),b=n(b,10),v=f(v,l,p,b,g,t[8],1548603684,12),p=n(p,10),g=f(g,v,l,p,b,t[12],1548603684,7),l=n(l,10),b=f(b,g,v,l,p,t[4],1548603684,6),v=n(v,10),p=f(p,b,g,v,l,t[9],1548603684,15),g=n(g,10),l=f(l,p,b,g,v,t[1],1548603684,13),b=n(b,10),v=f(v,l,p,b,g,t[2],1548603684,11),p=n(p,10),g=s(g,v,l,p,b,t[15],1836072691,9),l=n(l,10),b=s(b,g,v,l,p,t[5],1836072691,7),v=n(v,10),p=s(p,b,g,v,l,t[1],1836072691,15),g=n(g,10),l=s(l,p,b,g,v,t[3],1836072691,11),b=n(b,10),v=s(v,l,p,b,g,t[7],1836072691,8),p=n(p,10),g=s(g,v,l,p,b,t[14],1836072691,6),l=n(l,10),b=s(b,g,v,l,p,t[6],1836072691,6),v=n(v,10),p=s(p,b,g,v,l,t[9],1836072691,14),g=n(g,10),l=s(l,p,b,g,v,t[11],1836072691,12),b=n(b,10),v=s(v,l,p,b,g,t[8],1836072691,13),p=n(p,10),g=s(g,v,l,p,b,t[12],1836072691,5),l=n(l,10),b=s(b,g,v,l,p,t[2],1836072691,14),v=n(v,10),p=s(p,b,g,v,l,t[10],1836072691,13),g=n(g,10),l=s(l,p,b,g,v,t[0],1836072691,13),b=n(b,10),v=s(v,l,p,b,g,t[4],1836072691,7),p=n(p,10),g=s(g,v,l,p,b,t[13],1836072691,5),l=n(l,10),b=o(b,g,v,l,p,t[8],2053994217,15),v=n(v,10),p=o(p,b,g,v,l,t[6],2053994217,5),g=n(g,10),l=o(l,p,b,g,v,t[4],2053994217,8),b=n(b,10),v=o(v,l,p,b,g,t[1],2053994217,11),p=n(p,10),g=o(g,v,l,p,b,t[3],2053994217,14),l=n(l,10),b=o(b,g,v,l,p,t[11],2053994217,14),v=n(v,10),p=o(p,b,g,v,l,t[15],2053994217,6),g=n(g,10),l=o(l,p,b,g,v,t[0],2053994217,14),b=n(b,10),v=o(v,l,p,b,g,t[5],2053994217,6),p=n(p,10),g=o(g,v,l,p,b,t[12],2053994217,9),l=n(l,10),b=o(b,g,v,l,p,t[2],2053994217,12),v=n(v,10),p=o(p,b,g,v,l,t[13],2053994217,9),g=n(g,10),l=o(l,p,b,g,v,t[9],2053994217,12),b=n(b,10),v=o(v,l,p,b,g,t[7],2053994217,5),p=n(p,10),g=o(g,v,l,p,b,t[10],2053994217,15),l=n(l,10),b=o(b,g,v,l,p,t[14],2053994217,8),v=n(v,10),p=a(p,b,g,v,l,t[12],0,8),g=n(g,10),l=a(l,p,b,g,v,t[15],0,5),b=n(b,10),v=a(v,l,p,b,g,t[10],0,12),p=n(p,10),g=a(g,v,l,p,b,t[4],0,9),l=n(l,10),b=a(b,g,v,l,p,t[1],0,12),v=n(v,10),p=a(p,b,g,v,l,t[5],0,5),g=n(g,10),l=a(l,p,b,g,v,t[8],0,14),b=n(b,10),v=a(v,l,p,b,g,t[7],0,6),p=n(p,10),g=a(g,v,l,p,b,t[6],0,8),l=n(l,10),b=a(b,g,v,l,p,t[2],0,13),v=n(v,10),p=a(p,b,g,v,l,t[13],0,6),g=n(g,10),l=a(l,p,b,g,v,t[14],0,5),b=n(b,10),v=a(v,l,p,b,g,t[0],0,15),p=n(p,10),g=a(g,v,l,p,b,t[3],0,13),l=n(l,10),b=a(b,g,v,l,p,t[9],0,11),v=n(v,10),p=a(p,b,g,v,l,t[11],0,11),g=n(g,10);var y=this._b+h+g|0;this._b=this._c+u+v|0,this._c=this._d+d+l|0,this._d=this._e+r+p|0,this._e=this._a+i+b|0,this._a=y},i.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new e(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=i}).call(e,r(4).Buffer)},function(t,e,r){e=t.exports=r(64),e.Stream=e,e.Readable=e,e.Writable=r(45),e.Duplex=r(16),e.Transform=r(67),e.PassThrough=r(127)},function(t,e,r){"use strict";(function(e,i,n){function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){k(e,t)}}function o(t){return C.from(t)}function s(t){return C.isBuffer(t)||t instanceof P}function f(){}function c(t,e){I=I||r(16),t=t||{},this.objectMode=!!t.objectMode,e instanceof I&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){y(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function h(t){if(I=I||r(16),!(N.call(h,this)||this instanceof I))return new h(t);this._writableState=new c(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),O.call(this)}function u(t,e){var r=new Error("write after end");t.emit("error",r),D(e,r)}function d(t,e,r,i){var n=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),D(i,a),n=!1),n}function l(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=C.from(e,r)),e}function p(t,e,r,i,n,a){if(!r){var o=l(e,i,n);i!==o&&(r=!0,n="buffer",i=o)}var s=e.objectMode?1:i.length;e.length+=s;var f=e.length-1?i:D;h.WritableState=c;var x=r(24);x.inherits=r(0);var L={deprecate:r(126)},O=r(65),C=r(3).Buffer,P=n.Uint8Array||function(){},B=r(66);x.inherits(h,O),c.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(c.prototype,"buffer",{get:L.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}();var N;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(N=Function.prototype[Symbol.hasInstance],Object.defineProperty(h,Symbol.hasInstance,{value:function(t){return!!N.call(this,t)||t&&t._writableState instanceof c}})):N=function(t){return t instanceof this},h.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},h.prototype.write=function(t,e,r){var i=this._writableState,n=!1,a=s(t)&&!i.objectMode;return a&&!C.isBuffer(t)&&(t=o(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=f),i.ended?u(this,r):(a||d(this,i,t,r))&&(i.pendingcb++,n=p(this,i,a,t,e,r)),n},h.prototype.cork=function(){this._writableState.corked++},h.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||w(this,t))},h.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},h.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},h.prototype._writev=null,h.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||R(this,i,r)},Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),h.prototype.destroy=B.destroy,h.prototype._undestroy=B.undestroy,h.prototype._destroy=function(t,e){this.end(),e(t)}}).call(e,r(14),r(124).setImmediate,r(13))},function(t,e,r){function i(t){if(t&&!f(t))throw new Error("Unknown encoding: "+t)}function n(t){return t.toString(this.encoding)}function a(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function o(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var s=r(4).Buffer,f=s.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},c=e.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),i(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=n)}this.charBuffer=new s(6),this.charReceived=0,this.charLength=0};c.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),e+=t.toString(this.encoding,0,n);var n=e.length-1,i=e.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),t.copy(this.charBuffer,0,0,a),e.substring(0,n)}return e},c.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},c.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;e+=i.slice(0,r).toString(n)}return e}},function(t,e,r){var e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};e.sha=r(132),e.sha1=r(133),e.sha224=r(134),e.sha256=r(68),e.sha384=r(135),e.sha512=r(69)},function(t,e,r){function i(){return Object.keys(o)}var n=r(142),a=r(150),o=r(78);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=a.createDecipher,e.createDecipheriv=e.Decipheriv=a.createDecipheriv,e.listCiphers=e.getCiphers=i},function(t,e,r){var i={ECB:r(143),CBC:r(144),CFB:r(145),CFB8:r(146),CFB1:r(147),OFB:r(148),CTR:r(76),GCM:r(76)},n=r(78);for(var a in n)n[a].module=i[n[a].mode];t.exports=n},function(t,e,r){"use strict";e.utils=r(152),e.Cipher=r(153),e.DES=r(154),e.CBC=r(155),e.EDE=r(156)},function(t,e,r){(function(e){function i(t){var e=a(t);return{blinder:e.toRed(o.mont(t.modulus)).redPow(new o(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}function n(t,r){var n=i(r),a=r.modulus.byteLength(),s=(o.mont(r.modulus),new o(t).mul(n.blinder).umod(r.modulus)),f=s.toRed(o.mont(r.prime1)),c=s.toRed(o.mont(r.prime2)),h=r.coefficient,u=r.prime1,d=r.prime2,l=f.redPow(r.exponent1),p=c.redPow(r.exponent2);l=l.fromRed(),p=p.fromRed();var b=l.isub(p).imul(h).umod(u);return b.imul(d),p.iadd(b),new e(p.imul(n.unblinder).umod(r.modulus).toArray(!1,a))}function a(t){for(var e=t.modulus.byteLength(),r=new o(s(e));r.cmp(t.modulus)>=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new o(s(e));return r}var o=r(6),s=r(19);t.exports=n,n.getr=a}).call(e,r(4).Buffer)},function(t,e,r){var i=e;i.utils=r(12),i.common=r(26),i.sha=r(173),i.ripemd=r(177),i.hmac=r(178),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},function(t,e,r){"use strict";function i(){return new d(null)}function n(t,e){return new d(t,e)}function a(t,e){var r=_[t.charCodeAt(e)];return null==r?-1:r}function o(t){var e=i();return e.fromInt(t),e}function s(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}r.d(e,"a",function(){return d}),e.b=i,e.c=n;var f,c=r(97),h=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],u=(1<<26)/h[h.length-1],d=function(){function t(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}return t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,i=(1<0)for(s>s)>0&&(n=!0,a=Object(c.b)(r));o>=0;)s>(s+=this.DB-e)):(r=this[o]>>(s-=e)&i,s<=0&&(s+=this.DB,--o)),r>0&&(n=!0),n&&(a+=Object(c.b)(r));return n?a:"0"},t.prototype.negate=function(){var e=i();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+s(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var r=i();return this.abs().divRemTo(e,null,r),this.s<0&&r.compareTo(t.ZERO)>0&&e.subTo(r,r),r},t.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new p(e):new b(e),this.exp(t,r)},t.prototype.clone=function(){var t=i();return this.copyTo(t),t},t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var r,i=this.DB-t*this.DB%8,n=0;if(t-- >0)for(i>i)!=(this.s&this.DM)>>i&&(e[n++]=r|this.s<=0;)i<8?(r=(this[t]&(1<>(i+=this.DB-8)):(r=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(e[n++]=r);return e},t.prototype.equals=function(t){return 0==this.compareTo(t)},t.prototype.min=function(t){return this.compareTo(t)<0?this:t},t.prototype.max=function(t){return this.compareTo(t)>0?this:t},t.prototype.and=function(t){var e=i();return this.bitwiseTo(t,c.d,e),e},t.prototype.or=function(t){var e=i();return this.bitwiseTo(t,c.f,e),e},t.prototype.xor=function(t){var e=i();return this.bitwiseTo(t,c.g,e),e},t.prototype.andNot=function(t){var e=i();return this.bitwiseTo(t,c.e,e),e},t.prototype.not=function(){for(var t=i(),e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var l=i();for(n.sqrTo(c[1],l);h<=d;)c[h]=i(),n.mulTo(l,c[h-2],c[h]),h+=2}var v,y,m=t.t-1,_=!0,w=i();for(a=s(t[m])-1;m>=0;){for(a>=u?v=t[m]>>a-u&d:(v=(t[m]&(1<0&&(v|=t[m-1]>>this.DB+a-u)),h=r;0==(1&v);)v>>=1,--h;if((a-=h)<0&&(a+=this.DB,--m),_)c[v].copyTo(f),_=!1;else{for(;h>1;)n.sqrTo(f,w),n.sqrTo(w,f),h-=2;h>0?n.sqrTo(f,w):(y=f,f=w,w=y),n.mulTo(w,c[v],f)}for(;m>=0&&0==(t[m]&1<=0?(i.subTo(n,i),r&&a.subTo(f,a),s.subTo(c,s)):(n.subTo(i,n),r&&f.subTo(a,f),c.subTo(s,c))}return 0!=n.compareTo(t.ONE)?t.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},t.prototype.pow=function(t){return this.exp(t,new l)},t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r,r=i}var n=e.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return e;for(n0&&(e.rShiftTo(a,e),r.rShiftTo(a,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},t.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=h[h.length-1]){for(e=0;e=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},t.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},t.prototype.fromString=function(e,r){var i;if(16==r)i=4;else if(8==r)i=3;else if(256==r)i=8;else if(2==r)i=1;else if(32==r)i=5;else{if(4!=r)return void this.fromRadix(e,r);i=2}this.t=0,this.s=0;for(var n=e.length,o=!1,s=0;--n>=0;){var f=8==i?255&+e[n]:a(e,n);f<0?"-"==e.charAt(n)&&(o=!0):(o=!1,0==s?this[this.t++]=f:s+i>this.DB?(this[this.t-1]|=(f&(1<>this.DB-s):this[this.t-1]|=f<=this.DB&&(s-=this.DB))}8==i&&0!=(128&+e[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},t.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},t.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--s)e[s+a+1]=this[s]>>i|o,o=(this[s]&n)<=0;--s)e[s]=0;e[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()},t.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)return void(e.t=0);var i=t%this.DB,n=this.DB-i,a=(1<>i;for(var o=r+1;o>i;i>0&&(e[this.t-r-1]|=(this.s&a)<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[r++]=this.DV+i:i>0&&(e[r++]=i),e.t=r,e.clamp()},t.prototype.multiplyTo=function(e,r){var i=this.abs(),n=e.abs(),a=i.t;for(r.t=a+n.t;--a>=0;)r[a]=0;for(a=0;a=0;)t[r]=0;for(r=0;r=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},t.prototype.divRemTo=function(e,r,n){var a=e.abs();if(!(a.t<=0)){var o=this.abs();if(o.t0?(a.lShiftTo(u,f),o.lShiftTo(u,n)):(a.copyTo(f),o.copyTo(n));var d=f.t,l=f[d-1];if(0!=l){var p=l*(1<1?f[d-2]>>this.F2:0),b=this.FV/p,g=(1<=0&&(n[n.t++]=1,n.subTo(_,n)),t.ONE.dlShiftTo(d,_),_.subTo(f,f);f.t=0;){var w=n[--y]==l?this.DM:Math.floor(n[y]*b+(n[y-1]+v)*g);if((n[y]+=f.am(0,w,n,m,0,d))0&&n.rShiftTo(u,n),c<0&&t.ZERO.subTo(n,n)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(e,r){if(e>4294967295||e<1)return t.ONE;var n=i(),a=i(),o=r.convert(this),f=s(e)-1;for(o.copyTo(n);--f>=0;)if(r.sqrTo(n,a),(e&1<0)r.mulTo(a,o,n);else{var c=n;n=a,a=c}return r.revert(n)},t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=o(r),a=i(),s=i(),f="";for(this.divRemTo(n,a,s);a.signum()>0;)f=(r+s.intValue()).toString(t).substr(1)+f,a.divRemTo(n,a,s);return s.intValue().toString(t)+f},t.prototype.fromRadix=function(e,r){this.fromInt(0),null==r&&(r=10);for(var i=this.chunkSize(r),n=Math.pow(r,i),o=!1,s=0,f=0,c=0;c=i&&(this.dMultiply(n),this.dAddOffset(f,0),s=0,f=0))}s>0&&(this.dMultiply(Math.pow(r,s)),this.dAddOffset(f,0)),o&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,r,i){if("number"==typeof r)if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),c.f,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var n=[],a=7&e;n.length=1+(e>>3),r.nextBytes(n),a>0?n[0]&=(1<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[r++]=i:i<-1&&(e[r++]=this.DV+i),e.t=r,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,r){var i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(var n=r.t-this.t;i=0;)r[i]=0;for(i=Math.max(e-this.t,0);i0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r},t.prototype.millerRabin=function(e){var r=this.subtract(t.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var a=r.shiftRight(n);(e=e+1>>1)>h.length&&(e=h.length);for(var o=i(),s=0;s0&&(r.rShiftTo(o,r),i.rShiftTo(o,i));var s=function(){(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),(a=i.getLowestSetBit())>0&&i.rShiftTo(a,i),r.compareTo(i)>=0?(r.subTo(i,r),r.rShiftTo(1,r)):(i.subTo(r,i),i.rShiftTo(1,i)),r.signum()>0?setTimeout(s,0):(o>0&&i.lShiftTo(o,i),setTimeout(function(){e(i)},0))};setTimeout(s,10)},t.prototype.fromNumberAsync=function(e,r,i,n){if("number"==typeof r)if(e<2)this.fromInt(1);else{this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),c.f,this),this.isEven()&&this.dAddOffset(1,0);var a=this,o=function(){a.dAddOffset(2,0),a.bitLength()>e&&a.subTo(t.ONE.shiftLeft(e-1),a),a.isProbablePrime(r)?setTimeout(function(){n()},0):setTimeout(o,0)};setTimeout(o,0)}else{var s=[],f=7&e;s.length=1+(e>>3),r.nextBytes(s),f>0?s[0]&=(1<=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),b=function(){function t(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=i();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,i,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),g=function(){function t(t){this.m=t,this.r2=i(),this.q3=i(),d.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=i();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),v="undefined"!=typeof navigator;v&&"Microsoft Internet Explorer"==navigator.appName?(d.prototype.am=function(t,e,r,i,n,a){for(var o=32767&e,s=e>>15;--a>=0;){var f=32767&this[t],c=this[t++]>>15,h=s*f+c*o;f=o*f+((32767&h)<<15)+r[i]+(1073741823&n),n=(f>>>30)+(h>>>15)+s*c+(n>>>30),r[i++]=1073741823&f}return n},f=30):v&&"Netscape"!=navigator.appName?(d.prototype.am=function(t,e,r,i,n,a){for(;--a>=0;){var o=e*this[t++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},f=26):(d.prototype.am=function(t,e,r,i,n,a){for(var o=16383&e,s=e>>14;--a>=0;){var f=16383&this[t],c=this[t++]>>14,h=s*f+c*o;f=o*f+((16383&h)<<14)+r[i]+n,n=(f>>28)+(h>>14)+s*c,r[i++]=268435455&f}return n},f=28),d.prototype.DB=f,d.prototype.DM=(1<=n&&e<=a){i.push({startPTS:Math.max(t,r.start(s)),endPTS:Math.min(e,r.end(s))});break}if(tn)i.push({startPTS:Math.max(t,r.start(s)),endPTS:Math.min(e,r.end(s))}),o=!0;else if(e<=n)break}return{time:i,partial:o}},e.prototype.getFragmentKey=function(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn},e.prototype.getPartialFragment=function(t){var e=this,r=void 0,i=void 0,n=void 0,a=null,o=0;return Object.keys(this.fragments).forEach(function(s){var f=e.fragments[s];e.isPartial(f)&&(i=f.body.startPTS-e.bufferPadding,n=f.body.endPTS+e.bufferPadding,t>=i&&t<=n&&(r=Math.min(t-i,n-t),o<=r&&(a=f.body,o=r)))}),a},e.prototype.getState=function(t){var e=this.getFragmentKey(t),r=this.fragments[e],i=f.NOT_LOADED;return void 0!==r&&(i=r.buffered?!0===this.isPartial(r)?f.PARTIAL:f.OK:f.APPENDING),i},e.prototype.isPartial=function(t){return!0===t.buffered&&(void 0!==t.range.video&&!0===t.range.video.partial||void 0!==t.range.audio&&!0===t.range.audio.partial)},e.prototype.isTimeBuffered=function(t,e,r){for(var i=void 0,n=void 0,a=0;a=i&&e<=n)return!0;if(e<=i)return!1}return!1},e.prototype.onFragLoaded=function(t){var e=t.frag;if(!isNaN(e.sn)&&!e.bitrateTest){var r=this.getFragmentKey(e),i={body:e,range:Object.create(null),buffered:!1};this.fragments[r]=i}},e.prototype.onBufferAppended=function(t){var e=this;this.timeRanges=t.timeRanges,Object.keys(this.timeRanges).forEach(function(t){var r=e.timeRanges[t];e.detectEvictedFragments(t,r)})},e.prototype.onFragBuffered=function(t){this.detectPartialFragments(t.frag)},e.prototype.hasFragment=function(t){var e=this.getFragmentKey(t);return void 0!==this.fragments[e]},e.prototype.removeFragment=function(t){var e=this.getFragmentKey(t);delete this.fragments[e]},e.prototype.removeAllFragments=function(){this.fragments=Object.create(null)},e}(o.a)},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,"a",function(){return n});var n=function(){function t(){i(this,t)}return t.isBuffered=function(t,e){try{if(t)for(var r=t.buffered,i=0;i=r.start(i)&&e<=r.end(i))return!0}catch(t){}return!1},t.bufferInfo=function(t,e,r){try{if(t){var i=t.buffered,n=[],a=void 0;for(a=0;ah&&(i[c-1].end=t[f].end):i.push(t[f])}else i.push(t[f])}for(f=0,n=0,a=o=e;f=u&&e2&&void 0!==arguments[2]?arguments[2]:{},a=n.removePKCS7Padding,o=void 0===a||a;if(i(this,t),this.logEnabled=!0,this.observer=e,this.config=r,this.removePKCS7Padding=o,o)try{var s=crypto||self.crypto;this.subtle=s.subtle||s.webkitSubtle}catch(t){}this.disableWebCrypto=!this.subtle}return t.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftwareAES},t.prototype.decrypt=function(t,e,r,i){var s=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(f.b.log("JS AES decrypt"),this.logEnabled=!1);var c=this.decryptor;c||(this.decryptor=c=new o.a),c.expandKey(e),i(c.decrypt(t,0,r,this.removePKCS7Padding))}else{this.logEnabled&&(f.b.log("WebCrypto AES decrypt"),this.logEnabled=!1);var h=this.subtle;this.key!==e&&(this.key=e,this.fastAesKey=new a.a(h,e)),this.fastAesKey.expandKey().then(function(a){new n.a(h,r).decrypt(t,a).catch(function(n){s.onWebCryptoError(n,t,e,r,i)}).then(function(t){i(t)})}).catch(function(n){s.onWebCryptoError(n,t,e,r,i)})}},t.prototype.onWebCryptoError=function(t,e,r,i,n){this.config.enableSoftwareAES?(f.b.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(e,r,i,n)):(f.b.error("decrypting error : "+t.message),this.observer.trigger(Event.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.FRAG_DECRYPT_ERROR,fatal:!0,reason:t.message}))},t.prototype.destroy=function(){var t=this.decryptor;t&&(t.destroy(),this.decryptor=void 0)},t}();e.a=c},function(t,e,r){"use strict";function i(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}e.a=i},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(9),s=function(t){function e(r){i(this,e);for(var a=arguments.length,o=Array(a>1?a-1:0),s=1;s1&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)},e.prototype.doTick=function(){},e}(o.a);e.a=s},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(9),f=r(7),c=r(2),h=r(60),u=r(111),d=function(){function t(t,e){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:null;if(r.isSidxRequest)return this._handleSidxRequest(t,r),void this._handlePlaylistLoaded(t,e,r,i);this.resetInternalLoader(r.type);var n=t.data;if(e.tload=performance.now(),0!==n.indexOf("#EXTM3U"))return void this._handleManifestParsingError(t,r,"no EXTM3U delimiter",i);n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(t,e,r,i):this._handleMasterPlaylist(t,e,r,i)},e.prototype.loaderror=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(e,r)},e.prototype.loadtimeout=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(e,r,!0)},e.prototype._handleMasterPlaylist=function(t,r,i,n){var a=this.hls,s=t.data,f=e.getResponseUrl(t,i),h=u.a.parseMasterPlaylist(s,f);if(!h.length)return void this._handleManifestParsingError(t,i,"no level found in manifest",n);var d=h.map(function(t){return{id:t.attrs.AUDIO,codec:t.audioCodec}}),l=u.a.parseMasterPlaylistMedia(s,f,"AUDIO",d),p=u.a.parseMasterPlaylistMedia(s,f,"SUBTITLES");if(l.length){var b=!1;l.forEach(function(t){t.url||(b=!0)}),!1===b&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(c.b.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),l.unshift({type:"main",name:"main"}))}a.trigger(o.a.MANIFEST_LOADED,{levels:h,audioTracks:l,subtitles:p,url:f,stats:r,networkDetails:n})},e.prototype._handleTrackOrLevelPlaylist=function(t,r,i,n){var a=this.hls,s=i.id,f=i.level,c=i.type,h=e.getResponseUrl(t,i),d=isNaN(s)?0:s,p=isNaN(f)?d:f,b=e.mapContextToLevelType(i),g=u.a.parseLevelPlaylist(t.data,h,p,b,d);if(g.tload=r.tload,c===l.MANIFEST){var v={url:h,details:g};a.trigger(o.a.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:h,stats:r,networkDetails:n})}if(r.tparsed=performance.now(),g.needSidxRanges){var y=g.initSegment.url;return void this.load(y,{isSidxRequest:!0,type:c,level:f,levelDetails:g,id:s,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"})}i.levelDetails=g,this._handlePlaylistLoaded(t,r,i,n)},e.prototype._handleSidxRequest=function(t,e){var r=h.a.parseSegmentIndex(new Uint8Array(t.data));r.references.forEach(function(t,r){var i=t.info,n=e.levelDetails.fragments[r];0===n.byteRange.length&&(n.rawByteRange=String(1+i.end-i.start)+"@"+String(i.start))}),e.levelDetails.initSegment.rawByteRange=String(r.moovEndOffset)+"@0"},e.prototype._handleManifestParsingError=function(t,e,r,i){this.hls.trigger(o.a.ERROR,{type:f.b.NETWORK_ERROR,details:f.a.MANIFEST_PARSING_ERROR,fatal:!0,url:t.url,reason:r,networkDetails:i})},e.prototype._handleNetworkError=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=void 0,n=void 0,a=this.getInternalLoader(t);switch(t.type){case l.MANIFEST:i=r?f.a.MANIFEST_LOAD_TIMEOUT:f.a.MANIFEST_LOAD_ERROR,n=!0;break;case l.LEVEL:i=r?f.a.LEVEL_LOAD_TIMEOUT:f.a.LEVEL_LOAD_ERROR,n=!1;break;case l.AUDIO_TRACK:i=r?f.a.AUDIO_TRACK_LOAD_TIMEOUT:f.a.AUDIO_TRACK_LOAD_ERROR,n=!1;break;default:n=!1}a&&(a.abort(),this.resetInternalLoader(t.type)),this.hls.trigger(o.a.ERROR,{type:f.b.NETWORK_ERROR,details:i,fatal:n,url:a.url,loader:a,context:t,networkDetails:e})},e.prototype._handlePlaylistLoaded=function(t,r,i,n){var a=i.type,s=i.level,f=i.id,c=i.levelDetails;if(!c.targetduration)return void this._handleManifestParsingError(t,i,"invalid target duration",n);if(e.canHaveQualityLevels(i.type))this.hls.trigger(o.a.LEVEL_LOADED,{details:c,level:s||0,id:f||0,stats:r,networkDetails:n});else switch(a){case l.AUDIO_TRACK:this.hls.trigger(o.a.AUDIO_TRACK_LOADED,{details:c,id:f,stats:r,networkDetails:n});break;case l.SUBTITLE_TRACK:this.hls.trigger(o.a.SUBTITLE_TRACK_LOADED,{details:c,id:f,stats:r,networkDetails:n})}},d(e,null,[{key:"ContextType",get:function(){return l}},{key:"LevelType",get:function(){return p}}]),e}(s.a);e.a=b},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=r(2),a=r(5),o=Math.pow(2,32)-1,s=function(){function t(e,r){i(this,t),this.observer=e,this.remuxer=r}return t.prototype.resetTimeStamp=function(t){this.initPTS=t},t.prototype.resetInitSegment=function(e,r,i,n){if(e&&e.byteLength){var o=this.initData=t.parseInitSegment(e);null==r&&(r="mp4a.40.5"),null==i&&(i="avc1.42e01e");var s={};o.audio&&o.video?s.audiovideo={container:"video/mp4",codec:r+","+i,initSegment:n?e:null}:(o.audio&&(s.audio={container:"audio/mp4",codec:r,initSegment:n?e:null}),o.video&&(s.video={container:"video/mp4",codec:i,initSegment:n?e:null})),this.observer.trigger(a.a.FRAG_PARSING_INIT_SEGMENT,{tracks:s})}else r&&(this.audioCodec=r),i&&(this.videoCodec=i)},t.probe=function(e){return t.findBox({data:e,start:0,end:Math.min(e.length,16384)},["moof"]).length>0},t.bin2str=function(t){return String.fromCharCode.apply(null,t)},t.readUint16=function(t,e){t.data&&(e+=t.start,t=t.data);var r=t[e]<<8|t[e+1];return r<0?65536+r:r},t.readUint32=function(t,e){t.data&&(e+=t.start,t=t.data);var r=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return r<0?4294967296+r:r},t.writeUint32=function(t,e,r){t.data&&(e+=t.start,t=t.data),t[e]=r>>24,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r},t.findBox=function(e,r){var i=[],n=void 0,a=void 0,o=void 0,s=void 0,f=void 0,c=void 0,h=void 0;if(e.data?(c=e.start,s=e.end,e=e.data):(c=0,s=e.byteLength),!r.length)return null;for(n=c;n1?n+a:s,o===r[0]&&(1===r.length?i.push({data:e,start:n+8,end:h}):(f=t.findBox({data:e,start:n+8,end:h},r.slice(1)),f.length&&(i=i.concat(f)))),n=h;return i},t.parseSegmentIndex=function(e){var r=t.findBox(e,["moov"])[0],i=r?r.end:null,n=0,a=t.findBox(e,["sidx"]),o=void 0;if(!a||!a[0])return null;o=[],a=a[0];var s=a.data[0];n=0===s?8:16;var f=t.readUint32(a,n);n+=4;n+=0===s?8:16,n+=2;var c=a.end+0,h=t.readUint16(a,n);n+=2;for(var u=0;u>>31)return void console.warn("SIDX has hierarchical references (not supported)");var b=t.readUint32(a,d);d+=4,o.push({referenceSize:p,subsegmentDuration:b,info:{duration:b/f,start:c,end:c+p-1}}),c+=p,d+=4,n=d}return{earliestPresentationTime:0,timescale:f,version:s,referencesCount:h,references:o,moovEndOffset:i}},t.parseInitSegment=function(e){var r=[];return t.findBox(e,["moov","trak"]).forEach(function(e){var i=t.findBox(e,["tkhd"])[0];if(i){var a=i.data[i.start],o=0===a?12:20,s=t.readUint32(i,o),f=t.findBox(e,["mdia","mdhd"])[0];if(f){a=f.data[f.start],o=0===a?12:20;var c=t.readUint32(f,o),h=t.findBox(e,["mdia","hdlr"])[0];if(h){var u=t.bin2str(h.data.subarray(h.start+8,h.start+12)),d={soun:"audio",vide:"video"}[u];if(d){var l=t.findBox(e,["mdia","minf","stbl","stsd"]);if(l.length){l=l[0];var p=t.bin2str(l.data.subarray(l.start+12,l.start+16));n.b.log("MP4Demuxer:"+d+":"+p+" found")}r[s]={timescale:c,type:d},r[d]={timescale:c,id:s}}}}}}),r},t.getStartDTS=function(e,r){var i=void 0,n=void 0,a=void 0;return i=t.findBox(r,["moof","traf"]),n=[].concat.apply([],i.map(function(r){return t.findBox(r,["tfhd"]).map(function(i){var n=void 0,a=void 0;return n=t.readUint32(i,4),a=e[n].timescale||9e4,t.findBox(r,["tfdt"]).map(function(e){var r=void 0,i=void 0;return r=e.data[e.start],i=t.readUint32(e,4),1===r&&(i*=Math.pow(2,32),i+=t.readUint32(e,8)),i})[0]/a})})),a=Math.min.apply(null,n),isFinite(a)?a:0},t.offsetStartDTS=function(e,r,i){t.findBox(r,["moof","traf"]).map(function(r){return t.findBox(r,["tfhd"]).map(function(n){var a=t.readUint32(n,4),s=e[a].timescale||9e4;t.findBox(r,["tfdt"]).map(function(e){var r=e.data[e.start],n=t.readUint32(e,4);if(0===r)t.writeUint32(e,4,n-i*s);else{n*=Math.pow(2,32),n+=t.readUint32(e,8),n-=i*s,n=Math.max(n,0);var a=Math.floor(n/(o+1)),f=Math.floor(n%(o+1));t.writeUint32(e,4,a),t.writeUint32(e,8,f)}})})})},t.prototype.append=function(e,r,i,n){var o=this.initData;o||(this.resetInitSegment(e,this.audioCodec,this.videoCodec,!1),o=this.initData);var s=void 0,f=this.initPTS;if(void 0===f){var c=t.getStartDTS(o,e);this.initPTS=f=c-r,this.observer.trigger(a.a.INIT_PTS_FOUND,{initPTS:f})}t.offsetStartDTS(o,e,f),s=t.getStartDTS(o,e),this.remuxer.remux(o.audio,o.video,null,null,s,i,n,e)},t.prototype.destroy=function(){},t}();e.a=s},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=r(29),a=r.n(n),o=function(){function t(t,e){for(var r=0;r0?("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===N.prototype||(e=n(e)),i?o.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):h(t,o,e,!0):o.ended?t.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?h(t,o,e,!1):y(t,o)):h(t,o,e,!1))):i||(o.reading=!1)}return d(o)}function h(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&g(t)),y(t,e)}function u(t,e){var r;return a(e)||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function d(t){return!t.ended&&(t.needReadable||t.length=V?t=V:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function p(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=l(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function b(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,g(t)}}function g(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(G("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?L(v,t):v(t))}function v(t){G("emit readable"),t.emit("readable"),A(t)}function y(t,e){e.readingMore||(e.readingMore=!0,L(m,t,e))}function m(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=R(t,e.buffer,e.decoder),r}function R(t,e,r){var i;return ta.length?a.length:t;if(o===a.length?n+=a:n+=a.slice(0,t),0===(t-=o)){o===a.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=a.slice(o));break}++i}return e.length-=i,n}function D(t,e){var r=N.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var a=i.data,o=t>a.length?a.length:t;if(a.copy(r,r.length-t,0,o),0===(t-=o)){o===a.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=a.slice(o));break}++n}return e.length-=n,r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,L(M,e,t))}function M(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function x(t,e){for(var r=0,i=t.length;r=e.highWaterMark||e.ended))return G("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):g(this),null;if(0===(t=p(t,e))&&e.ended)return 0===e.length&&I(this),null;var i=e.needReadable;G("need readable",i),(0===e.length||e.length-t0?T(t,e):null,null===n?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==n&&this.emit("data",n),n},f.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},f.prototype.pipe=function(t,e){function r(t,e){G("onunpipe"),t===d&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,a())}function n(){G("onend"),t.end()}function a(){G("cleanup"),t.removeListener("close",c),t.removeListener("finish",h),t.removeListener("drain",g),t.removeListener("error",f),t.removeListener("unpipe",r),d.removeListener("end",n),d.removeListener("end",u),d.removeListener("data",s),v=!0,!l.awaitDrain||t._writableState&&!t._writableState.needDrain||g()}function s(e){G("ondata"),y=!1,!1!==t.write(e)||y||((1===l.pipesCount&&l.pipes===t||l.pipesCount>1&&-1!==x(l.pipes,t))&&!v&&(G("false write response, pause",d._readableState.awaitDrain),d._readableState.awaitDrain++,y=!0),d.pause())}function f(e){G("onerror",e),u(),t.removeListener("error",f),0===P(t,"error")&&t.emit("error",e)}function c(){t.removeListener("finish",h),u()}function h(){G("onfinish"),t.removeListener("close",c),u()}function u(){G("unpipe"),d.unpipe(t)}var d=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=t;break;case 1:l.pipes=[l.pipes,t];break;default:l.pipes.push(t)}l.pipesCount+=1,G("pipe count=%d opts=%j",l.pipesCount,e);var p=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr,b=p?n:u;l.endEmitted?L(b):d.once("end",b),t.on("unpipe",r);var g=_(d);t.on("drain",g);var v=!1,y=!1;return d.on("data",s),o(t,"error",f),t.once("close",c),t.once("finish",h),t.emit("pipe",d),l.flowing||(G("pipe resume"),d.resume()),t},f.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function s(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function f(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function c(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}var h=r(0),u=r(21),d=r(3).Buffer,l=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=new Array(64);h(i,u),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},i.prototype._update=function(t){for(var e=this._w,r=0|this._a,i=0|this._b,h=0|this._c,u=0|this._d,d=0|this._e,p=0|this._f,b=0|this._g,g=0|this._h,v=0;v<16;++v)e[v]=t.readInt32BE(4*v);for(;v<64;++v)e[v]=c(e[v-2])+e[v-7]+f(e[v-15])+e[v-16]|0;for(var y=0;y<64;++y){var m=g+s(d)+n(d,p,b)+l[y]+e[y]|0,_=o(r)+a(r,i,h)|0;g=b,b=p,p=d,d=u+m|0,u=h,h=i,i=r,r=m+_|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=h+this._c|0,this._d=u+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=g+this._h|0},i.prototype._hash=function(){var t=d.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=i},function(t,e,r){function i(){this.init(),this._w=v,p.call(this,128,112)}function n(t,e,r){return r^t&(e^r)}function a(t,e,r){return t&e|r&(t|e)}function o(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function s(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function f(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function c(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function h(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function u(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function d(t,e){return t>>>0>>0?1:0}var l=r(0),p=r(21),b=r(3).Buffer,g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],v=new Array(160);l(i,p),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},i.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,l=0|this._ch,p=0|this._dh,b=0|this._eh,v=0|this._fh,y=0|this._gh,m=0|this._hh,_=0|this._al,w=0|this._bl,S=0|this._cl,E=0|this._dl,A=0|this._el,T=0|this._fl,R=0|this._gl,k=0|this._hl,D=0;D<32;D+=2)e[D]=t.readInt32BE(4*D),e[D+1]=t.readInt32BE(4*D+4);for(;D<160;D+=2){var I=e[D-30],M=e[D-30+1],x=f(I,M),L=c(M,I);I=e[D-4],M=e[D-4+1];var O=h(I,M),C=u(M,I),P=e[D-14],B=e[D-14+1],N=e[D-32],F=e[D-32+1],U=L+B|0,j=x+P+d(U,L)|0;U=U+C|0,j=j+O+d(U,C)|0,U=U+F|0,j=j+N+d(U,F)|0,e[D]=j,e[D+1]=U}for(var G=0;G<160;G+=2){j=e[G],U=e[G+1];var K=a(r,i,l),z=a(_,w,S),H=o(r,_),q=o(_,r),V=s(b,A),W=s(A,b),Y=g[G],X=g[G+1],Z=n(b,v,y),J=n(A,T,R),Q=k+W|0,$=m+V+d(Q,k)|0;Q=Q+J|0,$=$+Z+d(Q,J)|0,Q=Q+X|0,$=$+Y+d(Q,X)|0,Q=Q+U|0,$=$+j+d(Q,U)|0;var tt=q+z|0,et=H+K+d(tt,q)|0;m=y,k=R,y=v,R=T,v=b,T=A,A=E+Q|0,b=p+$+d(A,E)|0,p=l,E=S,l=i,S=w,i=r,w=_,_=Q+tt|0,r=$+et+d(_,Q)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+A|0,this._fl=this._fl+T|0,this._gl=this._gl+R|0,this._hl=this._hl+k|0,this._ah=this._ah+r+d(this._al,_)|0,this._bh=this._bh+i+d(this._bl,w)|0,this._ch=this._ch+l+d(this._cl,S)|0,this._dh=this._dh+p+d(this._dl,E)|0,this._eh=this._eh+b+d(this._el,A)|0,this._fh=this._fh+v+d(this._fl,T)|0,this._gh=this._gh+y+d(this._gl,R)|0,this._hh=this._hh+m+d(this._hl,k)|0},i.prototype._hash=function(){function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}var e=b.allocUnsafe(64);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},t.exports=i},function(t,e,r){"use strict";function i(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;if(this._alg=t,this._key=e,e.length>r){e=("rmd160"===t?new c:h(t)).update(e).digest()}else e.lengthr||e!==e)throw new TypeError("Bad key length")}},function(t,e,r){(function(e){var r;if(e.browser)r="utf-8";else{r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}t.exports=r}).call(e,r(14))},function(t,e,r){function i(t,e,r){var i=n(t),a="sha512"===t||"sha384"===t?128:64;e.length>a?e=i(e):e.lengtht;)r.ishrn(1);if(r.isEven()&&r.iadd(d),r.testn(1)||r.iadd(l),e.cmp(l)){if(!e.cmp(p))for(;r.mod(b).cmp(g);)r.iadd(y)}else for(;r.mod(c).cmp(v);)r.iadd(y);if(i=r.shrn(1),n(i)&&n(r)&&a(i)&&a(r)&&u.test(i)&&u.test(r))return r}}var s=r(19);t.exports=o,o.simpleSieve=n,o.fermatTest=a;var f=r(6),c=new f(24),h=r(82),u=new h,d=new f(1),l=new f(2),p=new f(5),b=(new f(16),new f(8),new f(10)),g=new f(3),v=(new f(7),new f(11)),y=new f(4),m=(new f(12),null)},function(t,e,r){function i(t){this.rand=t||new a.Rand}var n=r(6),a=r(83);t.exports=i,i.create=function(t){return new i(t)},i.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},i.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},i.prototype.test=function(t,e,r){var i=t.bitLength(),a=n.mont(t),o=new n(1).toRed(a);e||(e=Math.max(1,i/48|0));for(var s=t.subn(1),f=0;!s.testn(f);f++);for(var c=t.shrn(f),h=s.toRed(a);e>0;e--){var u=this._randrange(new n(2),s);r&&r(u);var d=u.toRed(a).redPow(c);if(0!==d.cmp(o)&&0!==d.cmp(h)){for(var l=1;l0;e--){var h=this._randrange(new n(2),o),u=t.gcd(h);if(0!==u.cmpn(1))return u;var d=h.toRed(i).redPow(f);if(0!==d.cmp(a)&&0!==d.cmp(c)){for(var l=1;l>8,o=255&n;a?r.push(a,o):r.push(o)}return r}function n(t){return 1===t.length?"0"+t:t}function a(t){for(var e="",r=0;r>>3}function h(t){return d(t,17)^d(t,19)^t>>>10}var u=r(12),d=u.rotr32;e.ft_1=i,e.ch32=n,e.maj32=a,e.p32=o,e.s0_256=s,e.s1_256=f,e.g0_256=c,e.g1_256=h},function(t,e,r){"use strict";function i(){if(!(this instanceof i))return new i;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}var n=r(12),a=r(26),o=r(85),s=r(11),f=n.sum32,c=n.sum32_4,h=n.sum32_5,u=o.ch32,d=o.maj32,l=o.s0_256,p=o.s1_256,b=o.g0_256,g=o.g1_256,v=a.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];n.inherits(i,v),t.exports=i,i.blockSize=512,i.outSize=256,i.hmacStrength=192,i.padLength=64,i.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i>6],n=0==(32&r);if(31==(31&r)){var a=r;for(r=0;128==(128&a);){if(a=t.readUInt8(e),t.isError(a))return a;r<<=7,r|=127&a}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:u.tag[r]}}function o(t,e,r){var i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(var a=0;a=31?i.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|=u.tagClassByName[r||"universal"]<<6)}var s=r(0),f=r(4).Buffer,c=r(27),h=c.base,u=c.constants.der;t.exports=i,i.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},s(n,h.Node),n.prototype._encodeComposite=function(t,e,r,i){var n=o(t,e,r,this.reporter);if(i.length<128){var a=new f(2);return a[0]=n,a[1]=i.length,this._createEncoderBuffer([a,i])}for(var s=1,c=i.length;c>=256;c>>=8)s++;var a=new f(2+s);a[0]=n,a[1]=128|s;for(var c=1+s,h=i.length;h>0;c--,h>>=8)a[c]=255&h;return this._createEncoderBuffer([a,i])},n.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new f(2*t.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}for(var n=0,i=0;i=128;a>>=7)n++}for(var o=new f(n),s=o.length-1,i=t.length-1;i>=0;i--){var a=t[i];for(o[s--]=127&a;(a>>=7)>0;)o[s--]=128|127&a}return this._createEncoderBuffer(o)},n.prototype._encodeTime=function(t,e){var r,i=new Date(t);return"gentime"===e?r=[a(i.getFullYear()),a(i.getUTCMonth()+1),a(i.getUTCDate()),a(i.getUTCHours()),a(i.getUTCMinutes()),a(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[a(i.getFullYear()%100),a(i.getUTCMonth()+1),a(i.getUTCDate()),a(i.getUTCHours()),a(i.getUTCMinutes()),a(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},n.prototype._encodeNull=function(){return this._createEncoderBuffer("")},n.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!f.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new f(r)}if(f.isBuffer(t)){var i=t.length;0===t.length&&i++;var n=new f(i);return t.copy(n),0===t.length&&(n[0]=0),this._createEncoderBuffer(n)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var i=1,a=t;a>=256;a>>=8)i++;for(var n=new Array(i),a=n.length-1;a>=0;a--)n[a]=255&t,t>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new f(n))},n.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},n.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},n.prototype._skipDefault=function(t,e,r){var i,n=this._baseState;if(null===n.default)return!1;var a=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i>6)+o.charAt(63&r);for(e+1==t.length?(r=parseInt(t.substring(e,e+1),16),i+=o.charAt(r<<2)):e+2==t.length&&(r=parseInt(t.substring(e,e+2),16),i+=o.charAt(r>>2)+o.charAt((3&r)<<4));(3&i.length)>0;)i+=s;return i}function n(t){var e,r="",i=0,n=0;for(e=0;e>2),n=3&f,i=1):1==i?(r+=Object(a.b)(n<<2|f>>4),n=15&f,i=2):2==i?(r+=Object(a.b)(n),r+=Object(a.b)(f>>2),n=3&f,i=3):(r+=Object(a.b)(n<<2|f>>4),r+=Object(a.b)(15&f),i=0))}return 1==i&&(r+=Object(a.b)(n<<2)),r}e.b=i,e.a=n;var a=r(97),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s="="},function(t,e,r){"use strict";function i(t){return h.charAt(t)}function n(t,e){return t&e}function a(t,e){return t|e}function o(t,e){return t^e}function s(t,e){return t&~e}function f(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function c(t){for(var e=0;0!=t;)t&=t-1,++e;return e}e.b=i,e.d=n,e.f=a,e.g=o,e.e=s,e.c=f,e.a=c;var h="0123456789abcdefghijklmnopqrstuvwxyz"},function(t,e,r){!function(i,n){t.exports=e=n(r(1))}(0,function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,a=i.Hasher,o=r.algo,s=[],f=[];!function(){function t(t){return 4294967296*(t-(0|t))|0}for(var r=2,i=0;i<64;)(function(t){for(var r=e.sqrt(t),i=2;i<=r;i++)if(!(t%i))return!1;return!0})(r)&&(i<8&&(s[i]=t(e.pow(r,.5))),f[i]=t(e.pow(r,1/3)),i++),r++}();var c=[],h=o.SHA256=a.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],h=r[5],u=r[6],d=r[7],l=0;l<64;l++){if(l<16)c[l]=0|t[e+l];else{var p=c[l-15],b=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=c[l-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[l]=b+c[l-7]+v+c[l-16]}var y=s&h^~s&u,m=i&n^i&a^n&a,_=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),w=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),S=d+w+y+f[l]+c[l],E=_+m;d=u,u=h,h=s,s=o+S|0,o=a,a=n,n=i,i=S+E|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+h|0,r[6]=r[6]+u|0,r[7]=r[7]+d|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=e.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}});r.SHA256=a._createHelper(h),r.HmacSHA256=a._createHmacHelper(h)}(Math),t.SHA256})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(38))}(0,function(t){return function(){function e(){return o.create.apply(o,arguments)}var r=t,i=r.lib,n=i.Hasher,a=r.x64,o=a.Word,s=a.WordArray,f=r.algo,c=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],h=[];!function(){for(var t=0;t<80;t++)h[t]=e()}();var u=f.SHA512=n.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],f=r[5],u=r[6],d=r[7],l=i.high,p=i.low,b=n.high,g=n.low,v=a.high,y=a.low,m=o.high,_=o.low,w=s.high,S=s.low,E=f.high,A=f.low,T=u.high,R=u.low,k=d.high,D=d.low,I=l,M=p,x=b,L=g,O=v,C=y,P=m,B=_,N=w,F=S,U=E,j=A,G=T,K=R,z=k,H=D,q=0;q<80;q++){var V,W,Y=h[q];if(q<16)W=Y.high=0|t[e+2*q],V=Y.low=0|t[e+2*q+1];else{var X=h[q-15],Z=X.high,J=X.low,Q=(Z>>>1|J<<31)^(Z>>>8|J<<24)^Z>>>7,$=(J>>>1|Z<<31)^(J>>>8|Z<<24)^(J>>>7|Z<<25),tt=h[q-2],et=tt.high,rt=tt.low,it=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,nt=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),at=h[q-7],ot=at.high,st=at.low,ft=h[q-16],ct=ft.high,ht=ft.low;V=$+st,W=Q+ot+(V>>>0<$>>>0?1:0),V+=nt,W=W+it+(V>>>0>>0?1:0),V+=ht,W=W+ct+(V>>>0>>0?1:0),Y.high=W,Y.low=V}var ut=N&U^~N&G,dt=F&j^~F&K,lt=I&x^I&O^x&O,pt=M&L^M&C^L&C,bt=(I>>>28|M<<4)^(I<<30|M>>>2)^(I<<25|M>>>7),gt=(M>>>28|I<<4)^(M<<30|I>>>2)^(M<<25|I>>>7),vt=(N>>>14|F<<18)^(N>>>18|F<<14)^(N<<23|F>>>9),yt=(F>>>14|N<<18)^(F>>>18|N<<14)^(F<<23|N>>>9),mt=c[q],_t=mt.high,wt=mt.low,St=H+yt,Et=z+vt+(St>>>0>>0?1:0),St=St+dt,Et=Et+ut+(St>>>0
>>0?1:0),St=St+wt,Et=Et+_t+(St>>>0>>0?1:0),St=St+V,Et=Et+W+(St>>>0>>0?1:0),At=gt+pt,Tt=bt+lt+(At>>>0>>0?1:0);z=G,H=K,G=U,K=j,U=N,j=F,F=B+St|0,N=P+Et+(F>>>0>>0?1:0)|0,P=O,B=C,O=x,C=L,x=I,L=M,M=St+At|0,I=Et+Tt+(M>>>0>>0?1:0)|0}p=i.low=p+M,i.high=l+I+(p>>>0>>0?1:0),g=n.low=g+L,n.high=b+x+(g>>>0>>0?1:0),y=a.low=y+C,a.high=v+O+(y>>>0>>0?1:0),_=o.low=_+B,o.high=m+P+(_>>>0>>0?1:0),S=s.low=S+F,s.high=w+N+(S>>>0>>0?1:0),A=f.low=A+j,f.high=E+U+(A>>>0>>0?1:0),R=u.low=R+K,u.high=T+G+(R>>>0>>0?1:0),D=d.low=D+H,d.high=k+z+(D>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(i+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});r.SHA512=n._createHelper(u),r.HmacSHA512=n._createHmacHelper(u)}(),t.SHA512})},function(t,e,r){/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ !function(e){"use strict";function r(t){return parseInt(t)===t}function i(t){if(!r(t.length))return!1;for(var e=0;e255)return!1;return!0}function n(t,e){if(t.buffer&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!i(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&i(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function a(t){return new Uint8Array(t)}function o(t,e,r,i,n){null==i&&null==n||(t=t.slice?t.slice(i,n):Array.prototype.slice.call(t,i,n)),e.set(t,r)}function s(t){for(var e=[],r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=t.length-e,i=0;i191&&i<224?(e.push(String.fromCharCode((31&i)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&i)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}return{toBytes:t,fromBytes:e}}(),u=function(){function t(t){for(var e=[],r=0;r>4]+r[15&n])}return e.join("")}var r="0123456789abcdef";return{toBytes:t,fromBytes:e}}(),d={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],p=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],b=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],g=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],v=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],y=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],m=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],_=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],w=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],S=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],E=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],T=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],R=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],k=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925],D=function(t){if(!(this instanceof D))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:n(t,!0)}),this._prepare()};D.prototype._prepare=function(){var t=d[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var r,i=4*(t+1),n=this.key.length/4,a=s(this.key),e=0;e>2,this._Ke[r][e%4]=a[e],this._Kd[t-r][e%4]=a[e];for(var o,f=0,c=n;c>16&255]<<24^p[o>>8&255]<<16^p[255&o]<<8^p[o>>24&255]^l[f]<<24,f+=1,8!=n)for(var e=1;e>8&255]<<8^p[o>>16&255]<<16^p[o>>24&255]<<24;for(var e=n/2+1;e>2,u=c%4,this._Ke[h][u]=a[e],this._Kd[t-h][u]=a[e++],c++}for(var h=1;h>24&255]^T[o>>16&255]^R[o>>8&255]^k[255&o]},D.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],i=s(t),n=0;n<4;n++)i[n]^=this._Ke[0][n];for(var o=1;o>24&255]^v[i[(n+1)%4]>>16&255]^y[i[(n+2)%4]>>8&255]^m[255&i[(n+3)%4]]^this._Ke[o][n];i=r.slice()}for(var f,c=a(16),n=0;n<4;n++)f=this._Ke[e][n],c[4*n]=255&(p[i[n]>>24&255]^f>>24),c[4*n+1]=255&(p[i[(n+1)%4]>>16&255]^f>>16),c[4*n+2]=255&(p[i[(n+2)%4]>>8&255]^f>>8),c[4*n+3]=255&(p[255&i[(n+3)%4]]^f);return c},D.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],i=s(t),n=0;n<4;n++)i[n]^=this._Kd[0][n];for(var o=1;o>24&255]^w[i[(n+3)%4]>>16&255]^S[i[(n+2)%4]>>8&255]^E[255&i[(n+1)%4]]^this._Kd[o][n];i=r.slice()}for(var f,c=a(16),n=0;n<4;n++)f=this._Kd[e][n],c[4*n]=255&(b[i[n]>>24&255]^f>>24),c[4*n+1]=255&(b[i[(n+3)%4]>>16&255]^f>>16),c[4*n+2]=255&(b[i[(n+2)%4]>>8&255]^f>>8),c[4*n+3]=255&(b[255&i[(n+1)%4]]^f);return c};var I=function(t){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new D(t)};I.prototype.encrypt=function(t){if(t=n(t),t.length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=a(t.length),r=a(16),i=0;iNumber.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var e=15;e>=0;--e)this._counter[e]=t%256,t=parseInt(t/256)},O.prototype.setBytes=function(t){if(t=n(t,!0),16!=t.length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},O.prototype.increment=function(){for(var t=15;t>=0;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var C=function(t,e){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof O||(e=new O(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new D(t)};C.prototype.encrypt=function(t){for(var e=n(t,!0),r=0;r1?e-1:0),i=1;i1?e-1:0),i=1;i0&&null!=e&&null!=e.key&&"AES-128"===e.method){var p=this.decrypter;null==p&&(p=this.decrypter=new o.a(this.observer,this.config));var b=this,g=void 0;try{g=performance.now()}catch(t){g=Date.now()}p.decrypt(t,e.key.buffer,e.iv.buffer,function(t){var o=void 0;try{o=performance.now()}catch(t){o=Date.now()}b.observer.trigger(n.a.FRAG_DECRYPTED,{stats:{tstart:g,tdecrypt:o}}),b.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),i,a,s,f,c,h,u,d,l)})}else this.pushDecrypted(new Uint8Array(t),e,new Uint8Array(r),i,a,s,f,c,h,u,d,l)},t.prototype.pushDecrypted=function(t,e,r,i,o,l,p,b,g,v,y,m){var _=this.demuxer;if(!_||(p||b)&&!this.probe(t)){for(var w=this.observer,S=this.typeSupported,E=this.config,A=[{demux:c.a,remux:u.a},{demux:f.a,remux:d.a},{demux:s.a,remux:u.a},{demux:h.a,remux:u.a}],T=0,R=A.length;T>>6),(a=(60&e[r+2])>>>2)>u.length-1?void t.trigger(Event.ERROR,{type:p.b.MEDIA_ERROR,details:p.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+a}):(s=(1&e[r+2])<<2,s|=(192&e[r+3])>>>6,l.b.log("manifest codec:"+i+",ADTS data:type:"+n+",sampleingIndex:"+a+"["+u[a]+"Hz],channelConfig:"+s),/firefox/i.test(c)?a>=6?(n=5,f=new Array(4),o=a-3):(n=2,f=new Array(2),o=a):-1!==c.indexOf("android")?(n=2,f=new Array(2),o=a):(n=5,f=new Array(4),i&&(-1!==i.indexOf("mp4a.40.29")||-1!==i.indexOf("mp4a.40.5"))||!i&&a>=6?o=a-3:((i&&-1!==i.indexOf("mp4a.40.2")&&(a>=6&&1===s||/vivaldi/i.test(c))||!i&&1===s)&&(n=2,f=new Array(2)),o=a)),f[0]=n<<3,f[0]|=(14&a)>>1,f[1]|=(1&a)<<7,f[1]|=s<<3,5===n&&(f[1]|=(14&o)>>1,f[2]=(1&o)<<7,f[2]|=8,f[3]=0),{config:f,samplerate:u[a],channelCount:s,codec:"mp4a.40."+n,manifestCodec:h})}function n(t,e){return 255===t[e]&&240==(246&t[e+1])}function a(t,e){return 1&t[e+1]?7:9}function o(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function s(t,e){return!!(e+10&&e+s+f<=h)return c=r+i*n,{headerLength:s,frameLength:f,stamp:c}}function d(t,e,r,i,n){var a=h(t.samplerate),o=u(e,r,i,n,a);if(o){var s=o.stamp,f=o.headerLength,c=o.frameLength,d={unit:e.subarray(r+f,r+f+c),pts:s,dts:s};return t.samples.push(d),t.len+=c,{sample:d,length:c+f}}}e.d=s,e.e=f,e.c=c,e.b=h,e.a=d;var l=r(2),p=r(7)},function(t,e,r){"use strict";var i={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(t,e,r,i,n){if(!(r+24>e.length)){var a=this.parseHeader(e,r);if(a&&r+a.frameLength<=e.length){var o=9e4*a.samplesPerFrame/a.sampleRate,s=i+n*o,f={unit:e.subarray(r,r+a.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(f),t.len+=a.frameLength,{sample:f,length:a.frameLength}}}},parseHeader:function(t,e){var r=t[e+1]>>3&3,n=t[e+1]>>1&3,a=t[e+2]>>4&15,o=t[e+2]>>2&3,s=t[e+2]>>1&1;if(1!==r&&0!==a&&15!==a&&3!==o){var f=3===r?3-n:3===n?3:4,c=1e3*i.BitratesMap[14*f+a-1],h=3===r?0:2===r?1:2,u=i.SamplingRateMap[3*h+o],d=t[e+3]>>6==3?1:2,l=i.SamplesCoefficients[r][n],p=i.BytesInSlot[n],b=8*l*p;return{sampleRate:u,channelCount:d,frameLength:parseInt(l*c/u+s,10)*p,samplesPerFrame:b}}},isHeaderPattern:function(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])},isHeader:function(t,e){return!!(e+1e?i.start+i.duration:Math.max(i.start-n.duration,0):r>e?(i.duration=a-i.start,i.duration<0&&o.b.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(n.duration=i.start-a,n.duration<0&&o.b.warn("negative duration computed for frag "+n.sn+",level "+n.level+", there should be some duration drift between playlist and fragment!"))}function n(t,e,r,n,a,o){var s=r;if(!isNaN(e.startPTS)){var f=Math.abs(e.startPTS-r);isNaN(e.deltaPTS)?e.deltaPTS=f:e.deltaPTS=Math.max(f,e.deltaPTS),s=Math.max(r,e.startPTS),r=Math.min(r,e.startPTS),n=Math.max(n,e.endPTS),a=Math.min(a,e.startDTS),o=Math.max(o,e.endDTS)}var c=r-e.start;e.start=e.startPTS=r,e.maxStartPTS=s,e.endPTS=n,e.startDTS=a,e.endDTS=o,e.duration=n-r;var h=e.sn;if(!t||ht.endSN)return 0;var u=void 0,d=void 0,l=void 0;for(u=h-t.startSN,d=t.fragments,d[u]=e,l=u;l>0;l--)i(d,l,l-1);for(l=u;l=0&&ae?-1:0})}function a(t,e,r){var i=!1;return e&&e.details&&r&&(r.endCC>r.startCC||t&&t.cc0;)t.removeCue(t.cues[0])}e.b=i,e.a=n},function(t,e,r){"use strict";function i(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new h,this.regionList=[]}function n(t){function e(t,e,r,i){return 3600*(0|t)+60*(0|e)+(0|r)+(0|i)/1e3}var r=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?e(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?e(r[1],r[2],0,r[4]):e(0,r[1],r[2],r[4]):null}function a(){this.values=Object.create(null)}function o(t,e,r,i){var n=i?t.split(i):[t];for(var a in n)if("string"==typeof n[a]){var o=n[a].split(r);if(2===o.length){var s=o[0],f=o[1];e(s,f)}}}function s(t,e,r){function i(){var e=n(t);if(null===e)throw new Error("Malformed timestamp: "+f);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function s(){t=t.replace(/^\s+/,"")}var f=t;if(s(),e.startTime=i(),s(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+f);t=t.substr(3),s(),e.endTime=i(),s(),function(t,e){var i=new a;o(t,function(t,e){switch(t){case"region":for(var n=r.length-1;n>=0;n--)if(r[n].id===e){i.set(t,r[n].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":var a=e.split(","),o=a[0];i.integer(t,o),i.percent(t,o)&&i.set("snapToLines",!1),i.alt(t,o,["auto"]),2===a.length&&i.alt("lineAlign",a[1],["start",d,"end"]);break;case"position":a=e.split(","),i.percent(t,a[0]),2===a.length&&i.alt("positionAlign",a[1],["start",d,"end","line-left","line-right","auto"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start",d,"end","left","right"])}},/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical","");var n=i.get("line","auto");"auto"===n&&-1===u.line&&(n=-1),e.line=n,e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100),e.align=i.get("align",d);var s=i.get("position","auto");"auto"===s&&50===u.position&&(s="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=s}(t,e)}function f(t){return t.replace(//gi,"\n")}r.d(e,"b",function(){return f});var c=r(275),h=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}};a.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,r){for(var i=0;i=0&&e<=100)&&(this.set(t,e),!0)}};var u=new c.a(0,0,0),d="middle"===u.align?"middle":"center";i.prototype={parse:function(t){function e(){var t=r.buffer,e=0;for(t=f(t);e0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=t.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var a in n)a in r||(r[a]=n[a]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');Object(b.a)(r.debug),this.config=r,this._autoLevelCapping=-1;var o=this.observer=new m.a;o.trigger=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i1?e-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:-1;b.b.log("startLoad("+t+")"),this.networkControllers.forEach(function(e){e.startLoad(t)})},t.prototype.stopLoad=function(){b.b.log("stopLoad"),this.networkControllers.forEach(function(t){t.stopLoad()})},t.prototype.swapAudioCodec=function(){b.b.log("swapAudioCodec"),this.streamController.swapAudioCodec()},t.prototype.recoverMediaError=function(){b.b.log("recoverMediaError");var t=this.media;this.detachMedia(),this.attachMedia(t)},_(t,[{key:"levels",get:function(){return this.levelController.levels},set:function(t){return this.levelController.levels=t}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){b.b.log("set currentLevel:"+t),this.loadLevel=t,this.config.seamlessHandover?this.streamController.nextLevelSwitch():this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){b.b.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){b.b.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){b.b.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){b.b.log("set startLevel:"+t);var e=this;-1!==t&&(t=Math.max(t,e.minAutoLevel)),e.levelController.startLevel=t}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){b.b.log("set autoLevelCapping:"+t),this._autoLevelCapping=t}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var t=this,e=t.levels,r=t.config.minAutoBitrate,i=e?e.length:0,n=0;nr)return n}return 0}},{key:"maxAutoLevel",get:function(){var t=this,e=t.levels,r=t.autoLevelCapping;return-1===r&&e&&e.length?e.length-1:r}},{key:"nextAutoLevel",get:function(){var t=this;return Math.min(Math.max(t.abrController.nextAutoLevel,t.minAutoLevel),t.maxAutoLevel)},set:function(t){var e=this;e.abrController.nextAutoLevel=Math.max(e.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}}]),t}();e.default=w},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=r(29),a=r.n(n),o=r(41),s=r(61),f=r(112),c=r(2),h=r(62),u=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,d=/#EXT-X-MEDIA:(.*)/g,l=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)(\S+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),p=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)(.*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,b=/\.(mp4|m4s|m4v|m4a)$/i,g=function(){function t(){i(this,t)}return t.findGroup=function(t,e){if(!t)return null;for(var r=null,i=0;i2?(e=r.shift()+".",e+=parseInt(r.shift()).toString(16),e+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):e=t,e},t.resolve=function(t,e){return a.a.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){var i=[],n=void 0;for(u.lastIndex=0;null!=(n=u.exec(e));){var a={},o=a.attrs=new f.a(n[1]);a.url=t.resolve(n[2],r);var s=o.decimalResolution("RESOLUTION");s&&(a.width=s.width,a.height=s.height),a.bitrate=o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),a.name=o.NAME,function(t,e){["video","audio"].forEach(function(r){var i=t.filter(function(t){return Object(h.b)(t,r)});if(i.length){var n=i.filter(function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)});e[r+"Codec"]=n.length>0?n[0]:i[0],t=t.filter(function(t){return-1===i.indexOf(t)})}}),e.unknownCodecs=t}([].concat((o.CODECS||"").split(/[ ,]+/)),a),a.videoCodec&&-1!==a.videoCodec.indexOf("avc1")&&(a.videoCodec=t.convertAVC1ToAVCOTI(a.videoCodec)),i.push(a)}return i},t.parseMasterPlaylistMedia=function(e,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=void 0,o=[],s=0;for(d.lastIndex=0;null!==(a=d.exec(e));){var c={},h=new f.a(a[1]);if(h.TYPE===i){if(c.groupId=h["GROUP-ID"],c.name=h.NAME,c.type=i,c.default="YES"===h.DEFAULT,c.autoselect="YES"===h.AUTOSELECT,c.forced="YES"===h.FORCED,h.URI&&(c.url=t.resolve(h.URI,r)),c.lang=h.LANGUAGE,c.name||(c.name=c.lang),n.length){var u=t.findGroup(n,c.groupId);c.audioCodec=u?u.codec:n[0].codec}c.id=s++,o.push(c)}}return o},t.parseLevelPlaylist=function(t,e,r,i,n){var a=0,h=0,u={type:null,version:null,url:e,fragments:[],live:!0,startSN:0},d=new s.a,g=0,v=null,y=new o.a,m=void 0,_=void 0;for(l.lastIndex=0;null!==(m=l.exec(t));){var w=m[1];if(w){y.duration=parseFloat(w);var S=(" "+m[2]).slice(1);y.title=S||null,y.tagList.push(S?["INF",w,S]:["INF",w])}else if(m[3]){if(!isNaN(y.duration)){var E=a++;y.type=i,y.start=h,y.levelkey=d,y.sn=E,y.level=r,y.cc=g,y.urlId=n,y.baseurl=e,y.relurl=(" "+m[3]).slice(1),u.programDateTime&&(v?y.rawProgramDateTime?y.pdt=Date.parse(y.rawProgramDateTime):y.pdt=v.pdt+1e3*v.duration:y.pdt=u.programDateTime,y.endPdt=y.pdt+1e3*y.duration),u.fragments.push(y),v=y,h+=y.duration,y=new o.a}}else if(m[4]){if(y.rawByteRange=(" "+m[4]).slice(1),v){var A=v.byteRangeEndOffset;A&&(y.lastByteRangeEndOffset=A)}}else if(m[5])y.rawProgramDateTime=(" "+m[5]).slice(1),y.tagList.push(["PROGRAM-DATE-TIME",y.rawProgramDateTime]),void 0===u.programDateTime&&(u.programDateTime=new Date(Date.parse(m[5]))-1e3*h);else{for(m=m[0].match(p),_=1;_=0&&(d.method=I,d.baseuri=e,d.reluri=M,d.key=null,d.iv=x));break;case"START":var L=T,O=new f.a(L),C=O.decimalFloatingPoint("TIME-OFFSET");isNaN(C)||(u.startTimeOffset=C);break;case"MAP":var P=new f.a(T);y.relurl=P.URI,y.rawByteRange=P.BYTERANGE,y.baseurl=e,y.level=r,y.type=i,y.sn="initSegment",u.initSegment=y,y=new o.a;break;default:c.b.warn("line parsed but not handled: "+m)}}}return y=v,y&&!y.relurl&&(u.fragments.pop(),h-=y.duration),u.totalduration=h,u.averagetargetduration=h/u.fragments.length,u.endSN=a-1,u.startCC=u.fragments[0]?u.fragments[0].cc:0,u.endCC=g,!u.initSegment&&u.fragments.length&&u.fragments.every(function(t){return b.test(t.relurl)})&&(c.b.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),y=new o.a,y.relurl=u.fragments[0].relurl,y.baseurl=e,y.level=r,y.type=i,y.sn="initSegment",u.initSegment=y,u.needSidxRanges=!0),u},t}();e.a=g},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=/^(\d+)x(\d+)$/,a=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,o=function(){function t(e){i(this,t),"string"==typeof e&&(e=t.parseAttrList(e));for(var r in e)e.hasOwnProperty(r)&&(this[r]=e[r])}return t.prototype.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},t.prototype.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var r=new Uint8Array(e.length/2),i=0;iNumber.MAX_SAFE_INTEGER?1/0:e},t.prototype.decimalFloatingPoint=function(t){return parseFloat(this[t])},t.prototype.enumeratedString=function(t){return this[t]},t.prototype.decimalResolution=function(t){var e=n.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e=void 0,r={};for(a.lastIndex=0;null!==(e=a.exec(t));){var i=e[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[e[1]]=i}return r},t}();e.a=o},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(9),f=r(7),c=r(2),h=function(t){function e(r){i(this,e);var a=n(this,t.call(this,r,o.a.FRAG_LOADING));return a.loaders={},a.count=0,a}return a(e,t),e.prototype.destroy=function(){var e=this.loaders;for(var r in e){var i=e[r];i&&i.destroy()}this.loaders={},t.prototype.destroy.call(this)},e.prototype.onFragLoading=function(t){var e=t.frag,r=e.type,i=this.loaders,n=this.hls.config,a=n.fLoader,o=n.loader;e.loaded=0;var s=i[r];s&&(c.b.warn("abort previous fragment loader for type: "+r),s.abort()),s=i[r]=e.loader=n.fLoader?new a(n):new o(n);var f=void 0,h=void 0,u=void 0;f={url:e.url,frag:e,responseType:"arraybuffer",progressData:!1};var d=e.byteRangeStartOffset,l=e.byteRangeEndOffset;isNaN(d)||isNaN(l)||(f.rangeStart=d,f.rangeEnd=l),h={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout},u={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},s.load(f,h,u)},e.prototype.loadsuccess=function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=t.data,a=r.frag;a.loader=void 0,this.loaders[a.type]=void 0,this.hls.trigger(o.a.FRAG_LOADED,{payload:n,frag:a,stats:e,networkDetails:i})},e.prototype.loaderror=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.retryfragment(t,e,r,f.a.FRAG_LOAD_ERROR)},e.prototype.loadtimeout=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.retryfragment(null,e,r,f.a.FRAG_LOAD_TIMEOUT)},e.prototype.retryfragment=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=e.loader,a=this.hls.config.fragLoadingRetryDelay;n&&n.abort();var s=this;this.count<=3?(setTimeout(function(){s.loaders[e.type?e.type:e.frag.type].reload()},a>1e3?a:1e3),this.count++):(this.loaders[e.type?e.type:e.frag.type]=void 0,t?this.hls.trigger(o.a.ERROR,{type:f.b.NETWORK_ERROR,details:i,fatal:!1,frag:e.frag,response:t,networkDetails:r}):this.hls.trigger(o.a.ERROR,{type:f.b.NETWORK_ERROR,details:i,fatal:!1,frag:e.frag,networkDetails:r}),this.count=0)},e.prototype.loadprogress=function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=e.frag;n.loaded=t.loaded,this.hls.trigger(o.a.FRAG_LOAD_PROGRESS,{frag:n,stats:t,networkDetails:i})},e}(s.a);e.a=h},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(9),f=r(7),c=r(2),h=r(115),u=r.n(h),d=r(208),l=r(221),p=r.n(l),b=r(100),g=function(t){function e(r){i(this,e);var a=n(this,t.call(this,r,o.a.KEY_LOADING));return a.loaders={},a.decryptkey=null,a.decrypturl=null,a.aliyunUri="",a.isAliyunEncrypt=!1,a.PUBLIC_KEY="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqFw8es0P7jNhIt5beGmwKSD/PJ7sLyTBTi3WmPDMnbmmfqpkSc9PvkfOAGubd9LcGpKMxiP+EZv4Wrj0fB3HbSfGf5eSdn6GrEhYTWppnnIZLhN7AfHewxZMpyCla9aWGJW2DSo0B93zFZdeDiW5w6MvZ9ukCian2d1AyIl2MKLoT1P3yH4KxMdhA3wTSm+KikVKDrMco5YdwWzZudHefbMZlC9tuuiQS2v13r5k9KmcxoHBuirsPzBbSn9BtK4rqsDOeZkAkvkiYP+4nYx/1HhPvRLMS69Txu+j7Pc7BAcrMQiUSxI6+PJ3gMDM5Db4K/zL0m6SqCBbDvmGm31bkQIDAQAB",a}return a(e,t),e.prototype.destroy=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={},s.a.prototype.destroy.call(this)},e.prototype.onKeyLoading=function(t){var e=t.frag,r=e.type,i=this.loaders[r],n=e.decryptdata,a=n.uri,s="";if(n.reluri&&(s=this._parseAliyunEncrypt(n.reluri),a=s||n.uri),a!==this.decrypturl||null===this.decryptkey){var f=this.hls.config;i&&(c.b.warn("abort previous key loader for type:"+r),i.abort()),e.loader=this.loaders[r]=new f.loader(f),this.decrypturl=a,this.decryptkey=null;var h=void 0,u=void 0,d=void 0;h={url:a,frag:e,responseType:"arraybuffer"},u={timeout:f.fragLoadingTimeOut,maxRetry:f.fragLoadingMaxRetry,retryDelay:f.fragLoadingRetryDelay,maxRetryDelay:f.fragLoadingMaxRetryTimeout},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},e.loader.load(h,u,d)}else this.decryptkey&&(e.decryptdata.key=this.decryptkey,this.hls.trigger(o.a.KEY_LOADED,{frag:e}))},e.prototype.loadsuccess=function(t,e,r){var i=null;if(this.isAliyunEncrypt){var n=this._decodeUtf8(t.data),a=JSON.parse(n);a&&a.Random&&a.Plaintext&&(i=this._sce_dlgtqred(this.r1,a.Random,a.Plaintext))}var s=r.frag;this.decryptkey=s.decryptdata.key=new Uint8Array(i||t.data),console.log("decryptkey:",this.decryptkey),s.loader=void 0,this.loaders[s.type]=void 0,this.hls.trigger(o.a.KEY_LOADED,{frag:s})},e.prototype.loaderror=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(o.a.ERROR,{type:f.b.NETWORK_ERROR,details:f.a.KEY_LOAD_ERROR,fatal:!1,frag:r,response:t})},e.prototype.loadtimeout=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),this.loaders[e.type]=void 0,this.hls.trigger(o.a.ERROR,{type:f.b.NETWORK_ERROR,details:f.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},e.prototype._parseAliyunEncrypt=function(t){if(t&&t.indexOf("metadata=type=aliyun")>=0)for(var e=t.split(";"),r=0;r=0){var n=e[r].substring(0,i);if("uri"==n){if(this.aliyunUri===e[r])return this.decrypturl;var a=e[r].substring(i+1,e[r].length);if((i=a.indexOf("?"))>=0){var o=a.substring(i+1,a.length);if((i=o.indexOf("="))>0){var s=o.substring(0,i),f=o.substring(i+1,o.length),c=this.getParams(s,f);return this.isAliyunEncrypt=!0,this.aliyunUri=e[r],"https://live.aliyuncs.com?"+c}}}}}return""},e.prototype.getParams=function(t,e){var r=this.hls.config.stream;this.r1=this._sce_r_skjhfnck();var i=new d.a;i.setPublicKey("-----BEGIN PUBLIC KEY-----"+this.PUBLIC_KEY+"-----END PUBLIC KEY-----");var n=i.encrypt(this.r1+r),a={Action:"DecryptKey",Domain:this.hls.config.domain,App:this.hls.config.app,Stream:r,SecurityToken:this.hls.config.securityToken,Version:"2016-11-01",Rand:n,AccessKeyId:"LTAI4GDv1nZpttLv1FCQKDB7",SignatureMethod:"HMAC-SHA1",Timestamp:this._ISODateString(new Date),SignatureVersion:"1.0",Format:"JSON",SignatureNonce:String(u.a.randomUUID())};a[t]=e;return u.a.makeUTF8sort(a,"=","&")+"&Signature="+u.a.AliyunEncodeURI(u.a.makeChangeSiga(a,"6GA8IRcjzKFncFeChBnoO1Pot9B1Wj"))},e.prototype._ISODateString=function(t){function e(t){return t<10?"0"+t:t}return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z"},e.prototype._decodeUtf8=function(t){var e="",r=0,i=0,n=0,a=0,o=new Uint8Array(t);for(o.length>=3&&239===o[0]&&187===o[1]&&191===o[2]&&(r=3);r191&&i<224){if(r+1>=o.length)throw"UTF-8 Decode failed. Two byte character was truncated.";n=o[r+1],e+=String.fromCharCode((31&i)<<6|63&n),r+=2}else{if(r+2>=o.length)throw"UTF-8 Decode failed. Multi byte character was truncated.";n=o[r+1],a=o[r+2],e+=String.fromCharCode((15&i)<<12|(63&n)<<6|63&a),r+=3}return e},e.prototype._sce_r_skjhfnck=function(t){var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz234567890";t=t||16;for(var r=e.length,i="",n=0;n>2,a=(3&e)<<4|r>>4,o=(15&r)<<2|i>>6,s=63&i,isNaN(r)?o=s=64:isNaN(i)&&(s=64),c+=f.charAt(n)+f.charAt(a)+f.charAt(o)+f.charAt(s);return c}},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(36),r(37))}(0,function(t){return t.HmacSHA1})},function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(19),e.createHash=e.Hash=r(23),e.createHmac=e.Hmac=r(70);var i=r(137),n=Object.keys(i),a=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);e.getHashes=function(){return a};var o=r(72);e.pbkdf2=o.pbkdf2,e.pbkdf2Sync=o.pbkdf2Sync;var s=r(139);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var f=r(158);e.DiffieHellmanGroup=f.DiffieHellmanGroup,e.createDiffieHellmanGroup=f.createDiffieHellmanGroup,e.getDiffieHellman=f.getDiffieHellman,e.createDiffieHellman=f.createDiffieHellman,e.DiffieHellman=f.DiffieHellman;var c=r(164);e.createSign=c.createSign,e.Sign=c.Sign,e.createVerify=c.createVerify,e.Verify=c.Verify,e.createECDH=r(202);var h=r(203);e.publicEncrypt=h.publicEncrypt,e.privateEncrypt=h.privateEncrypt,e.publicDecrypt=h.publicDecrypt,e.privateDecrypt=h.privateDecrypt;var u=r(206);e.randomFill=u.randomFill,e.randomFillSync=u.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(t,e,r){"use strict";function i(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-i(t)}function a(t){var e,r,n,a,o,s=t.length;a=i(t),o=new u(3*s/4-a),r=a>0?s-4:s;var f=0;for(e=0;e>16&255,o[f++]=n>>8&255,o[f++]=255&n;return 2===a?(n=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,o[f++]=255&n):1===a&&(n=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,o[f++]=n>>8&255,o[f++]=255&n),o}function o(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function s(t,e,r){for(var i,n=[],a=e;af?f:o+16383));return 1===i?(e=t[r-1],n+=c[e>>2],n+=c[e<<4&63],n+="=="):2===i&&(e=(t[r-2]<<8)+t[r-1],n+=c[e>>10],n+=c[e>>4&63],n+=c[e<<2&63],n+="="),a.push(n),a.join("")}e.byteLength=n,e.toByteArray=a,e.fromByteArray=f;for(var c=[],h=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=d.length;l>1,h=-7,u=r?n-1:0,d=r?-1:1,l=t[e+u];for(u+=d,a=l&(1<<-h)-1,l>>=-h,h+=s;h>0;a=256*a+t[e+u],u+=d,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=i;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===a)a=1-c;else{if(a===f)return o?NaN:1/0*(l?-1:1);o+=Math.pow(2,i),a-=c}return(l?-1:1)*o*Math.pow(2,a-i)},e.write=function(t,e,r,i,n,a){var o,s,f,c=8*a-n-1,h=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:a-1,p=i?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),e+=o+u>=1?d/f:d*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=h?(s=0,o=h):o+u>=1?(s=(e*f-1)*Math.pow(2,n),o+=u):(s=e*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;t[r+l]=255&s,l+=p,s/=256,n-=8);for(o=o<0;t[r+l]=255&o,l+=p,o/=256,c-=8);t[r+l-p]|=128*b}},function(t,e,r){"use strict";(function(e){function r(t){if(t.length%i!=0){var r=t.length+(i-t.length%i);t=e.concat([t,n],r)}for(var a=new Array(t.length>>>2),o=0,s=0;o=this._blockSize;){for(var a=this._blockOffset;a0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},i.prototype._update=function(t){throw new Error("_update is not implemented")},i.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();return void 0!==t&&(e=e.toString(t)),e},i.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=i}).call(e,r(4).Buffer)},function(t,e){},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e,r){t.copy(e,r)}var a=r(3).Buffer;t.exports=function(){function t(){i(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var e=a.allocUnsafe(t>>>0),r=this.head,i=0;r;)n(r.data,e,i),i+=r.data.length,r=r.next;return e},t}()},function(t,e,r){function i(t,e){this._id=t,this._clearFn=e}var n=Function.prototype.apply;e.setTimeout=function(){return new i(n.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new i(n.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r(125),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,r){(function(t,e){!function(t,r){"use strict";function i(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r>>27}function a(t){return t<<30|t>>>2}function o(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}var s=r(0),f=r(21),c=r(3).Buffer,h=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);s(i,f),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(t){for(var e=this._w,r=0|this._a,i=0|this._b,s=0|this._c,f=0|this._d,c=0|this._e,u=0;u<16;++u)e[u]=t.readInt32BE(4*u);for(;u<80;++u)e[u]=e[u-3]^e[u-8]^e[u-14]^e[u-16];for(var d=0;d<80;++d){var l=~~(d/20),p=n(r)+o(l,i,s,f)+c+e[d]+h[l]|0;c=f,f=s,s=a(i),i=r,r=p}this._a=r+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=f+this._d|0,this._e=c+this._e|0},i.prototype._hash=function(){var t=c.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=i},function(t,e,r){function i(){this.init(),this._w=d,c.call(this,64,56)}function n(t){return t<<1|t>>>31}function a(t){return t<<5|t>>>27}function o(t){return t<<30|t>>>2}function s(t,e,r,i){return 0===t?e&r|~e&i:2===t?e&r|e&i|r&i:e^r^i}var f=r(0),c=r(21),h=r(3).Buffer,u=[1518500249,1859775393,-1894007588,-899497514],d=new Array(80);f(i,c),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(t){for(var e=this._w,r=0|this._a,i=0|this._b,f=0|this._c,c=0|this._d,h=0|this._e,d=0;d<16;++d)e[d]=t.readInt32BE(4*d);for(;d<80;++d)e[d]=n(e[d-3]^e[d-8]^e[d-14]^e[d-16]);for(var l=0;l<80;++l){var p=~~(l/20),b=a(r)+s(p,i,f,c)+h+e[l]+u[p]|0;h=c,c=f,f=o(i),i=r,r=b}this._a=r+this._a|0,this._b=i+this._b|0,this._c=f+this._c|0,this._d=c+this._d|0,this._e=h+this._e|0},i.prototype._hash=function(){var t=h.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=i},function(t,e,r){function i(){this.init(),this._w=f,o.call(this,64,56)}var n=r(0),a=r(68),o=r(21),s=r(3).Buffer,f=new Array(64);n(i,a),i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},i.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=i},function(t,e,r){function i(){this.init(),this._w=f,o.call(this,128,112)}var n=r(0),a=r(69),o=r(21),s=r(3).Buffer,f=new Array(160);n(i,a),i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},i.prototype._hash=function(){function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}var e=s.allocUnsafe(48);return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},t.exports=i},function(t,e,r){"use strict";function i(t,e){o.call(this,"digest"),"string"==typeof e&&(e=a.from(e)),this._alg=t,this._key=e,e.length>f?e=t(e):e.length>>32-e}function a(t,e,r,i,a,o,s){return n(t+(e&r|~e&i)+a+o|0,s)+e|0}function o(t,e,r,i,a,o,s){return n(t+(e&i|r&~i)+a+o|0,s)+e|0}function s(t,e,r,i,a,o,s){return n(t+(e^r^i)+a+o|0,s)+e|0}function f(t,e,r,i,a,o,s){return n(t+(r^(e|~i))+a+o|0,s)+e|0}var c=r(0),h=r(141),u=new Array(16);c(i,h),i.prototype._update=function(){for(var t=u,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,c=this._d;r=a(r,i,n,c,t[0],3614090360,7),c=a(c,r,i,n,t[1],3905402710,12),n=a(n,c,r,i,t[2],606105819,17),i=a(i,n,c,r,t[3],3250441966,22),r=a(r,i,n,c,t[4],4118548399,7),c=a(c,r,i,n,t[5],1200080426,12),n=a(n,c,r,i,t[6],2821735955,17),i=a(i,n,c,r,t[7],4249261313,22),r=a(r,i,n,c,t[8],1770035416,7),c=a(c,r,i,n,t[9],2336552879,12),n=a(n,c,r,i,t[10],4294925233,17),i=a(i,n,c,r,t[11],2304563134,22),r=a(r,i,n,c,t[12],1804603682,7),c=a(c,r,i,n,t[13],4254626195,12),n=a(n,c,r,i,t[14],2792965006,17),i=a(i,n,c,r,t[15],1236535329,22),r=o(r,i,n,c,t[1],4129170786,5),c=o(c,r,i,n,t[6],3225465664,9),n=o(n,c,r,i,t[11],643717713,14),i=o(i,n,c,r,t[0],3921069994,20),r=o(r,i,n,c,t[5],3593408605,5),c=o(c,r,i,n,t[10],38016083,9),n=o(n,c,r,i,t[15],3634488961,14),i=o(i,n,c,r,t[4],3889429448,20),r=o(r,i,n,c,t[9],568446438,5),c=o(c,r,i,n,t[14],3275163606,9),n=o(n,c,r,i,t[3],4107603335,14),i=o(i,n,c,r,t[8],1163531501,20),r=o(r,i,n,c,t[13],2850285829,5),c=o(c,r,i,n,t[2],4243563512,9),n=o(n,c,r,i,t[7],1735328473,14),i=o(i,n,c,r,t[12],2368359562,20),r=s(r,i,n,c,t[5],4294588738,4),c=s(c,r,i,n,t[8],2272392833,11),n=s(n,c,r,i,t[11],1839030562,16),i=s(i,n,c,r,t[14],4259657740,23),r=s(r,i,n,c,t[1],2763975236,4),c=s(c,r,i,n,t[4],1272893353,11),n=s(n,c,r,i,t[7],4139469664,16),i=s(i,n,c,r,t[10],3200236656,23),r=s(r,i,n,c,t[13],681279174,4),c=s(c,r,i,n,t[0],3936430074,11),n=s(n,c,r,i,t[3],3572445317,16),i=s(i,n,c,r,t[6],76029189,23),r=s(r,i,n,c,t[9],3654602809,4),c=s(c,r,i,n,t[12],3873151461,11),n=s(n,c,r,i,t[15],530742520,16),i=s(i,n,c,r,t[2],3299628645,23),r=f(r,i,n,c,t[0],4096336452,6),c=f(c,r,i,n,t[7],1126891415,10),n=f(n,c,r,i,t[14],2878612391,15),i=f(i,n,c,r,t[5],4237533241,21),r=f(r,i,n,c,t[12],1700485571,6),c=f(c,r,i,n,t[3],2399980690,10),n=f(n,c,r,i,t[10],4293915773,15),i=f(i,n,c,r,t[1],2240044497,21),r=f(r,i,n,c,t[8],1873313359,6),c=f(c,r,i,n,t[15],4264355552,10),n=f(n,c,r,i,t[6],2734768916,15),i=f(i,n,c,r,t[13],1309151649,21),r=f(r,i,n,c,t[4],4149444226,6),c=f(c,r,i,n,t[11],3174756917,10),n=f(n,c,r,i,t[2],718787259,15),i=f(i,n,c,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+c|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new e(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=i}).call(e,r(4).Buffer)},function(t,e,r){"use strict";function i(t,e){if(!a.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}function n(t){o.call(this),this._block=a.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var a=r(3).Buffer,o=r(30).Transform;r(0)(n,o),n.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(t){i=t}r(i)},n.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},n.prototype.update=function(t,e){if(i(t,"Data"),this._finalized)throw new Error("Digest already called");a.isBuffer(t)||(t=a.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var o=this._blockOffset;o0;++s)this._length[s]+=f,(f=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*f);return this},n.prototype._update=function(){throw new Error("_update is not implemented")},n.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},n.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=n},function(t,e,r){function i(t,e,r){u.call(this),this._cache=new n,this._cipher=new d.AES(e),this._prev=c.from(r),this._mode=t,this._autopadding=!0}function n(){this.cache=c.allocUnsafe(0)}function a(t,e,r){var n=s[t.toLowerCase()];if(!n)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=c.from(e)),e.length!==n.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=c.from(r)),"GCM"!==n.mode&&r.length!==n.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===n.type?new h(n.module,e,r):"auth"===n.type?new f(n.module,e,r):new i(n.module,e,r)}function o(t,e){var r=s[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=l(e,!1,r.key,r.iv);return a(t,i.key,i.iv)}var s=r(49),f=r(79),c=r(3).Buffer,h=r(80),u=r(15),d=r(33),l=r(32);r(0)(i,u),i.prototype._update=function(t){this._cache.add(t);for(var e,r,i=[];e=this._cache.get();)r=this._mode.encrypt(this,e),i.push(r);return c.concat(i)};var p=c.alloc(16,16);i.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(p))throw this._cipher.scrub(),new Error("data not multiple of block length")},i.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},n.prototype.add=function(t){this.cache=c.concat([this.cache,t])},n.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},n.prototype.flush=function(){for(var t=16-this.cache.length,e=c.allocUnsafe(t),r=-1;++r>s%8,t._prev=n(t._prev,r?a:o);return f}function n(t,e){var r=t.length,i=-1,n=a.allocUnsafe(t.length);for(t=a.concat([t,a.from([e])]);++i>7;return n}var a=r(3).Buffer;e.encrypt=function(t,e,r){for(var n=e.length,o=a.allocUnsafe(n),s=-1;++s>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=o.alloc(16,0),this.cache=o.allocUnsafe(0)}var o=r(3).Buffer,s=o.alloc(16,0);a.prototype.ghash=function(t){for(var e=-1;++e0;t--)a[t]=a[t]>>>1|(1&a[t-1])<<31;a[0]=a[0]>>>1,r&&(a[0]=a[0]^225<<24)}this.state=n(o)},a.prototype.update=function(t){this.cache=o.concat([this.cache,t]);for(var e;this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(o.concat([this.cache,s],16)),this.ghash(n([0,t,0,e])),this.state},t.exports=a},function(t,e,r){function i(t,e,r){d.call(this),this._cache=new n,this._last=void 0,this._cipher=new l.AES(e),this._prev=c.from(r),this._mode=t,this._autopadding=!0}function n(){this.cache=c.allocUnsafe(0)}function a(t){for(var e=t[15],r=-1;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},n.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=s,e.createDecipheriv=o},function(t,e,r){(function(e){function i(t){n.call(this);var r,i=t.mode.toLowerCase(),a=s[i];r=t.decrypt?"decrypt":"encrypt";var o=t.key;"des-ede"!==i&&"des-ede-cbc"!==i||(o=e.concat([o,o.slice(0,8)]));var f=t.iv;this._des=a.create({key:o,iv:f,type:r})}var n=r(15),a=r(50),o=r(0),s={"des-ede3-cbc":a.CBC.instantiate(a.EDE),"des-ede3":a.EDE,"des-ede-cbc":a.CBC.instantiate(a.EDE),"des-ede":a.EDE,"des-cbc":a.CBC.instantiate(a.DES),"des-ecb":a.DES};s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=i,o(i,n),i.prototype._update=function(t){return new e(this._des.update(t))},i.prototype._final=function(){return new e(this._des.final())}}).call(e,r(4).Buffer)},function(t,e,r){"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,i){for(var n=0,a=0,o=6;o>=0;o-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>>s+o&1;for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+o&1}for(var o=6;o>=0;o-=2){for(var s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1;for(var s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1}r[i+0]=n>>>0,r[i+1]=a>>>0},e.rip=function(t,e,r,i){for(var n=0,a=0,o=0;o<4;o++)for(var s=24;s>=0;s-=8)n<<=1,n|=e>>>s+o&1,n<<=1,n|=t>>>s+o&1;for(var o=4;o<8;o++)for(var s=24;s>=0;s-=8)a<<=1,a|=e>>>s+o&1,a<<=1,a|=t>>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},e.pc1=function(t,e,r,i){for(var n=0,a=0,o=7;o>=5;o--){for(var s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1;for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+o&1}for(var s=0;s<=24;s+=8)n<<=1,n|=e>>s+o&1;for(var o=1;o<=3;o++){for(var s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;for(var s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1}for(var s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;r[i+0]=n>>>0,r[i+1]=a>>>0},e.r28shl=function(t,e){return t<>>28-e};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,n){for(var a=0,o=0,s=i.length>>>1,f=0;f>>i[f]&1;for(var f=s;f>>i[f]&1;r[n+0]=a>>>0,r[n+1]=o>>>0},e.expand=function(t,e,r){var i=0,n=0;i=(1&t)<<5|t>>>27;for(var a=23;a>=15;a-=4)i<<=6,i|=t>>>a&63;for(var a=11;a>=3;a-=4)n|=t>>>a&63,n<<=6;n|=(31&t)<<1|t>>>31,e[r+0]=i>>>0,e[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++){var a=t>>>18-6*i&63,o=n[64*i+a];r<<=4,r|=o}for(var i=0;i<4;i++){var a=e>>>18-6*i&63,o=n[256+64*i+a];r<<=4,r|=o}return r>>>0};var a=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r>>a[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var i=t.toString(2);i.length0;i--)e+=this._buffer(t,e),r+=this._flushBuffer(n,r);return e+=this._buffer(t,e),n},i.prototype.final=function(t){var e;t&&(e=this.update(t));var r;return r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e>>1];r=f.r28shl(r,o),i=f.r28shl(i,o),f.pc2(r,i,t.keys,n)}},n.prototype._update=function(t,e,r,i){var n=this._desState,a=f.readUInt32BE(t,e),o=f.readUInt32BE(t,e+4);f.ip(a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],"encrypt"===this.type?this._encrypt(n,a,o,n.tmp,0):this._decrypt(n,a,o,n.tmp,0),a=n.tmp[0],o=n.tmp[1],f.writeUInt32BE(r,a,i),f.writeUInt32BE(r,o,i+4)},n.prototype._pad=function(t,e){for(var r=t.length-e,i=e;i>>0,a=l}f.rip(o,a,i,n)},n.prototype._decrypt=function(t,e,r,i,n){for(var a=r,o=e,s=t.keys.length-2;s>=0;s-=2){var c=t.keys[s],h=t.keys[s+1];f.expand(a,t.tmp,0),c^=t.tmp[0],h^=t.tmp[1];var u=f.substitute(c,h),d=f.permute(u),l=a;a=(o^d)>>>0,o=l}f.rip(a,o,i,n)}},function(t,e,r){"use strict";function i(t){a.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e0&&r.ishrn(i),r}function c(t,r){t=f(t,r),t=t.mod(r);var i=new e(t.toArray());if(i.length=0;){var a;if(n.isOdd()){var o=n.andln(i-1);a=o>(i>>1)-1?(i>>1)-o:o,n.isubn(a)}else a=0;r.push(a);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?e+1:1,f=1;f0||e.cmpn(-n)>0;){var a=t.andln(3)+i&3,o=e.andln(3)+n&3;3===a&&(a=-1),3===o&&(o=-1);var s;if(0==(1&a))s=0;else{var f=t.andln(7)+i&7;s=3!==f&&5!==f||2!==o?a:-a}r[0].push(s);var c;if(0==(1&o))c=0;else{var f=e.andln(7)+n&7;c=3!==f&&5!==f||2!==a?o:-o}r[1].push(c),2*i===s+1&&(i=1-i),2*n===c+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return r}function a(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}}function o(t){return"string"==typeof t?f.toArray(t,"hex"):t}function s(t){return new c(t,"hex","le")}var f=e,c=r(6),h=r(11),u=r(84);f.assert=h,f.toArray=u.toArray,f.zero2=u.zero2,f.toHex=u.toHex,f.encode=u.encode,f.getNAF=i,f.getJSF=n,f.cachedProperty=a,f.parseBytes=o,f.intFromLE=s},function(t,e,r){"use strict";function i(t,e){this.type=t,this.p=new a(e.p,16),this.red=e.prime?a.red(e.prime):a.mont(this.p),this.zero=new a(0).toRed(this.red),this.one=new a(1).toRed(this.red),this.two=new a(2).toRed(this.red),this.n=e.n&&new a(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function n(t,e){this.curve=t,this.type=e,this.precomputed=null}var a=r(6),o=r(10),s=o.utils,f=s.getNAF,c=s.getJSF,h=s.assert;t.exports=i,i.prototype.point=function(){throw new Error("Not implemented")},i.prototype.validate=function(){throw new Error("Not implemented")},i.prototype._fixedNafMul=function(t,e){h(t.precomputed);var r=t._getDoubles(),i=f(e,1),n=(1<=o;e--)s=(s<<1)+i[e];a.push(s)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=n;d>0;d--){for(var o=0;o=0;s--){for(var e=0;s>=0&&0===a[s];s--)e++;if(s>=0&&e++,o=o.dblp(e),s<0)break;var c=a[s];h(0!==c),o="affine"===t.type?c>0?o.mixedAdd(n[c-1>>1]):o.mixedAdd(n[-c-1>>1].neg()):c>0?o.add(n[c-1>>1]):o.add(n[-c-1>>1].neg())}return"affine"===t.type?o.toP():o},i.prototype._wnafMulAdd=function(t,e,r,i,n){for(var a=this._wnafT1,o=this._wnafT2,s=this._wnafT3,h=0,u=0;u=1;u-=2){var p=u-1,b=u;if(1===a[p]&&1===a[b]){var g=[e[p],null,null,e[b]];0===e[p].y.cmp(e[b].y)?(g[1]=e[p].add(e[b]),g[2]=e[p].toJ().mixedAdd(e[b].neg())):0===e[p].y.cmp(e[b].y.redNeg())?(g[1]=e[p].toJ().mixedAdd(e[b]),g[2]=e[p].add(e[b].neg())):(g[1]=e[p].toJ().mixedAdd(e[b]),g[2]=e[p].toJ().mixedAdd(e[b].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=c(r[p],r[b]);h=Math.max(y[0].length,h),s[p]=new Array(h),s[b]=new Array(h);for(var m=0;m=0;u--){for(var A=0;u>=0;){for(var T=!0,m=0;m=0&&A++,S=S.dblp(A),u<0)break;for(var m=0;m0?d=o[m][R-1>>1]:R<0&&(d=o[m][-R-1>>1].neg()),S="affine"===d.type?S.mixedAdd(d):S.add(d))}}for(var u=0;u=Math.ceil((t.bitLength()+1)/e.step)},n.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n=0&&(a=e,o=r),i.negative&&(i=i.neg(),n=n.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:i,b:n},{a:a,b:o}]},i.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),a=r.b.neg().mul(t).divRound(this.n),o=n.mul(r.a),s=a.mul(i.a),f=n.mul(r.b),c=a.mul(i.b);return{k1:t.sub(o).sub(s),k2:f.add(c).neg()}},i.prototype.pointFromX=function(t,e){t=new f(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},i.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},i.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},n.prototype.isInfinity=function(){return this.inf},n.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},n.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},n.prototype.getX=function(){return this.x.fromRed()},n.prototype.getY=function(){return this.y.fromRed()},n.prototype.mul=function(t){return t=new f(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},n.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},n.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},n.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},n.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},n.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},c(a,h.BasePoint),i.prototype.jpoint=function(t,e,r){return new a(this,t,e,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),a=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(r.redMul(this.z)),s=i.redSub(n),f=a.redSub(o);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),h=c.redMul(s),u=i.redMul(c),d=f.redSqr().redIAdd(h).redISub(u).redISub(u),l=f.redMul(u.redISub(d)).redISub(a.redMul(h)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,l,p)},a.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,a=t.y.redMul(e).redMul(this.z),o=r.redSub(i),s=n.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),c=f.redMul(o),h=r.redMul(f),u=s.redSqr().redIAdd(c).redISub(h).redISub(h),d=s.redMul(h.redISub(u)).redISub(n.redMul(c)),l=this.z.redMul(o);return this.curve.jpoint(u,d,l)},a.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}return!1},a.prototype.inspect=function(){return this.isInfinity()?"":""},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";function i(t){f.call(this,"mont",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(t.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function n(t,e,r){f.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(e,16),this.z=new o(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var a=r(34),o=r(6),s=r(0),f=a.base,c=r(10),h=c.utils;s(i,f),t.exports=i,i.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},s(n,f.BasePoint),i.prototype.decodePoint=function(t,e){return this.point(h.toArray(t,e),1)},i.prototype.point=function(t,e){return new n(this,t,e)},i.prototype.pointFromJSON=function(t){return n.fromJSON(this,t)},n.prototype.precompute=function(){},n.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},n.fromJSON=function(t,e){return new n(t,e[0],e[1]||t.one)},n.prototype.inspect=function(){return this.isInfinity()?"":""},n.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},n.prototype.dbl=function(){var t=this.x.redAdd(this.z),e=t.redSqr(),r=this.x.redSub(this.z),i=r.redSqr(),n=e.redSub(i),a=e.redMul(i),o=n.redMul(i.redAdd(this.curve.a24.redMul(n)));return this.curve.point(a,o)},n.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=t.x.redAdd(t.z),a=t.x.redSub(t.z),o=a.redMul(r),s=n.redMul(i),f=e.z.redMul(o.redAdd(s).redSqr()),c=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(f,c)},n.prototype.mul=function(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),n=this,a=[];0!==e.cmpn(0);e.iushrn(1))a.push(e.andln(1));for(var o=a.length-1;o>=0;o--)0===a[o]?(r=r.diffAdd(i,n),i=i.dbl()):(i=r.diffAdd(i,n),r=r.dbl());return i},n.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},n.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},n.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";function i(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,c.call(this,"edwards",t),this.a=new s(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new s(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new s(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),h(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function n(t,e,r,i,n){c.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new s(e,16),this.y=new s(r,16),this.z=i?new s(i,16):this.curve.one,this.t=n&&new s(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var a=r(34),o=r(10),s=r(6),f=r(0),c=a.base,h=o.utils.assert;f(i,c),t.exports=i,i.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},i.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},i.prototype.jpoint=function(t,e,r,i){return this.point(t,e,r,i)},i.prototype.pointFromX=function(t,e){t=new s(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=i.redMul(n.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(e&&!f||!e&&f)&&(o=o.redNeg()),this.point(t,o)},i.prototype.pointFromY=function(t,e){t=new s(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),i=r.redSub(this.one),n=r.redMul(this.d).redAdd(this.one),a=i.redMul(n.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.isOdd()!==e&&(o=o.redNeg()),this.point(o,t)},i.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),i=e.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===i.cmp(n)},f(n,c.BasePoint),i.prototype.pointFromJSON=function(t){return n.fromJSON(this,t)},i.prototype.point=function(t,e,r,i){return new n(this,t,e,r,i)},n.fromJSON=function(t,e){return new n(t,e[0],e[1],e[2])},n.prototype.inspect=function(){return this.isInfinity()?"":""},n.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},n.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),a=i.redAdd(e),o=a.redSub(r),s=i.redSub(e),f=n.redMul(o),c=a.redMul(s),h=n.redMul(s),u=o.redMul(a);return this.curve.point(f,c,u,h)},n.prototype._projDbl=function(){var t,e,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var o=this.curve._mulA(n),s=o.redAdd(a);if(this.zOne)t=i.redSub(n).redSub(a).redMul(s.redSub(this.curve.two)),e=s.redMul(o.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var f=this.z.redSqr(),c=s.redSub(f).redISub(f);t=i.redSub(n).redISub(a).redMul(c),e=s.redMul(o.redSub(a)),r=s.redMul(c)}}else{var o=n.redAdd(a),f=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=o.redSub(f).redSub(f);t=this.curve._mulC(i.redISub(o)).redMul(c),e=this.curve._mulC(o).redMul(n.redISub(a)),r=o.redMul(c)}return this.curve.point(t,e,r)},n.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},n.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),a=r.redSub(e),o=n.redSub(i),s=n.redAdd(i),f=r.redAdd(e),c=a.redMul(o),h=s.redMul(f),u=a.redMul(f),d=o.redMul(s);return this.curve.point(c,h,d,u)},n.prototype._projAdd=function(t){var e,r,i=this.z.redMul(t.z),n=i.redSqr(),a=this.x.redMul(t.x),o=this.y.redMul(t.y),s=this.curve.d.redMul(a).redMul(o),f=n.redSub(s),c=n.redAdd(s),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(a).redISub(o),u=i.redMul(f).redMul(h);return this.curve.twisted?(e=i.redMul(c).redMul(o.redSub(this.curve._mulA(a))),r=f.redMul(c)):(e=i.redMul(c).redMul(o.redSub(a)),r=this.curve._mulC(f).redMul(c)),this.curve.point(u,e,r)},n.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},n.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},n.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},n.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},n.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},n.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},n.prototype.getX=function(){return this.normalize(),this.x.fromRed()},n.prototype.getY=function(){return this.normalize(),this.y.fromRed()},n.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},n.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(i),0===this.x.cmp(e))return!0}return!1},n.prototype.toP=n.prototype.normalize,n.prototype.mixedAdd=n.prototype.add},function(t,e,r){"use strict";function i(t){"short"===t.type?this.curve=new s.curve.short(t):"edwards"===t.type?this.curve=new s.curve.edwards(t):this.curve=new s.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function n(t,e){Object.defineProperty(a,t,{configurable:!0,enumerable:!0,get:function(){var r=new i(e);return Object.defineProperty(a,t,{configurable:!0,enumerable:!0,value:r}),r}})}var a=e,o=r(52),s=r(10),f=s.utils.assert;a.PresetCurve=i,n("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),n("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),n("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),n("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),n("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),n("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),n("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=r(179)}catch(t){c=void 0}n("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})},function(t,e,r){"use strict";e.sha1=r(174),e.sha224=r(175),e.sha256=r(86),e.sha384=r(176),e.sha512=r(87)},function(t,e,r){"use strict";function i(){if(!(this instanceof i))return new i;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}var n=r(12),a=r(26),o=r(85),s=n.rotl32,f=n.sum32,c=n.sum32_5,h=o.ft_1,u=a.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];n.inherits(i,u),t.exports=i,i.blockSize=512,i.outSize=160,i.hmacStrength=80,i.padLength=64,i.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=(new this.Hash).update(t).digest()),a(t.length<=this.blockSize);for(var e=t.length;e0))return s.iaddn(1),this.keyFromPrivate(s)}},i.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},i.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var o=this.n.byteLength(),s=e.getPrivate().toArray("be",o),f=t.toArray("be",o),c=new a({hash:this.hash,entropy:s,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new n(1)),d=0;!0;d++){var l=i.k?i.k(d):new n(c.generate(this.n.byteLength()));if(l=this._truncateToN(l,!0),!(l.cmpn(1)<=0||l.cmp(u)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),g=b.umod(this.n);if(0!==g.cmpn(0)){var v=l.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(v=v.umod(this.n),0!==v.cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==b.cmp(g)?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new h({r:g,s:v,recoveryParam:y})}}}}}},i.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i),e=new h(e,"hex");var a=e.r,o=e.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),f=s.mul(t).umod(this.n),c=s.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var u=this.g.mulAdd(f,r.getPublic(),c);return!u.isInfinity()&&0===u.getX().umod(this.n).cmp(a)}var u=this.g.jmulAdd(f,r.getPublic(),c);return!u.isInfinity()&&u.eqXToP(a)},i.prototype.recoverPubKey=function(t,e,r,i){f((3&r)===r,"The recovery param is more than two bits"),e=new h(e,i);var a=this.n,o=new n(t),s=e.r,c=e.s,u=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var l=e.r.invm(a),p=a.sub(o).mul(l).umod(a),b=c.mul(l).umod(a);return this.g.mulAdd(p,s,b)},i.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new h(e,i),null!==e.recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(t,e,n)}catch(t){continue}if(a.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=a.toArray(t.entropy,t.entropyEnc||"hex"),r=a.toArray(t.nonce,t.nonceEnc||"hex"),n=a.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var n=r(52),a=r(84),o=r(11);t.exports=i,i.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},i.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"}},function(t,e,r){"use strict";function i(t,e){if(t instanceof i)return t;this._importDER(t,e)||(u(t.r&&t.s,"Signature without r or s"),this.r=new f(t.r,16),this.s=new f(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function n(){this.place=0}function a(t,e){var r=t[e.place++];if(!(128&r))return r;for(var i=15&r,n=0,a=0,o=e.place;a>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}var f=r(6),c=r(10),h=c.utils,u=h.assert;t.exports=i,i.prototype._importDER=function(t,e){t=h.toArray(t,e);var r=new n;if(48!==t[r.place++])return!1;if(a(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var i=a(t,r),o=t.slice(r.place,i+r.place);if(r.place+=i,2!==t[r.place++])return!1;var s=a(t,r);if(t.length!==s+r.place)return!1;var c=t.slice(r.place,s+r.place);return 0===o[0]&&128&o[1]&&(o=o.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new f(o),this.s=new f(c),this.recoveryParam=null,!0},i.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=o(e),r=o(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];s(i,e.length),i=i.concat(e),i.push(2),s(i,r.length);var n=i.concat(r),a=[48];return s(a,n.length),a=a.concat(n),h.encode(a,t)}},function(t,e,r){"use strict";function i(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof i))return new i(t);var t=a.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}var n=r(52),a=r(10),o=a.utils,s=o.assert,f=o.parseBytes,c=r(185),h=r(186);t.exports=i,i.prototype.sign=function(t,e){t=f(t);var r=this.keyFromSecret(e),i=this.hashInt(r.messagePrefix(),t),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),t).mul(r.priv()),s=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:a})},i.prototype.verify=function(t,e,r){t=f(t),e=this.makeSignature(e);var i=this.keyFromPublic(r),n=this.hashInt(e.Rencoded(),i.pubBytes(),t),a=this.g.mul(e.S());return e.R().add(i.pub().mul(n)).eq(a)},i.prototype.hashInt=function(){for(var t=this.hash(),e=0;e=e)throw new Error("invalid sig")}var s=r(6),f=r(10).ec,c=r(35),h=r(92);t.exports=i}).call(e,r(4).Buffer)},function(t,e,r){(function(e){function i(t){this.curveType=s[t],this.curveType||(this.curveType={name:t}),this.curve=new a.ec(this.curveType.name),this.keys=void 0}function n(t,r,i){Array.isArray(t)||(t=t.toArray());var n=new e(t);if(i&&n.lengthi-d-2)throw new Error("message too long");var l=new e(i-n-d-2);l.fill(0);var p=i-o-1,b=s(o),g=h(e.concat([a,l,new e([1]),r],p),c(b,p)),v=h(b,c(g,o));return new u(e.concat([new e([0]),v,g],i))}function n(t,r,i){var n=r.length,o=t.modulus.byteLength();if(n>o-11)throw new Error("message too long");var s;return i?(s=new e(o-n-3),s.fill(255)):s=a(o-n-3),new u(e.concat([new e([0,i?1:2]),s,new e([0]),r],o))}function a(t,r){for(var i,n=new e(t),a=0,o=s(2*t),f=0;a=0)throw new Error("data too long for modulus")}return r?l(s,f):d(s,f)}}).call(e,r(4).Buffer)},function(t,e,r){(function(e){function i(t,r){var i=(t.modulus,t.modulus.byteLength()),n=(r.length,u("sha1").update(new e("")).digest()),o=n.length;if(0!==r[0])throw new Error("decryption error");var c=r.slice(1,o+1),h=r.slice(o+1),d=f(c,s(h,o)),l=f(h,s(d,i-o-1));if(a(n,l.slice(0,o)))throw new Error("decryption error");for(var p=o;0===l[p];)p++;if(1!==l[p++])throw new Error("decryption error");return l.slice(p)}function n(t,e,r){for(var i=e.slice(0,2),n=2,a=0;0!==e[n++];)if(n>=e.length){a++;break}var o=e.slice(2,n-1);e.slice(n-1,n);if(("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&a++,o.length<8&&a++,a)throw new Error("decryption error");return e.slice(n)}function a(t,r){t=new e(t),r=new e(r);var i=0,n=t.length;t.length!==r.length&&(i++,n=Math.min(t.length,r.length));for(var a=-1;++au||new c(r).cmp(f.modulus)>=0)throw new Error("decryption error");var l;l=a?d(new c(r),f):h(r,f);var p=new e(u-l.length);if(p.fill(0),l=e.concat([p,l],u),4===s)return i(f,l);if(1===s)return n(f,l,a);if(3===s)return l;throw new Error("unknown padding")}}).call(e,r(4).Buffer)},function(t,e,r){"use strict";(function(t,i){function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function a(t,e){if("number"!=typeof t||t!==t)throw new TypeError("offset must be a number");if(t>b||t<0)throw new TypeError("offset must be a uint32");if(t>l||t>e)throw new RangeError("offset out of range")}function o(t,e,r){if("number"!=typeof t||t!==t)throw new TypeError("size must be a number");if(t>b||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>l)throw new RangeError("buffer too small")}function s(e,r,i,n){if(!(d.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)n=r,r=0,i=e.length;else if("function"==typeof i)n=i,i=e.length-r;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return a(r,e.length),o(i,r,e.length),f(e,r,i,n)}function f(t,e,r,n){if(i.browser){var a=t.buffer,o=new Uint8Array(a,e,r);return p.getRandomValues(o),n?void i.nextTick(function(){n(null,t)}):t}return n?void u(r,function(r,i){if(r)return n(r);i.copy(t,e),n(null,t)}):(u(r).copy(t,e),t)}function c(e,r,i){if(void 0===r&&(r=0),!(d.isBuffer(e)||e instanceof t.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return a(r,e.length),void 0===i&&(i=e.length-r),o(i,r,e.length),f(e,r,i)}var h=r(3),u=r(19),d=h.Buffer,l=h.kMaxLength,p=t.crypto||t.msCrypto,b=Math.pow(2,32)-1;p&&p.getRandomValues||!i.browser?(e.randomFill=s,e.randomFillSync=c):(e.randomFill=n,e.randomFillSync=n)}).call(e,r(13),r(14))},function(t,e,r){!function(i,n){t.exports=e=n(r(1))}(0,function(t){return t.enc.Utf8})},function(t,e,r){"use strict";var i=r(209);e.a=i.a},function(t,e,r){"use strict";r.d(e,"a",function(){return s});var i=r(96),n=r(210),a=r(220),o=r.n(a),s=function(){function t(t){t=t||{},this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return t.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new n.a(t)},t.prototype.setPrivateKey=function(t){this.setKey(t)},t.prototype.setPublicKey=function(t){this.setKey(t)},t.prototype.decrypt=function(t){try{return this.getKey().decrypt(Object(i.a)(t))}catch(t){return!1}},t.prototype.encrypt=function(t){try{return Object(i.b)(this.getKey().encrypt(t))}catch(t){return!1}},t.prototype.sign=function(t,e,r){try{return Object(i.b)(this.getKey().sign(t,e,r))}catch(t){return!1}},t.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,Object(i.a)(e),r)}catch(t){return!1}},t.prototype.getKey=function(t){if(!this.key){if(this.key=new n.a,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},t.version=o.a.version,t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return u});var i=r(96),n=r(211),a=r(212),o=r(213),s=r(215),f=r(53),c=r(218),h=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),u=function(t){function e(r){var i=t.call(this)||this;return r&&("string"==typeof r?i.parseKey(r):(e.hasPrivateKeyProperty(r)||e.hasPublicKeyProperty(r))&&i.parsePropertiesFrom(r)),i}return h(e,t),e.prototype.parseKey=function(t){try{var e=0,r=0,i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,s=i.test(t)?n.a.decode(t):a.a.unarmor(t),c=o.a.decode(s);if(3===c.sub.length&&(c=c.sub[2].sub[0]),9===c.sub.length){e=c.sub[1].getHexStringValue(),this.n=Object(f.c)(e,16),r=c.sub[2].getHexStringValue(),this.e=parseInt(r,16);var h=c.sub[3].getHexStringValue();this.d=Object(f.c)(h,16);var u=c.sub[4].getHexStringValue();this.p=Object(f.c)(u,16);var d=c.sub[5].getHexStringValue();this.q=Object(f.c)(d,16);var l=c.sub[6].getHexStringValue();this.dmp1=Object(f.c)(l,16);var p=c.sub[7].getHexStringValue();this.dmq1=Object(f.c)(p,16);var b=c.sub[8].getHexStringValue();this.coeff=Object(f.c)(b,16)}else{if(2!==c.sub.length)return!1;var g=c.sub[1],v=g.sub[0];e=v.sub[0].getHexStringValue(),this.n=Object(f.c)(e,16),r=v.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new c.a.asn1.DERInteger({int:0}),new c.a.asn1.DERInteger({bigint:this.n}),new c.a.asn1.DERInteger({int:this.e}),new c.a.asn1.DERInteger({bigint:this.d}),new c.a.asn1.DERInteger({bigint:this.p}),new c.a.asn1.DERInteger({bigint:this.q}),new c.a.asn1.DERInteger({bigint:this.dmp1}),new c.a.asn1.DERInteger({bigint:this.dmq1}),new c.a.asn1.DERInteger({bigint:this.coeff})]};return new c.a.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return Object(i.b)(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new c.a.asn1.DERSequence({array:[new c.a.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new c.a.asn1.DERNull]}),e=new c.a.asn1.DERSequence({array:[new c.a.asn1.DERInteger({bigint:this.n}),new c.a.asn1.DERInteger({int:this.e})]}),r=new c.a.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new c.a.asn1.DERSequence({array:[t,r]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return Object(i.b)(this.getPublicBaseKey())},e.wordwrap=function(t,e){if(e=e||64,!t)return t;var r="(.{1,"+e+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(r,"g")).join("\n")},e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n",t+="-----END RSA PRIVATE KEY-----"},e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n",t+="-----END PUBLIC KEY-----"},e.hasPublicKeyProperty=function(t){return t=t||{},t.hasOwnProperty("n")&&t.hasOwnProperty("e")},e.hasPrivateKeyProperty=function(t){return t=t||{},t.hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(s.a)},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var i,n={decode:function(t){var e;if(void 0===i){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(i={},e=0;e<16;++e)i[r.charAt(e)]=e;for(r=r.toLowerCase(),e=10;e<16;++e)i[r.charAt(e)]=e;for(e=0;e=2?(a[a.length]=o,o=0,s=0):o<<=4}}if(s)throw new Error("Hex encoding incomplete: 4 bits missing");return a}}},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var i,n={decode:function(t){var e;if(void 0===i){var r="= \f\n\r\t \u2028\u2029";for(i=Object.create(null),e=0;e<64;++e)i["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(i["-"]=62,i._=63,e=0;e=4?(n[n.length]=a>>16,n[n.length]=a>>8&255,n[n.length]=255&a,a=0,o=0):a<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=a>>10;break;case 3:n[n.length]=a>>16,n[n.length]=a>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=n.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return n.decode(t)}}},function(t,e,r){"use strict";function i(t,e){return t.length>e&&(t=t.substring(0,e)+a),t}r.d(e,"a",function(){return c});var n=r(214),a="…",o=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,s=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,f=function(){function t(e,r){this.hexDigits="0123456789ABCDEF",e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=r)}return t.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]},t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e,r){for(var i="",n=t;n176)return!1}return!0},t.prototype.parseStringISO=function(t,e){for(var r="",i=t;i191&&n<224?String.fromCharCode((31&n)<<6|63&this.get(i++)):String.fromCharCode((15&n)<<12|(63&this.get(i++))<<6|63&this.get(i++))}return r},t.prototype.parseStringBMP=function(t,e){for(var r,i,n="",a=t;a127,o=a?255:0,s="";i==o&&++t4){for(s=i,r<<=3;0==(128&(+s^o));)s=+s<<1,--r;s="("+r+" bit)\n"}a&&(i-=256);for(var f=new n.a(i),c=t+1;c=h;--u)s+=c>>u&1?"1":"0";if(s.length>r)return o+i(s,r)}return o+s},t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return i(this.parseStringISO(t,e),r);var n=e-t,o="("+n+" byte)\n";r/=2,n>r&&(e=t+r);for(var s=t;sr&&(o+=a),o},t.prototype.parseOID=function(t,e,r){for(var a="",o=new n.a,s=0,f=t;fr)return i(a,r);o=new n.a,s=0}}return s>0&&(a+=".incomplete"),a},t}(),c=function(){function t(t,e,r,i,n){if(!(i instanceof h))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=r,this.tag=i,this.sub=n}return t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},t.prototype.content=function(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return i(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return i(this.stream.parseStringISO(e,e+r),t);case 30:return i(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null},t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},t.prototype.toPrettyString=function(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var r=0,i=this.sub.length;r6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var i=0;i>6,this.tagConstructed=0!=(32&e),this.tagNumber=31&e,31==this.tagNumber){var r=new n.a;do{e=t.get(),r.mulAdd(128,127&e)}while(128&e);this.tagNumber=r.simplify()}}return t.prototype.isUniversal=function(){return 0===this.tagClass},t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},t}()},function(t,e,r){"use strict";r.d(e,"a",function(){return i});var i=function(){function t(t){this.buf=[+t||0]}return t.prototype.mulAdd=function(t,e){var r,i,n=this.buf,a=n.length;for(r=0;r0&&(n[r]=e)},t.prototype.sub=function(t){var e,r,i=this.buf,n=i.length;for(e=0;e=0;--i)r+=(1e13+e[i]).toString().substring(1);return r},t.prototype.valueOf=function(){for(var t=this.buf,e=0,r=t.length-1;r>=0;--r)e=1e13*e+t[r];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}()},function(t,e,r){"use strict";function i(t,e){if(e=0&&e>0;){var n=t.charCodeAt(i--);n<128?r[--e]=n:n>127&&n<2048?(r[--e]=63&n|128,r[--e]=n>>6|192):(r[--e]=63&n|128,r[--e]=n>>6&63|128,r[--e]=n>>12|224)}r[--e]=0;for(var a=new c.a,o=[];e>2;){for(o[0]=0;0==o[0];)a.nextBytes(o);r[--e]=o[0]}return r[--e]=2,r[--e]=0,new f.a(r)}function a(t,e){for(var r=t.toByteArray(),i=0;i=r.length)return null;for(var n="";++i191&&a<224?(n+=String.fromCharCode((31&a)<<6|63&r[i+1]),++i):(n+=String.fromCharCode((15&a)<<12|(63&r[i+1])<<6|63&r[i+2]),i+=2)}return n}function o(t){return u[t]||""}function s(t){for(var e in u)if(u.hasOwnProperty(e)){var r=u[e],i=r.length;if(t.substr(0,i)==r)return t.substr(i)}return t}r.d(e,"a",function(){return h});var f=r(53),c=r(216),h=function(){function t(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),r=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(r)<0;)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},t.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=Object(f.c)(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3,r=n(t,e);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;for(var a=i.toString(16),o=a.length,s=0;s<2*e-o;s++)a="0"+a;return a},t.prototype.setPrivate=function(t,e,r){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=Object(f.c)(t,16),this.e=parseInt(e,16),this.d=Object(f.c)(r,16)):console.error("Invalid RSA private key")},t.prototype.setPrivateEx=function(t,e,r,i,n,a,o,s){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=Object(f.c)(t,16),this.e=parseInt(e,16),this.d=Object(f.c)(r,16),this.p=Object(f.c)(i,16),this.q=Object(f.c)(n,16),this.dmp1=Object(f.c)(a,16),this.dmq1=Object(f.c)(o,16),this.coeff=Object(f.c)(s,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var r=new c.a,i=t>>1;this.e=parseInt(e,16);for(var n=new f.a(e,16);;){for(;this.p=new f.a(t-i,1,r),0!=this.p.subtract(f.a.ONE).gcd(n).compareTo(f.a.ONE)||!this.p.isProbablePrime(10););for(;this.q=new f.a(i,1,r),0!=this.q.subtract(f.a.ONE).gcd(n).compareTo(f.a.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var o=this.p.subtract(f.a.ONE),s=this.q.subtract(f.a.ONE),h=o.multiply(s);if(0==h.gcd(n).compareTo(f.a.ONE)){this.n=this.p.multiply(this.q),this.d=n.modInverse(h),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=Object(f.c)(t,16),r=this.doPrivate(e);return null==r?null:a(r,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,r){var i=new c.a,n=t>>1;this.e=parseInt(e,16);var a=new f.a(e,16),o=this,s=function(){var e=function(){if(o.p.compareTo(o.q)<=0){var t=o.p;o.p=o.q,o.q=t}var e=o.p.subtract(f.a.ONE),i=o.q.subtract(f.a.ONE),n=e.multiply(i);0==n.gcd(a).compareTo(f.a.ONE)?(o.n=o.p.multiply(o.q),o.d=a.modInverse(n),o.dmp1=o.d.mod(e),o.dmq1=o.d.mod(i),o.coeff=o.q.modInverse(o.p),setTimeout(function(){r()},0)):setTimeout(s,0)},c=function(){o.q=Object(f.b)(),o.q.fromNumberAsync(n,1,i,function(){o.q.subtract(f.a.ONE).gcda(a,function(t){0==t.compareTo(f.a.ONE)&&o.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(c,0)})})},h=function(){o.p=Object(f.b)(),o.p.fromNumberAsync(t-n,1,i,function(){o.p.subtract(f.a.ONE).gcda(a,function(t){0==t.compareTo(f.a.ONE)&&o.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(h,0)})})};setTimeout(h,0)};setTimeout(s,0)},t.prototype.sign=function(t,e,r){var n=o(r),a=n+e(t).toString(),s=i(a,this.n.bitLength()/4);if(null==s)return null;var f=this.doPrivate(s);if(null==f)return null;var c=f.toString(16);return 0==(1&c.length)?c:"0"+c},t.prototype.verify=function(t,e,r){var i=Object(f.c)(e,16),n=this.doPublic(i);return null==n?null:s(n.toString(16).replace(/^1f+00/,""))==r(t).toString()},t}(),u={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"}},function(t,e,r){"use strict";function i(){if(null==n){for(n=Object(o.a)();a=256||a>=o.b)return void(window.removeEventListener?window.removeEventListener("mousemove",u,!1):window.detachEvent&&window.detachEvent("onmousemove",u));try{var e=t.x+t.y;s[a++]=255&e,h+=1}catch(t){}};window.addEventListener?window.addEventListener("mousemove",u,!1):window.attachEvent&&window.attachEvent("onmousemove",u)}var d=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+r).toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},a.asn1.DERAbstractString=function(t){a.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},n.a.lang.extend(a.asn1.DERAbstractString,a.asn1.ASN1Object),a.asn1.DERAbstractTime=function(t){a.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e,r){var i=this.zeroPadding,n=this.localDateToUTC(t),a=String(n.getFullYear());"utc"==e&&(a=a.substr(2,2));var o=i(String(n.getMonth()+1),2),s=i(String(n.getDate()),2),f=i(String(n.getHours()),2),c=i(String(n.getMinutes()),2),h=i(String(n.getSeconds()),2),u=a+o+s+f+c+h;if(!0===r){var d=n.getMilliseconds();if(0!=d){var l=i(String(d),3);l=l.replace(/[0]+$/,""),u=u+"."+l}}return u+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,r,i,n,a){var o=new Date(Date.UTC(t,e-1,r,i,n,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},n.a.lang.extend(a.asn1.DERAbstractTime,a.asn1.ASN1Object),a.asn1.DERAbstractStructured=function(t){a.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},n.a.lang.extend(a.asn1.DERAbstractStructured,a.asn1.ASN1Object),a.asn1.DERBoolean=function(){a.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},n.a.lang.extend(a.asn1.DERBoolean,a.asn1.ASN1Object),a.asn1.DERInteger=function(t){a.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=a.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new i.a(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},n.a.lang.extend(a.asn1.DERInteger,a.asn1.ASN1Object),a.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=a.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}a.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7>>2]|=t[i]<<24-i%4*8;n.call(this,r,e)}else n.apply(this,arguments)}).prototype=i}}(),t.lib.WordArray})},function(t,e,r){!function(i,n){t.exports=e=n(r(1))}(0,function(t){return function(){function e(t){return t<<8&4278255360|t>>>8&16711935}var r=t,i=r.lib,n=i.WordArray,a=r.enc;a.Utf16=a.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(a))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>1]|=t.charCodeAt(i)<<16-i%2*16;return n.create(r,2*e)}};a.Utf16LE={stringify:function(t){for(var r=t.words,i=t.sigBytes,n=[],a=0;a>>2]>>>16-a%4*8&65535);n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var r=t.length,i=[],a=0;a>>1]|=e(t.charCodeAt(a)<<16-a%2*16);return n.create(i,2*r)}}}(),t.enc.Utf16})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(98))}(0,function(t){return function(){var e=t,r=e.lib,i=r.WordArray,n=e.algo,a=n.SHA256,o=n.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=4,t}});e.SHA224=a._createHelper(o),e.HmacSHA224=a._createHmacHelper(o)}(),t.SHA224})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(38),r(99))}(0,function(t){return function(){var e=t,r=e.x64,i=r.Word,n=r.WordArray,a=e.algo,o=a.SHA512,s=a.SHA384=o.extend({_doReset:function(){this._hash=new n.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=16,t}});e.SHA384=o._createHelper(s),e.HmacSHA384=o._createHmacHelper(s)}(),t.SHA384})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(38))}(0,function(t){return function(e){var r=t,i=r.lib,n=i.WordArray,a=i.Hasher,o=r.x64,s=o.Word,f=r.algo,c=[],h=[],u=[];!function(){for(var t=1,e=0,r=0;r<24;r++){c[t+5*e]=(r+1)*(r+2)/2%64;var i=e%5,n=(2*t+3*e)%5;t=i,e=n}for(var t=0;t<5;t++)for(var e=0;e<5;e++)h[t+5*e]=e+(2*t+3*e)%5*5;for(var a=1,o=0;o<24;o++){for(var f=0,d=0,l=0;l<7;l++){if(1&a){var p=(1<>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);var s=r[n];s.high^=o,s.low^=a}for(var f=0;f<24;f++){for(var l=0;l<5;l++){for(var p=0,b=0,g=0;g<5;g++){var s=r[l+5*g];p^=s.high,b^=s.low}var v=d[l];v.high=p,v.low=b}for(var l=0;l<5;l++)for(var y=d[(l+4)%5],m=d[(l+1)%5],_=m.high,w=m.low,p=y.high^(_<<1|w>>>31),b=y.low^(w<<1|_>>>31),g=0;g<5;g++){var s=r[l+5*g];s.high^=p,s.low^=b}for(var S=1;S<25;S++){var p,b,s=r[S],E=s.high,A=s.low,T=c[S];T<32?(p=E<>>32-T,b=A<>>32-T):(p=A<>>64-T,b=E<>>64-T);var R=d[h[S]];R.high=p,R.low=b}var k=d[0],D=r[0];k.high=D.high,k.low=D.low;for(var l=0;l<5;l++)for(var g=0;g<5;g++){var S=l+5*g,s=r[S],I=d[S],M=d[(l+1)%5+5*g],x=d[(l+2)%5+5*g];s.high=I.high^~M.high&x.high,s.low=I.low^~M.low&x.low}var s=r[0],L=u[f];s.high^=L.high,s.low^=L.low}},_doFinalize:function(){var t=this._data,r=t.words,i=(this._nDataBytes,8*t.sigBytes),a=32*this.blockSize;r[i>>>5]|=1<<24-i%32,r[(e.ceil((i+1)/a)*a>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,f=s/8,c=[],h=0;h>>24)|4278255360&(d<<24|d>>>8),l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),c.push(l),c.push(d)}return new n.init(c,s)},clone:function(){for(var t=a.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});r.SHA3=a._createHelper(l),r.HmacSHA3=a._createHmacHelper(l)}(Math),t.SHA3})},function(t,e,r){!function(i,n){t.exports=e=n(r(1))}(0,function(t){/** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ return function(e){function r(t,e,r){return t^e^r}function i(t,e,r){return t&e|~t&r}function n(t,e,r){return(t|~e)^r}function a(t,e,r){return t&r|e&~r}function o(t,e,r){return t^(e|~r)}function s(t,e){return t<>>32-e}var f=t,c=f.lib,h=c.WordArray,u=c.Hasher,d=f.algo,l=h.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),p=h.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),b=h.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),g=h.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),v=h.create([0,1518500249,1859775393,2400959708,2840853838]),y=h.create([1352829926,1548603684,1836072691,2053994217,0]),m=d.RIPEMD160=u.extend({_doReset:function(){this._hash=h.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var f=0;f<16;f++){var c=e+f,h=t[c];t[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}var u,d,m,_,w,S,E,A,T,R,k=this._hash.words,D=v.words,I=y.words,M=l.words,x=p.words,L=b.words,O=g.words;S=u=k[0],E=d=k[1],A=m=k[2],T=_=k[3],R=w=k[4];for(var C,f=0;f<80;f+=1)C=u+t[e+M[f]]|0,C+=f<16?r(d,m,_)+D[0]:f<32?i(d,m,_)+D[1]:f<48?n(d,m,_)+D[2]:f<64?a(d,m,_)+D[3]:o(d,m,_)+D[4],C|=0,C=s(C,L[f]),C=C+w|0,u=w,w=_,_=s(m,10),m=d,d=C,C=S+t[e+x[f]]|0,C+=f<16?o(E,A,T)+I[0]:f<32?a(E,A,T)+I[1]:f<48?n(E,A,T)+I[2]:f<64?i(E,A,T)+I[3]:r(E,A,T)+I[4],C|=0,C=s(C,O[f]),C=C+R|0,S=R,R=T,T=s(A,10),A=E,E=C;C=k[1]+m+T|0,k[1]=k[2]+_+R|0,k[2]=k[3]+w+S|0,k[3]=k[4]+u+E|0,k[4]=k[0]+d+A|0,k[0]=C},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,a=n.words,o=0;o<5;o++){var s=a[o];a[o]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});f.RIPEMD160=u._createHelper(m),f.HmacRIPEMD160=u._createHmacHelper(m)}(Math),t.RIPEMD160})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(36),r(37))}(0,function(t){return function(){var e=t,r=e.lib,i=r.Base,n=r.WordArray,a=e.algo,o=a.SHA1,s=a.HMAC,f=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:o,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r=this.cfg,i=s.create(r.hasher,t),a=n.create(),o=n.create([1]),f=a.words,c=o.words,h=r.keySize,u=r.iterations;f.length>24&255)){var e=t>>16&255,r=t>>8&255,i=255&t;255===e?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=i}else t+=1<<24;return t}function r(t){return 0===(t[0]=e(t[0]))&&(t[1]=e(t[1])),t}var i=t.lib.BlockCipherMode.extend(),n=i.Encryptor=i.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),r(o);var s=o.slice(0);i.encryptBlock(s,0);for(var f=0;f>>2]|=n<<24-a%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Ansix923})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(8))}(0,function(t){return t.pad.Iso10126={pad:function(e,r){var i=4*r,n=i-e.sigBytes%i;e.concat(t.lib.WordArray.random(n-1)).concat(t.lib.WordArray.create([n<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Iso10126})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(8))}(0,function(t){return t.pad.Iso97971={pad:function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(8))}(0,function(t){return t.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){for(var e=t.words,r=t.sigBytes-1,r=t.sigBytes-1;r>=0;r--)if(e[r>>>2]>>>24-r%4*8&255){t.sigBytes=r+1;break}}},t.pad.ZeroPadding})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(8))}(0,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(8))}(0,function(t){return function(e){var r=t,i=r.lib,n=i.CipherParams,a=r.enc,o=a.Hex,s=r.format;s.Hex={stringify:function(t){return t.ciphertext.toString(o)},parse:function(t){var e=o.parse(t);return n.create({ciphertext:e})}}}(),t.format.Hex})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(17),r(22),r(18),r(8))}(0,function(t){return function(){var e=t,r=e.lib,i=r.BlockCipher,n=e.algo,a=[],o=[],s=[],f=[],c=[],h=[],u=[],d=[],l=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=0,i=0,e=0;e<256;e++){var n=i^i<<1^i<<2^i<<3^i<<4;n=n>>>8^255&n^99,a[r]=n,o[n]=r;var b=t[r],g=t[b],v=t[g],y=257*t[n]^16843008*n;s[r]=y<<24|y>>>8,f[r]=y<<16|y>>>16,c[r]=y<<8|y>>>24,h[r]=y;var y=16843009*v^65537*g^257*b^16843008*r;u[n]=y<<24|y>>>8,d[n]=y<<16|y>>>16,l[n]=y<<8|y>>>24,p[n]=y,r?(r=b^t[t[t[v^b]]],i^=t[t[i]]):r=i=1}}();var b=[0,1,2,4,8,16,32,64,128,27,54],g=n.AES=i.extend({_doReset:function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,i=e.sigBytes/4,n=this._nRounds=i+6,o=4*(n+1),s=this._keySchedule=[],f=0;f6&&f%i==4&&(t=a[t>>>24]<<24|a[t>>>16&255]<<16|a[t>>>8&255]<<8|a[255&t]):(t=t<<8|t>>>24,t=a[t>>>24]<<24|a[t>>>16&255]<<16|a[t>>>8&255]<<8|a[255&t],t^=b[f/i|0]<<24),s[f]=s[f-i]^t);for(var c=this._invKeySchedule=[],h=0;h>>24]]^d[a[t>>>16&255]]^l[a[t>>>8&255]]^p[a[255&t]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,f,c,h,a)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,u,d,l,p,o);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,a,o,s){for(var f=this._nRounds,c=t[e]^r[0],h=t[e+1]^r[1],u=t[e+2]^r[2],d=t[e+3]^r[3],l=4,p=1;p>>24]^n[h>>>16&255]^a[u>>>8&255]^o[255&d]^r[l++],g=i[h>>>24]^n[u>>>16&255]^a[d>>>8&255]^o[255&c]^r[l++],v=i[u>>>24]^n[d>>>16&255]^a[c>>>8&255]^o[255&h]^r[l++],y=i[d>>>24]^n[c>>>16&255]^a[h>>>8&255]^o[255&u]^r[l++];c=b,h=g,u=v,d=y}var b=(s[c>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&d])^r[l++],g=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[d>>>8&255]<<8|s[255&c])^r[l++],v=(s[u>>>24]<<24|s[d>>>16&255]<<16|s[c>>>8&255]<<8|s[255&h])^r[l++],y=(s[d>>>24]<<24|s[c>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[l++];t[e]=b,t[e+1]=g,t[e+2]=v,t[e+3]=y},keySize:8});e.AES=i._createHelper(g)}(),t.AES})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(17),r(22),r(18),r(8))}(0,function(t){return function(){function e(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<>>5]>>>31-n%32&1}for(var a=this._subKeys=[],o=0;o<16;o++){for(var s=a[o]=[],u=h[o],i=0;i<24;i++)s[i/6|0]|=r[(c[i]-1+u)%28]<<31-i%6,s[4+(i/6|0)]|=r[28+(c[i+24]-1+u)%28]<<31-i%6;s[0]=s[0]<<1|s[0]>>>31;for(var i=1;i<7;i++)s[i]=s[i]>>>4*(i-1)+3;s[7]=s[7]<<5|s[7]>>>27}for(var d=this._invSubKeys=[],i=0;i<16;i++)d[i]=a[15-i]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,i,n){this._lBlock=t[i],this._rBlock=t[i+1],e.call(this,4,252645135),e.call(this,16,65535),r.call(this,2,858993459),r.call(this,8,16711935),e.call(this,1,1431655765);for(var a=0;a<16;a++){for(var o=n[a],s=this._lBlock,f=this._rBlock,c=0,h=0;h<8;h++)c|=u[h][((f^o[h])&d[h])>>>0];this._lBlock=f,this._rBlock=s^c}var l=this._lBlock;this._lBlock=this._rBlock,this._rBlock=l,e.call(this,1,1431655765),r.call(this,8,16711935),r.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),t[i]=this._lBlock,t[i+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});i.DES=o._createHelper(l);var p=s.TripleDES=o.extend({_doReset:function(){var t=this._key,e=t.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var r=e.slice(0,2),i=e.length<4?e.slice(0,2):e.slice(2,4),n=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=l.createEncryptor(a.create(r)),this._des2=l.createEncryptor(a.create(i)),this._des3=l.createEncryptor(a.create(n))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});i.TripleDES=o._createHelper(p)}(),t.TripleDES})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(17),r(22),r(18),r(8))}(0,function(t){return function(){function e(){for(var t=this._S,e=this._i,r=this._j,i=0,n=0;n<4;n++){e=(e+1)%256,r=(r+t[e])%256;var a=t[e];t[e]=t[r],t[r]=a,i|=t[(t[e]+t[r])%256]<<24-8*n}return this._i=e,this._j=r,i}var r=t,i=r.lib,n=i.StreamCipher,a=r.algo,o=a.RC4=n.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,i=this._S=[],n=0;n<256;n++)i[n]=n;for(var n=0,a=0;n<256;n++){var o=n%r,s=e[o>>>2]>>>24-o%4*8&255;a=(a+i[n]+s)%256;var f=i[n];i[n]=i[a],i[a]=f}this._i=this._j=0},_doProcessBlock:function(t,r){t[r]^=e.call(this)},keySize:8,ivSize:0});r.RC4=n._createHelper(o);var s=a.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)e.call(this)}});r.RC4Drop=n._createHelper(s)}(),t.RC4})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(17),r(22),r(18),r(8))}(0,function(t){return function(){function e(){for(var t=this._X,e=this._C,r=0;r<8;r++)s[r]=e[r];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,c=((4294901760&i)*i|0)+((65535&i)*i|0);f[r]=o^c}t[0]=f[0]+(f[7]<<16|f[7]>>>16)+(f[6]<<16|f[6]>>>16)|0,t[1]=f[1]+(f[0]<<8|f[0]>>>24)+f[7]|0,t[2]=f[2]+(f[1]<<16|f[1]>>>16)+(f[0]<<16|f[0]>>>16)|0,t[3]=f[3]+(f[2]<<8|f[2]>>>24)+f[1]|0,t[4]=f[4]+(f[3]<<16|f[3]>>>16)+(f[2]<<16|f[2]>>>16)|0,t[5]=f[5]+(f[4]<<8|f[4]>>>24)+f[3]|0,t[6]=f[6]+(f[5]<<16|f[5]>>>16)+(f[4]<<16|f[4]>>>16)|0,t[7]=f[7]+(f[6]<<8|f[6]>>>24)+f[5]|0}var r=t,i=r.lib,n=i.StreamCipher,a=r.algo,o=[],s=[],f=[],c=a.Rabbit=n.extend({_doReset:function(){for(var t=this._key.words,r=this.cfg.iv,i=0;i<4;i++)t[i]=16711935&(t[i]<<8|t[i]>>>24)|4278255360&(t[i]<<24|t[i]>>>8);var n=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],a=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)e.call(this);for(var i=0;i<8;i++)a[i]^=n[i+4&7];if(r){var o=r.words,s=o[0],f=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),u=c>>>16|4294901760&h,d=h<<16|65535&c;a[0]^=c,a[1]^=u,a[2]^=h,a[3]^=d,a[4]^=c,a[5]^=u,a[6]^=h,a[7]^=d;for(var i=0;i<4;i++)e.call(this)}},_doProcessBlock:function(t,r){var i=this._X;e.call(this),o[0]=i[0]^i[5]>>>16^i[3]<<16,o[1]=i[2]^i[7]>>>16^i[5]<<16,o[2]=i[4]^i[1]>>>16^i[7]<<16,o[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),t[r+n]^=o[n]},blockSize:4,ivSize:2});r.Rabbit=n._createHelper(c)}(),t.Rabbit})},function(t,e,r){!function(i,n,a){t.exports=e=n(r(1),r(17),r(22),r(18),r(8))}(0,function(t){return function(){function e(){for(var t=this._X,e=this._C,r=0;r<8;r++)s[r]=e[r];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var i=t[r]+e[r],n=65535&i,a=i>>>16,o=((n*n>>>17)+n*a>>>15)+a*a,c=((4294901760&i)*i|0)+((65535&i)*i|0);f[r]=o^c}t[0]=f[0]+(f[7]<<16|f[7]>>>16)+(f[6]<<16|f[6]>>>16)|0,t[1]=f[1]+(f[0]<<8|f[0]>>>24)+f[7]|0,t[2]=f[2]+(f[1]<<16|f[1]>>>16)+(f[0]<<16|f[0]>>>16)|0,t[3]=f[3]+(f[2]<<8|f[2]>>>24)+f[1]|0,t[4]=f[4]+(f[3]<<16|f[3]>>>16)+(f[2]<<16|f[2]>>>16)|0,t[5]=f[5]+(f[4]<<8|f[4]>>>24)+f[3]|0,t[6]=f[6]+(f[5]<<16|f[5]>>>16)+(f[4]<<16|f[4]>>>16)|0,t[7]=f[7]+(f[6]<<8|f[6]>>>24)+f[5]|0}var r=t,i=r.lib,n=i.StreamCipher,a=r.algo,o=[],s=[],f=[],c=a.RabbitLegacy=n.extend({_doReset:function(){var t=this._key.words,r=this.cfg.iv,i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var a=0;a<4;a++)e.call(this);for(var a=0;a<8;a++)n[a]^=i[a+4&7];if(r){var o=r.words,s=o[0],f=o[1],c=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),u=c>>>16|4294901760&h,d=h<<16|65535&c;n[0]^=c,n[1]^=u,n[2]^=h,n[3]^=d,n[4]^=c,n[5]^=u,n[6]^=h,n[7]^=d;for(var a=0;a<4;a++)e.call(this)}},_doProcessBlock:function(t,r){var i=this._X;e.call(this),o[0]=i[0]^i[5]>>>16^i[3]<<16,o[1]=i[2]^i[7]>>>16^i[5]<<16,o[2]=i[4]^i[1]>>>16^i[7]<<16,o[3]=i[6]^i[3]>>>16^i[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),t[r+n]^=o[n]},blockSize:4,ivSize:2});r.RabbitLegacy=n._createHelper(c)}(),t.RabbitLegacy})},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(39),s=r(55),f=r(101),c=r(5),h=r(54),u=r(41),d=r(59),l=r(105),p=r(106),b=r(7),g=r(2),v=r(107),y=r(58),m=r(260),_=function(){function t(t,e){for(var r=0;r0&&-1===t&&(g.b.log("override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=w.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this.forceStartLoad=!0,this.state=w.STOPPED},e.prototype.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.clearInterval(),this.state=w.STOPPED,this.forceStartLoad=!1},e.prototype.doTick=function(){switch(this.state){case w.BUFFER_FLUSHING:this.fragLoadError=0;break;case w.IDLE:this._doTickIdle();break;case w.WAITING_LEVEL:var t=this.levels[this.level];t&&t.details&&(this.state=w.IDLE);break;case w.FRAG_LOADING_WAITING_RETRY:var e=performance.now(),r=this.retryDate;(!r||e>=r||this.media&&this.media.seeking)&&(g.b.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=w.IDLE);break;case w.ERROR:case w.STOPPED:case w.FRAG_LOADING:case w.PARSING:case w.PARSED:case w.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},e.prototype._doTickIdle=function(){var t=this.hls,e=t.config,r=this.media;if(void 0!==this.levelLastLoaded&&(r||!this.startFragRequested&&e.startFragPrefetch)){var i=void 0;i=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var n=t.nextLoadLevel,a=this.levels[n];if(a){var o=a.bitrate,f=void 0;f=o?Math.max(8*e.maxBufferSize/o,e.maxBufferLength):e.maxBufferLength,f=Math.min(f,e.maxMaxBufferLength);var h=s.a.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,i,e.maxBufferHole),u=h.len;if(!(u>=f)){g.b.trace("buffer length of "+u.toFixed(3)+" is below max of "+f.toFixed(3)+". checking for more payload ..."),this.level=t.nextLoadLevel=n;var d=a.details;if(void 0===d||!0===d.live&&this.levelLastLoaded!==n)return void(this.state=w.WAITING_LEVEL);var l=this.fragPrevious;if(!d.live&&l&&!l.backtracked&&l.sn===d.endSN&&!h.nextStart){if(Math.min(r.duration,l.start+l.duration)-Math.max(h.end,l.start)<=Math.max(.2,l.duration)){var p={};return this.altAudio&&(p.type="video"),this.hls.trigger(c.a.BUFFER_EOS,p),void(this.state=w.ENDED)}}this._fetchPayloadOrEos(i,h,d)}}}},e.prototype._fetchPayloadOrEos=function(t,e,r){var i=this.fragPrevious,n=this.level,a=r.fragments,o=a.length;if(0!==o){var s=a[0].start,f=a[o-1].start+a[o-1].duration,c=e.end,h=void 0;if(r.initSegment&&!r.initSegment.data)h=r.initSegment;else if(r.live){var u=this.config.initialLiveManifestSize;if(od&&(c.currentTime=d),this.nextLoadPosition=d}if(t.PTSKnown&&e>i&&c&&c.readyState)return null;if(this.startFragRequested&&!t.PTSKnown){if(n)if(t.programDateTime)h=Object(m.b)(a,n.endPdt+1);else{var l=n.sn+1;if(l>=t.startSN&&l<=t.endSN){var p=a[l-t.startSN];n.cc===p.cc&&(h=p,g.b.log("live playlist, switching playlist, load frag with next SN: "+h.sn))}h||(h=o.a.search(a,function(t){return n.cc-t.cc}))&&g.b.log("live playlist, switching playlist, load frag with same CC: "+h.sn)}h||(h=a[Math.min(s-1,Math.round(s/2))],g.b.log("live playlist, switching playlist, unknown, load middle frag : "+h.sn))}return h},e.prototype._findFragment=function(t,e,r,i,n,a,o){var s=this.hls.config,f=void 0,c=void 0;if(ns.maxBufferHole&&e.dropped&&h?(f=d,g.b.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(f=l,g.b.log("SN just loaded, load next one: "+f.sn))}else f=null;else f.backtracked&&(l&&l.backtracked?(g.b.warn("Already backtracked from fragment "+l.sn+", will not backtrack to fragment "+f.sn+". Loading fragment "+l.sn),f=l):(g.b.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),f.dropped=0,d?(f=d,f.backtracked=!0):h&&(f=null)))}return f},e.prototype._loadKey=function(t){this.state=w.KEY_LOADING,this.hls.trigger(c.a.KEY_LOADING,{frag:t})},e.prototype._loadFragment=function(t){var e=this.fragmentTracker.getState(t);this.fragCurrent=t,this.startFragRequested=!0,isNaN(t.sn)||t.bitrateTest||(this.nextLoadPosition=t.start+t.duration),t.backtracked||e===h.a.NOT_LOADED||e===h.a.PARTIAL?(t.autoLevel=this.hls.autoLevelEnabled,t.bitrateTest=this.bitrateTest,this.hls.trigger(c.a.FRAG_LOADING,{frag:t}),this.demuxer||(this.demuxer=new f.a(this.hls,"main")),this.state=w.FRAG_LOADING):e===h.a.APPENDING&&this._reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t)},e.prototype.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,d.a.LevelType.MAIN)},e.prototype.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.endPTS+.5):null},e.prototype._checkFragmentChanged=function(){var t=void 0,e=void 0,r=this.media;if(r&&r.readyState&&!1===r.seeking&&(e=r.currentTime,e>this.lastCurrentTime&&(this.lastCurrentTime=e),s.a.isBuffered(r,e)?t=this.getBufferedFrag(e):s.a.isBuffered(r,e+.1)&&(t=this.getBufferedFrag(e+.1)),t)){var i=t;if(i!==this.fragPlaying){this.hls.trigger(c.a.FRAG_CHANGED,{frag:i});var n=i.level;this.fragPlaying&&this.fragPlaying.level===n||this.hls.trigger(c.a.LEVEL_SWITCHED,{level:n}),this.fragPlaying=i}}},e.prototype.immediateLevelSwitch=function(){if(g.b.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var t=this.media,e=void 0;t?(e=t.paused,t.pause()):e=!0,this.previouslyPaused=e}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},e.prototype.immediateLevelSwitchEnd=function(){var t=this.media;t&&t.buffered.length&&(this.immediateSwitch=!1,s.a.isBuffered(t,t.currentTime)&&(t.currentTime-=1e-4),this.previouslyPaused||t.play())},e.prototype.nextLevelSwitch=function(){var t=this.media;if(t&&t.readyState){var e=void 0,r=void 0,i=void 0;if(r=this.getBufferedFrag(t.currentTime),r&&r.startPTS>1&&this.flushMainBuffer(0,r.startPTS-1),t.paused)e=0;else{var n=this.hls.nextLoadLevel,a=this.levels[n],o=this.fragLastKbps;e=o&&this.fragCurrent?this.fragCurrent.duration*a.bitrate/(1e3*o)+1:0}if((i=this.getBufferedFrag(t.currentTime+e))&&(i=this.followingBufferedFrag(i))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(i.maxStartPTS,Number.POSITIVE_INFINITY)}}},e.prototype.flushMainBuffer=function(t,e){this.state=w.BUFFER_FLUSHING;var r={startOffset:t,endOffset:e};this.altAudio&&(r.type="video"),this.hls.trigger(c.a.BUFFER_FLUSHING,r)},e.prototype.onMediaAttached=function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("seeked",this.onvseeked),e.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition)},e.prototype.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(g.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var e=this.levels;e&&e.forEach(function(t){t.details&&t.details.fragments.forEach(function(t){t.backtracked=void 0})}),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("seeked",this.onvseeked),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},e.prototype.onMediaSeeking=function(){var t=this.media,e=t?t.currentTime:void 0,r=this.config;isNaN(e)||g.b.log("media seeking to "+e.toFixed(3));var i=this.mediaBuffer?this.mediaBuffer:t,n=s.a.bufferInfo(i,e,this.config.maxBufferHole);if(this.state===w.FRAG_LOADING){var a=this.fragCurrent;if(0===n.len&&a){var o=r.maxFragLookUpTolerance,f=a.start-o,c=a.start+a.duration+o;ec?(a.loader&&(g.b.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),a.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=w.IDLE):g.b.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===w.ENDED&&(0===n.len&&(this.fragPrevious=0),this.state=w.IDLE);t&&(this.lastCurrentTime=e),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=e),this.tick()},e.prototype.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:void 0;isNaN(e)||g.b.log("media seeked to "+e.toFixed(3)),this.tick()},e.prototype.onMediaEnded=function(){g.b.log("media ended"),this.startPosition=this.lastCurrentTime=0},e.prototype.onManifestLoading=function(){g.b.log("trigger BUFFER_RESET"),this.hls.trigger(c.a.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},e.prototype.onManifestParsed=function(t){var e=!1,r=!1,i=void 0;t.levels.forEach(function(t){(i=t.audioCodec)&&(-1!==i.indexOf("mp4a.40.2")&&(e=!0),-1!==i.indexOf("mp4a.40.5")&&(r=!0))}),this.audioCodecSwitch=e&&r,this.audioCodecSwitch&&g.b.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1;var n=this.config;(n.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(n.startPosition)},e.prototype.onLevelLoaded=function(t){var e=t.details,r=t.level,i=this.levels[this.levelLastLoaded],n=this.levels[r],a=e.totalduration,o=0;if(g.b.log("level "+r+" loaded ["+e.startSN+","+e.endSN+"],duration:"+a),e.live){var s=n.details;s&&e.fragments.length>0?(l.a(s,e),o=e.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(o,s),e.PTSKnown&&!isNaN(o)?g.b.log("live playlist sliding:"+o.toFixed(3)):(g.b.log("live playlist - outdated PTS, unknown sliding"),Object(v.a)(this.fragPrevious,i,e))):(g.b.log("live playlist - first load, unknown sliding"),e.PTSKnown=!1,Object(v.a)(this.fragPrevious,i,e))}else e.PTSKnown=!1;if(n.details=e,this.levelLastLoaded=r,this.hls.trigger(c.a.LEVEL_UPDATED,{details:e,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var f=e.startTimeOffset;isNaN(f)?e.live?(this.startPosition=this.computeLivePosition(o,e),g.b.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(f<0&&(g.b.log("negative start time offset "+f+", count from end of last fragment"),f=o+a+f),g.b.log("start time offset found in playlist, adjust startPosition to "+f),this.startPosition=f),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===w.WAITING_LEVEL&&(this.state=w.IDLE),this.tick()},e.prototype.onKeyLoaded=function(){this.state===w.KEY_LOADING&&(this.state=w.IDLE,this.tick())},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,r=t.frag;if(this.state===w.FRAG_LOADING&&e&&"main"===r.type&&r.level===e.level&&r.sn===e.sn){var i=t.stats,n=this.levels[e.level],a=n.details;if(g.b.log("Loaded "+e.sn+" of ["+a.startSN+" ,"+a.endSN+"],level "+e.level),this.bitrateTest=!1,this.stats=i,!0===r.bitrateTest&&this.hls.nextLoadLevel)this.state=w.IDLE,this.startFragRequested=!1,i.tparsed=i.tbuffered=performance.now(),this.hls.trigger(c.a.FRAG_BUFFERED,{stats:i,frag:e,id:"main"}),this.tick();else if("initSegment"===r.sn)this.state=w.IDLE,i.tparsed=i.tbuffered=performance.now(),a.initSegment.data=t.payload,this.hls.trigger(c.a.FRAG_BUFFERED,{stats:i,frag:e,id:"main"}),this.tick();else{this.state=w.PARSING;var o=a.totalduration,s=e.level,h=e.sn,u=this.config.defaultAudioCodec||n.audioCodec;this.audioCodecSwap&&(g.b.log("swapping playlist audio codec"),void 0===u&&(u=this.lastAudioCodec),u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,g.b.log("Parsing "+h+" of ["+a.startSN+" ,"+a.endSN+"],level "+s+", cc "+e.cc);var d=this.demuxer;d||(d=this.demuxer=new f.a(this.hls,"main"));var l=this.media,p=l&&l.seeking,b=!p&&(a.PTSKnown||!a.live),v=a.initSegment?a.initSegment.data:[];d.push(t.payload,v,u,n.videoCodec,e,o,b,void 0)}}this.fragLoadError=0},e.prototype.onFragParsingInitSegment=function(t){var e=this.fragCurrent,r=t.frag;if(e&&"main"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===w.PARSING){var i=t.tracks,n=void 0,a=void 0;if(i.audio&&this.altAudio&&delete i.audio,a=i.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(g.b.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==a.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==a.container&&(o="mp4a.40.2",g.b.log("Android: force audio codec to "+o)),a.levelCodec=o,a.id=t.id}a=i.video,a&&(a.levelCodec=this.levels[this.level].videoCodec,a.id=t.id),this.hls.trigger(c.a.BUFFER_CODECS,i);for(n in i){a=i[n],g.b.log("main track:"+n+",container:"+a.container+",codecs[level/parsed]=["+a.levelCodec+"/"+a.codec+"]");var f=a.initSegment;f&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(c.a.BUFFER_APPENDING,{type:n,data:f,parent:"main",content:"initSegment"}))}this.tick()}},e.prototype.onFragParsingData=function(t){var e=this,r=this.fragCurrent,i=t.frag;if(r&&"main"===t.id&&i.sn===r.sn&&i.level===r.level&&("audio"!==t.type||!this.altAudio)&&this.state===w.PARSING){var n=this.levels[this.level],a=r;if(isNaN(t.endPTS)&&(t.endPTS=t.startPTS+r.duration,t.endDTS=t.startDTS+r.duration),!0===t.hasAudio&&a.addElementaryStream(u.a.ElementaryStreamTypes.AUDIO),!0===t.hasVideo&&a.addElementaryStream(u.a.ElementaryStreamTypes.VIDEO),g.b.log("Parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb+",dropped:"+(t.dropped||0)),"video"===t.type)if(a.dropped=t.dropped,a.dropped)if(a.backtracked)g.b.warn("Already backtracked on this fragment, appending with the gap",a.sn);else{var o=n.details;if(!o||a.sn!==o.startSN)return g.b.warn("missing video frame(s), backtracking fragment",a.sn),this.fragmentTracker.removeFragment(a),a.backtracked=!0,this.nextLoadPosition=t.startPTS,this.state=w.IDLE,this.fragPrevious=a,void this.tick();g.b.warn("missing video frame(s) on first frag, appending with gap",a.sn)}else a.backtracked=!1;var s=l.b(n.details,a,t.startPTS,t.endPTS,t.startDTS,t.endDTS),f=this.hls;f.trigger(c.a.LEVEL_PTS_UPDATED,{details:n.details,level:this.level,drift:s,type:t.type,start:t.startPTS,end:t.endPTS}),[t.data1,t.data2].forEach(function(r){r&&r.length&&e.state===w.PARSING&&(e.appended=!0,e.pendingBuffering=!0,f.trigger(c.a.BUFFER_APPENDING,{type:t.type,data:r,parent:"main",content:"data"}))}),this.tick()}},e.prototype.onFragParsed=function(t){var e=this.fragCurrent,r=t.frag;e&&"main"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===w.PARSING&&(this.stats.tparsed=performance.now(),this.state=w.PARSED,this._checkAppendedParsed())},e.prototype.onAudioTrackSwitching=function(t){var e=!!t.url,r=t.id;if(!e){if(this.mediaBuffer!==this.media){g.b.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var i=this.fragCurrent;i.loader&&(g.b.log("switching to main audio track, cancel main fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=w.IDLE}var n=this.hls;n.trigger(c.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),n.trigger(c.a.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}},e.prototype.onAudioTrackSwitched=function(t){var e=t.id,r=!!this.hls.audioTracks[e].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(g.b.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()},e.prototype.onBufferCreated=function(t){var e=t.tracks,r=void 0,i=void 0,n=!1;for(var a in e){var o=e[a];"main"===o.id?(i=a,r=o,"video"===a&&(this.videoBuffer=e[a].buffer)):n=!0}n&&r?(g.b.log("alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},e.prototype.onBufferAppended=function(t){if("main"===t.parent){var e=this.state;e!==w.PARSING&&e!==w.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},e.prototype._checkAppendedParsed=function(){if(!(this.state!==w.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent;if(t){var e=this.mediaBuffer?this.mediaBuffer:this.media;g.b.log("main buffered : "+p.a.toString(e.buffered)),this.fragPrevious=t;var r=this.stats;r.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*r.total/(r.tbuffered-r.tfirst)),this.hls.trigger(c.a.FRAG_BUFFERED,{stats:r,frag:t,id:"main"}),this.state=w.IDLE}this.tick()}},e.prototype.onError=function(t){var e=t.frag||this.fragCurrent;if(!e||"main"===e.type){var r=!!this.media&&s.a.isBuffered(this.media,this.media.currentTime)&&s.a.isBuffered(this.media,this.media.currentTime+.5);switch(t.details){case b.a.FRAG_LOAD_ERROR:case b.a.FRAG_LOAD_TIMEOUT:case b.a.KEY_LOAD_ERROR:case b.a.KEY_LOAD_TIMEOUT:if(!t.fatal)if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var i=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);g.b.warn("mediaController: frag loading failed, retry in "+i+" ms"),this.retryDate=performance.now()+i,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=w.FRAG_LOADING_WAITING_RETRY}else g.b.error("mediaController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=w.ERROR;break;case b.a.LEVEL_LOAD_ERROR:case b.a.LEVEL_LOAD_TIMEOUT:this.state!==w.ERROR&&(t.fatal?(this.state=w.ERROR,g.b.warn("streamController: "+t.details+",switch to "+this.state+" state ...")):t.levelRetry||this.state!==w.WAITING_LEVEL||(this.state=w.IDLE));break;case b.a.BUFFER_FULL_ERROR:"main"!==t.parent||this.state!==w.PARSING&&this.state!==w.PARSED||(r?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=w.IDLE):(g.b.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}},e.prototype._reduceMaxBufferLength=function(t){var e=this.config;return e.maxMaxBufferLength>=t&&(e.maxMaxBufferLength/=2,g.b.warn("main:reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},e.prototype._checkBuffer=function(){var t=this.config,e=this.media;if(e&&0!==e.readyState){var r=e.currentTime,i=this.mediaBuffer?this.mediaBuffer:e,n=i.buffered;if(!this.loadedmetadata&&n.length)this.loadedmetadata=!0,this._seekToStartPos();else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var a=!(e.paused&&e.readyState>1||e.ended||0===e.buffered.length),o=performance.now();if(r!==this.lastCurrentTime)this.stallReported&&(g.b.warn("playback not stuck anymore @"+r+", after "+Math.round(o-this.stalled)+"ms"),this.stallReported=!1),this.stalled=null,this.nudgeRetry=0;else if(a){var f=o-this.stalled,c=s.a.bufferInfo(e,r,t.maxBufferHole);if(!this.stalled)return void(this.stalled=o);f>=1e3&&this._reportStall(c.len),this._tryFixBufferStall(c,f)}}}},e.prototype.onFragLoadEmergencyAborted=function(){this.state=w.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},e.prototype.onBufferFlushed=function(){var t=this.mediaBuffer?this.mediaBuffer:this.media;t&&this.fragmentTracker.detectEvictedFragments(u.a.ElementaryStreamTypes.VIDEO,t.buffered),this.state=w.IDLE,this.fragPrevious=null},e.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},e.prototype.computeLivePosition=function(t,e){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*e.targetduration;return t+Math.max(0,e.totalduration-r)},e.prototype._tryFixBufferStall=function(t,e){var r=this.config,i=this.media,n=i.currentTime,a=this.fragmentTracker.getPartialFragment(n);a&&this._trySkipBufferHole(a),t.len>.5&&e>1e3*r.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())},e.prototype._reportStall=function(t){var e=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,g.b.warn("Playback stalling at @"+r.currentTime+" due to low buffer"),e.trigger(c.a.ERROR,{type:b.b.MEDIA_ERROR,details:b.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},e.prototype._trySkipBufferHole=function(t){for(var e=this.hls,r=this.media,i=r.currentTime,n=0,a=0;a=n&&i"+t),this.hls.trigger(c.a.STREAM_STATE_TRANSITION,{previousState:e,nextState:t})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getBufferedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;return t?this.followingBufferedFrag(this.getBufferedFrag(t.currentTime)):null}},{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(t){this._liveSyncPosition=t}}]),e}(y.a);e.a=S},function(t,e,r){function i(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e.oe=function(t){throw console.error(t),t};var i=e(e.s=ENTRY_MODULE);return i.default||i}function n(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(t,e,i){var a={};a[i]=[];var o=e.toString(),s=o.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return a;for(var h,u=s[1],d=new RegExp("(\\\\n|\\W)"+n(u)+c,"g");h=d.exec(o);)"dll-reference"!==h[3]&&a[i].push(h[3]);for(d=new RegExp("\\("+n(u)+'\\("(dll-reference\\s('+f+'))"\\)\\)'+c,"g");h=d.exec(o);)t[h[2]]||(a[i].push(h[1]),t[h[2]]=r(h[1]).m),a[h[2]]=a[h[2]]||[],a[h[2]].push(h[4]);return a}function o(t){return Object.keys(t).reduce(function(e,r){return e||t[r].length>0},!1)}function s(t,e){for(var r={main:[e]},i={main:[]},n={main:{}};o(r);)for(var s=Object.keys(r),f=0;f>>8^255&g^99,t[l]=g,e[g]=l;var v=d[l],y=d[v],m=d[y],_=257*d[g]^16843008*g;i[l]=_<<24|_>>>8,n[l]=_<<16|_>>>16,a[l]=_<<8|_>>>24,o[l]=_,_=16843009*m^65537*y^257*v^16843008*l,f[g]=_<<24|_>>>8,c[g]=_<<16|_>>>16,h[g]=_<<8|_>>>24,u[g]=_,l?(l=v^d[d[d[m^v]]],p^=d[d[p]]):l=p=1}},t.prototype.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,i=0;i0){var a=16*parseInt(t.length/16);n=n.slice(0,a),n=i.decrypt(n),t.set(n,0);var o=(new Date).valueOf();return h.b.log("parse pes extra time:"+(o-r)),t}n=t,n=i.decrypt(t);var o=(new Date).valueOf();return h.b.log("parse pes extra time:"+(o-r)),n}catch(e){return t}}var a=r(103),o=r(104),s=r(5),f=r(252),c=r(253),h=r(2),u=r(7),d=r(100),l=null,p="",b={video:1,audio:2,id3:3,text:4},g=function(){function t(e,r,a,o,s){if(i(this,t),this.observer=e,this.config=a,this.typeSupported=o,this.remuxer=r,this.sampleAes=null,this.url=s,l=n,a&&a._sce_dlgtqredxx&&a._sce_dlgtqredxx.length&&a._sce_dlgtqredxx[0].url){p=void 0;for(var f=0;f>4>1){if((d=a+5+e[a+4])===a+188)continue}else d=a+4;switch(c){case m:f&&(E&&(l=D(E))&&void 0!==l.pts&&I(l,!1),E={data:[],size:0}),E&&(E.data.push(e.subarray(d,a+188)),E.size+=a+188-d);break;case _:f&&(A&&(l=D(A))&&void 0!==l.pts&&(v.isAAC?M(l):x(l)),A={data:[],size:0}),A&&(A.data.push(e.subarray(d,a+188)),A.size+=a+188-d);break;case w:f&&(T&&(l=D(T))&&void 0!==l.pts&&L(l),T={data:[],size:0}),T&&(T.data.push(e.subarray(d,a+188)),T.size+=a+188-d);break;case 0:f&&(d+=e[d]+1),S=this._pmtId=R(e,d);break;case S:f&&(d+=e[d]+1);var C=k(e,d,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);m=C.avc,m>0&&(g.pid=m),_=C.audio,_>0&&(v.pid=_,v.isAAC=C.isAAC),w=C.id3,w>0&&(y.pid=w),p&&!b&&(h.b.log("reparse from beginning"),p=!1,a=O-188),b=this.pmtParsed=!0;break;case 17:case 8191:break;default:p=!0}}else this.observer.trigger(s.a.ERROR,{type:u.b.MEDIA_ERROR,details:u.a.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E&&(l=D(E))&&void 0!==l.pts?(I(l,!0),g.pesData=null):g.pesData=E,A&&(l=D(A))&&void 0!==l.pts?(v.isAAC?M(l):x(l),v.pesData=null):(A&&A.size&&h.b.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=A),T&&(l=D(T))&&void 0!==l.pts?(L(l),y.pesData=null):y.pesData=T,null==this.sampleAes?this.remuxer.remux(v,g,y,this._txtTrack,r,i,n):this.decryptAndRemux(v,g,y,this._txtTrack,r,i,n)},t.prototype.decryptAndRemux=function(t,e,r,i,n,a,o){if(t.samples&&t.isAAC){var s=this;this.sampleAes.decryptAacSamples(t.samples,0,function(){s.decryptAndRemuxAvc(t,e,r,i,n,a,o)})}else this.decryptAndRemuxAvc(t,e,r,i,n,a,o)},t.prototype.decryptAndRemuxAvc=function(t,e,r,i,n,a,o){if(e.samples){var s=this;this.sampleAes.decryptAvcSamples(e.samples,0,0,function(){s.remuxer.remux(t,e,r,i,n,a,o)})}else this.remuxer.remux(t,e,r,i,n,a,o)},t.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},t.prototype._parsePAT=function(t,e){return(31&t[e+10])<<8|t[e+11]},t.prototype._parsePMT=function(t,e,r,i){var n=void 0,a=void 0,o=void 0,s=void 0,f={audio:-1,avc:-1,id3:-1,isAAC:!0};for(n=(15&t[e+1])<<8|t[e+2],a=e+3+n-4,o=(15&t[e+10])<<8|t[e+11],e+=12+o;e1;){var d=new Uint8Array(u[0].length+u[1].length);d.set(u[0]),d.set(u[1],u[0].length),u[0]=d,u.splice(1,1)}if(r=u[0],1===(r[0]<<16)+(r[1]<<8)+r[2]){if((n=(r[4]<<8)+r[5])&&n>t.size-6)return null;i=r[7],192&i&&(s=536870912*(14&r[9])+4194304*(255&r[10])+16384*(254&r[11])+128*(255&r[12])+(254&r[13])/2,s>4294967295&&(s-=8589934592),64&i?(f=536870912*(14&r[14])+4194304*(255&r[15])+16384*(254&r[16])+128*(255&r[17])+(254&r[18])/2,f>4294967295&&(f-=8589934592),s-f>54e5&&(h.b.warn(Math.round((s-f)/9e4)+"s delta between PTS and DTS, align them"),s=f)):f=s),a=r[8],c=a+9,t.size-=c,o=new Uint8Array(t.size);try{for(var b=0,g=u.length;bv){c-=v;continue}r=r.subarray(c),v-=c,c=0}o.set(r,e),e+=v}}catch(t){console.log(t)}return n&&(n-=a+3),p&&l&&(o=l(o,p)),{data:o,pts:s,dts:f,len:n}}return null},t.prototype.pushAccesUnit=function(t,e){if(t.units.length&&t.frame){var r=e.samples,i=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===t.key||e.sps&&(i||this.contiguous)?(t.id=i,r.push(t)):e.dropped++}t.debug.length&&h.b.log(t.pts+"/"+t.dts+":"+t.debug)},t.prototype._parseAVCPES=function(t,e){var r=this,i=this._avcTrack,n=this._parseAVCNALu(t.data),a=void 0,o=this.avcSample,c=void 0,h=!1,u=void 0,d=this.pushAccesUnit.bind(this),l=function(t,e,r,i){return{key:t,pts:e,dts:r,units:[],debug:i}};t.data=null,o&&n.length&&!i.audFound&&(d(o,i),o=this.avcSample=l(!1,t.pts,t.dts,"")),n.forEach(function(e){switch(e.type){case 1:c=!0,o||(o=r.avcSample=l(!0,t.pts,t.dts,"")),o.frame=!0;var n=e.data;if(h&&n.length>4){var p=new f.a(n).readSliceType();2!==p&&4!==p&&7!==p&&9!==p||(o.key=!0)}break;case 5:c=!0,o||(o=r.avcSample=l(!0,t.pts,t.dts,"")),o.key=!0,o.frame=!0;break;case 6:c=!0,"undefined"!=typeof Uint8Array&&(Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:Array.prototype.slice}));var n=e.data;if(n&&n.length>3&&6==n[0]&&5==n[1]){var b=n[2]-16;if(b>0&&n.length>b+19){var g=n.slice(19,b+19);r.observer.trigger(s.a.FRAG_PARSING_USERDATA,{dataContent:g})}}a=new f.a(r.discardEPB(e.data)),a.readUByte();for(var v=0,y=0,m=!1,_=0;!m&&a.bytesAvailable>1;){v=0;do{_=a.readUByte(),v+=_}while(255===_);y=0;do{_=a.readUByte(),y+=_}while(255===_);if(4===v&&0!==a.bytesAvailable){m=!0;if(181===a.readUByte()){if(49===a.readUShort()){if(1195456820===a.readUInt()){if(3===a.readUByte()){var w=a.readUByte(),S=a.readUByte(),E=31&w,A=[w,S];for(u=0;u0){if(e.pts>=t[r-1].pts)t.push(e);else for(var i=r-1;i>=0;i--)if(e.pts=0)c={data:t.subarray(u,e-o-1),type:d},f.push(c);else{var l=this._getLastNalUnit();if(l&&(s&&e<=4-s&&l.state&&(l.data=l.data.subarray(0,l.data.byteLength-s)),(n=e-o-1)>0)){var p=new Uint8Array(l.data.byteLength+n);p.set(l.data,0),p.set(t.subarray(0,n),l.data.byteLength),l.data=p}}e=0&&o>=0&&(c={data:t.subarray(u,r),type:d,state:o},f.push(c)),0===f.length){var b=this._getLastNalUnit();if(b){var g=new Uint8Array(b.data.byteLength+t.byteLength);g.set(b.data,0),g.set(t,b.data.byteLength),b.data=g}}return a.naluState=o,f},t.prototype.discardEPB=function(t){for(var e=t.byteLength,r=[],i=1,n=void 0,a=void 0;i1&&(h.b.log("AAC: align PTS for overlapping frames by "+Math.round((y-i)/90)),i=y)}for(;dt?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},t.prototype.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&n.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0&&this.bitsAvailable?r<>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},t.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},t.prototype.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},t.prototype.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},t.prototype.readBoolean=function(){return 1===this.readBits(1)},t.prototype.readUByte=function(){return this.readBits(8)},t.prototype.readUShort=function(){return this.readBits(16)},t.prototype.readUInt=function(){return this.readBits(32)},t.prototype.skipScalingList=function(t){var e=8,r=8,i=void 0,n=void 0;for(i=0;i=t.length)return void r();if(!(t[e].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(t,e,r,i),!i)return}}},t.prototype.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),i=0,n=32;n<=t.length-16;n+=160,i+=16)r.set(t.subarray(n,n+16),i);return r},t.prototype.getAvcDecryptedUnit=function(t,e){e=new Uint8Array(e);for(var r=0,i=32;i<=t.length-16;i+=160,r+=16)t.set(e.subarray(r,r+16),i);return t},t.prototype.decryptAvcSample=function(t,e,r,i,n,a){var o=this.discardEPB(n.data),s=this.getAvcEncryptedData(o),f=this;this.decryptBuffer(s.buffer,function(s){n.data=f.getAvcDecryptedUnit(o,s),a||f.decryptAvcSamples(t,e,r+1,i)})},t.prototype.decryptAvcSamples=function(t,e,r,i){for(;;e++,r=0){if(e>=t.length)return void i();for(var n=t[e].units;!(r>=n.length);r++){var a=n[r];if(!(a.data.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,r,i,a,o),!o)return}}}},t}();e.a=a},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=r(40),a=r(2),o=r(104),s=function(){function t(e,r,n){i(this,t),this.observer=e,this.config=n,this.remuxer=r}return t.prototype.resetInitSegment=function(t,e,r,i){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:e,duration:i,inputTimeScale:9e4}},t.prototype.resetTimeStamp=function(){},t.probe=function(t){var e=void 0,r=void 0,i=n.a.getID3Data(t,0);if(i&&void 0!==n.a.getTimeStamp(i))for(e=i.length,r=Math.min(t.length-1,e+100);e-1&&o&&!o.match("CriOS"),this.ISGenerated=!1}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(t){this._initPTS=this._initDTS=t},t.prototype.resetInitSegment=function(){this.ISGenerated=!1},t.prototype.remux=function(t,e,r,i,n,a,s){if(this.ISGenerated||this.generateIS(t,e,n),this.ISGenerated){var c=t.samples.length,h=e.samples.length,u=n,d=n;if(c&&h){var l=(t.samples[0].dts-e.samples[0].dts)/e.inputTimeScale;u+=Math.max(0,l),d+=Math.max(0,-l)}if(c){t.timescale||(f.b.warn("regenerate InitSegment as audio detected"),this.generateIS(t,e,n));var p=this.remuxAudio(t,u,a,s);if(h){var b=void 0;p&&(b=p.endPTS-p.startPTS),e.timescale||(f.b.warn("regenerate InitSegment as video detected"),this.generateIS(t,e,n)),this.remuxVideo(e,d,a,b,s)}}else if(h){var g=this.remuxVideo(e,d,a,0,s);g&&t.codec&&this.remuxEmptyAudio(t,u,a,g)}}r.samples.length&&this.remuxID3(r,n),i.samples.length&&this.remuxText(i,n),this.observer.trigger(o.a.FRAG_PARSED)},t.prototype.generateIS=function(t,e,r){var i=this.observer,n=t.samples,c=e.samples,h=this.typeSupported,u="audio/mp4",d={},l={tracks:d},p=void 0===this._initPTS,b=void 0,g=void 0;if(p&&(b=g=1/0),t.config&&n.length&&(t.timescale=t.samplerate,f.b.log("audio sampling rate : "+t.samplerate),t.isAAC||(h.mpeg?(u="audio/mpeg",t.codec=""):h.mp3&&(t.codec="mp3")),d.audio={container:u,codec:t.codec,initSegment:!t.isAAC&&h.mpeg?new Uint8Array:a.a.initSegment([t]),metadata:{channelCount:t.channelCount}},p&&(b=g=n[0].pts-t.inputTimeScale*r)),e.sps&&e.pps&&c.length){var v=e.inputTimeScale;e.timescale=v,d.video={container:"video/mp4",codec:e.codec,initSegment:a.a.initSegment([e]),metadata:{width:e.width,height:e.height}},p&&(b=Math.min(b,c[0].pts-v*r),g=Math.min(g,c[0].dts-v*r),this.observer.trigger(o.a.INIT_PTS_FOUND,{initPTS:b}))}Object.keys(d).length?(i.trigger(o.a.FRAG_PARSING_INIT_SEGMENT,l),this.ISGenerated=!0,p&&(this._initPTS=b,this._initDTS=g)):i.trigger(o.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},t.prototype.remuxVideo=function(t,e,r,i,n){var c=8,h=t.timescale,u=void 0,d=void 0,l=void 0,p=void 0,b=void 0,g=void 0,v=void 0,y=t.samples,m=[],_=y.length,w=this._PTSNormalize,S=this._initDTS,E=this.nextAvcDts,A=this.isSafari;if(0!==_){A&&(r|=y.length&&E&&(n&&Math.abs(e-E/h)<.1||Math.abs(y[0].pts-E-S)1?f.b.log("AVC:"+D+" ms hole between fragments detected,filling it"):D<-1&&f.b.log("AVC:"+-D+" ms overlapping between fragments detected"),b=E,y[0].dts=b,p=Math.max(p-D,E),y[0].pts=p,f.b.log("Video/PTS/DTS adjusted: "+Math.round(p/90)+"/"+Math.round(b/90)+",delta:"+D+" ms")),b,k=y[y.length-1],v=Math.max(k.dts,0),g=Math.max(k.pts,0,v),A&&(u=Math.round((v-b)/(y.length-1)));for(var I=0,M=0,x=0;x<_;x++){for(var L=y[x],O=L.units,C=O.length,P=0,B=0;B0?U-1:U].dts;if(X.stretchShortVideoTrack){var J=X.maxBufferHole,Q=Math.floor(J*h),$=(i?p+i*h:this.nextAudioPts)-j.pts;$>Q?(u=$-Z,u<0&&(u=Z),f.b.log("It is approximately "+$/90+" ms to the next segment; using duration "+u/90+" ms for the last video frame.")):u=Z}else u=Z}z=Math.round(j.pts-j.dts)}m.push({size:K,duration:u,cts:z,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:j.key?2:1,isNonSync:j.key?0:1}})}this.nextAvcDts=v+u;var tt=t.dropped;if(t.len=0,t.nbNalu=0,t.dropped=0,m.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var et=m[0].flags;et.dependsOn=2,et.isNonSync=0}t.samples=m,l=a.a.moof(t.sequenceNumber++,b,t),t.samples=[];var rt={data1:l,data2:d,startPTS:p/h,endPTS:(g+u)/h,startDTS:b/h,endDTS:this.nextAvcDts/h,type:"video",hasAudio:!1,hasVideo:!0,nb:m.length,dropped:tt};return this.observer.trigger(o.a.FRAG_PARSING_DATA,rt),rt}},t.prototype.remuxAudio=function(t,e,r,i){var c=t.inputTimeScale,h=t.timescale,u=c/h,d=t.isAAC?1024:1152,l=d*u,p=this._PTSNormalize,b=this._initDTS,g=!t.isAAC&&this.typeSupported.mpeg,v=void 0,y=void 0,m=void 0,_=void 0,w=void 0,S=void 0,E=void 0,A=t.samples,T=[],R=this.nextAudioPts;if(r|=A.length&&R&&(i&&Math.abs(e-R/c)<.1||Math.abs(A[0].pts-R-b)<20*l),A.forEach(function(t){t.pts=t.dts=p(t.pts-b,e*c)}),A=A.filter(function(t){return t.pts>=0}),0!==A.length){if(r||(R=i?e*c:A[0].pts),t.isAAC)for(var k=this.config.maxAudioFramesDrift,D=0,I=R;D=k*l&&O<1e4&&I){var C=Math.round(M/l);f.b.warn("Injecting "+C+" audio frame @ "+(I/c).toFixed(3)+"s due to "+Math.round(1e3*M/c)+" ms gap.");for(var P=0;P0&&K<1e4)z=Math.round((G-R)/l),f.b.log(K+" ms hole between AAC samples detected,filling it"),z>0&&(m=n.a.getSilentFrame(t.manifestCodec||t.codec,t.channelCount),m||(m=j.subarray()),t.len+=z*m.length);else if(K<-12){f.b.log("drop overlapping AAC sample, expected/parsed/delta:"+(R/c).toFixed(3)+"s/"+(G/c).toFixed(3)+"s/"+-K+"ms"),t.len-=j.byteLength;continue}G=R}if(S=G,!(t.len>0))return;var H=g?t.len:t.len+8;v=g?0:8;try{_=new Uint8Array(H)}catch(t){return void this.observer.trigger(o.a.ERROR,{type:s.b.MUX_ERROR,details:s.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:H,reason:"fail allocating audio mdat "+H})}if(!g){new DataView(_.buffer).setUint32(0,H),_.set(a.a.types.mdat,4)}for(var q=0;q=2&&(W=T[Y-2].duration,y.duration=W),Y){this.nextAudioPts=R=E+u*W,t.len=0,t.samples=T,w=g?new Uint8Array:a.a.moof(t.sequenceNumber++,S/u,t),t.samples=[];var X=S/c,Z=R/c,J={data1:w,data2:_,startPTS:X,endPTS:Z,startDTS:X,endDTS:Z,type:"audio",hasAudio:!0,hasVideo:!1,nb:Y};return this.observer.trigger(o.a.FRAG_PARSING_DATA,J),J}return null}},t.prototype.remuxEmptyAudio=function(t,e,r,i){var a=t.inputTimeScale,o=t.samplerate?t.samplerate:a,s=a/o,c=this.nextAudioPts,h=(void 0!==c?c:i.startDTS*a)+this._initDTS,u=i.endDTS*a+this._initDTS,d=1024*s,l=Math.ceil((u-h)/d),p=n.a.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(f.b.warn("remux empty Audio"),!p)return void f.b.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var b=[],g=0;g4294967296;)t+=r;return t},t}();e.a=c},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(){i(this,t)}return t.getSilentFrame=function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},t}();e.a=n},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=Math.pow(2,32)-1,a=function(){function t(){i(this,t)}return t.init=function(){t.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var e=void 0;for(e in t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);t.HDLR_TYPES={video:r,audio:i};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=a,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),f=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,f,o,s),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,n))},t.box=function(t){for(var e=Array.prototype.slice.call(arguments,1),r=8,i=e.length,n=i,a=void 0;i--;)r+=e[i].byteLength;for(a=new Uint8Array(r),a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=255&r,a.set(t,4),i=0,r=8;i>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,r,i){return t.box(t.types.moof,t.mfhd(e),t.traf(i,r))},t.moov=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(i))},t.mvhd=function(e,r){r*=e;var i=Math.floor(r/(n+1)),a=Math.floor(r%(n+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t.box(t.types.mvhd,o)},t.sdtp=function(e){var r=e.samples||[],i=new Uint8Array(4+r.length),n=void 0,a=void 0;for(a=0;a>>8&255),r.push(255&o),r=r.concat(Array.prototype.slice.call(a));for(n=0;n>>8&255),i.push(255&o),i=i.concat(Array.prototype.slice.call(a));var s=t.box(t.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|e.sps.length].concat(r).concat([e.pps.length]).concat(i))),f=e.width,c=e.height,h=e.pixelRatio[0],u=e.pixelRatio[1];return t.box(t.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,f>>8&255,255&f,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,255&h,u>>24,u>>16&255,u>>8&255,255&u])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var r=e.id,i=e.duration*e.timescale,a=e.width,o=e.height,s=Math.floor(i/(n+1)),f=Math.floor(i%(n+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,f>>24,f>>16&255,f>>8&255,255&f,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,o>>8&255,255&o,0,0]))},t.traf=function(e,r){var i=t.sdtp(e),a=e.id,o=Math.floor(r/(n+1)),s=Math.floor(r%(n+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),t.trun(e,i.length+16+20+8+16+8+8),i)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,r){var i=e.samples||[],n=i.length,a=12+16*n,o=new Uint8Array(a),s=void 0,f=void 0,c=void 0,h=void 0,u=void 0,d=void 0;for(r+=8+a,o.set([0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),s=0;s>>24&255,c>>>16&255,c>>>8&255,255&c,h>>>24&255,h>>>16&255,h>>>8&255,255&h,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,61440&u.degradPrio,15&u.degradPrio,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*s);return t.box(t.types.trun,o)},t.initSegment=function(e){t.types||t.init();var r=t.moov(e),i=void 0;return i=new Uint8Array(t.FTYP.byteLength+r.byteLength),i.set(t.FTYP),i.set(r,t.FTYP.byteLength),i},t}();e.a=a},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=r(5),a=function(){function t(e){i(this,t),this.observer=e}return t.prototype.destroy=function(){},t.prototype.resetTimeStamp=function(){},t.prototype.resetInitSegment=function(){},t.prototype.remux=function(t,e,r,i,a,o,s,f){var c=this.observer,h="";t&&(h+="audio"),e&&(h+="video"),c.trigger(n.a.FRAG_PARSING_DATA,{data1:f,startPTS:a,startDTS:a,type:h,hasAudio:!!t,hasVideo:!!e,nb:1,dropped:0}),c.trigger(n.a.FRAG_PARSED)},t}();e.a=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(102),n=r(5),a=r(2),o=r(20),s=r.n(o),f=function(t){var e=new s.a;e.trigger=function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),n=1;n1?r-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments[2],i=0;if(r.programDateTime){var n=Date.parse(r.programDateTime);isNaN(n)||(i=1e3*e+n-1e3*t)}return i}function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!Array.isArray(t)||!t.length||null===e)return null;if(e=t[t.length-1].endPdt)return null;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=void 0,f=t?e[t.sn-e[0].sn+1]:null;return ri-n&&(n=0),a=f&&!o(r,n,f)?f:s.a.search(e,o.bind(null,r,n))),a}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments[2],i=Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-i<=t?1:r.start-i>t&&r.start?-1:0}e.a=i,e.b=n,e.c=a,e.d=o;var s=r(39)},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(9),f=r(2),c=r(7),h=r(62),u=function(){function t(t,e){for(var r=0;r0){if(e.sort(function(t,e){return t.bitrate-e.bitrate}),this.hls&&this.hls.config&&this.hls.config.defaultBandwidth){var l=-1,p=0,b=0;for(l=0;lthis.hls.config.defaultBandwidth){0===p||Math.abs(b-this.hls.config.defaultBandwidth)0&&a})}else this.hls.trigger(o.a.ERROR,{type:c.b.MEDIA_ERROR,details:c.a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},e.prototype.setLevelInternal=function(t){var e=this._levels,r=this.hls;if(t>=0&&t1&&s.loadError0&&(e=t.urlId,this.hls.trigger(o.a.LEVEL_LOADING,{url:t.url[e],level:this.currentLevelIndex,id:e}))},u(e,[{key:"levels",get:function(){return this._levels},set:function(t){this._levels=t}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e=this._levels;e&&(t=Math.min(t,e.length-1),this.currentLevelIndex===t&&void 0!==e[t].details||this.setLevelInternal(t))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}]),e}(s.a);e.a=d},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(9),f=r(40),c=r(108),h=function(t){function e(r){i(this,e);var a=n(this,t.call(this,r,o.a.MEDIA_ATTACHED,o.a.MEDIA_DETACHING,o.a.FRAG_PARSING_METADATA));return a.id3Track=void 0,a.media=void 0,a}return a(e,t),e.prototype.destroy=function(){s.a.prototype.destroy.call(this)},e.prototype.onMediaAttached=function(t){this.media=t.media,this.media},e.prototype.onMediaDetaching=function(){Object(c.a)(this.id3Track),this.id3Track=void 0,this.media=void 0},e.prototype.getID3Track=function(t){for(var e=0;e500*r.duration/c){var u=t.levels,d=Math.max(1,a.bw?a.bw/8:1e3*a.loaded/s),l=u[r.level],p=l.realBitrate?Math.max(l.realBitrate,l.bitrate):l.bitrate,b=a.total?a.total:Math.max(a.loaded,Math.round(r.duration*p/8)),g=e.currentTime,v=(b-a.loaded)/d,y=(f.a.bufferInfo(e,g,t.config.maxBufferHole).end-g)/c;if(y<2*r.duration/c&&v>y){var m=void 0,_=void 0;for(_=r.level-1;_>i;_--){var w=u[_].realBitrate?Math.max(u[_].realBitrate,u[_].bitrate):u[_].bitrate;if((m=r.duration*w/(6.4*d))=i;c--){var u=f[c],d=u.details,l=d?d.totalduration/d.fragments.length:e,p=!!d&&d.live,b=void 0;b=c<=t?o*r:s*r;var g=f[c].realBitrate?Math.max(f[c].realBitrate,f[c].bitrate):f[c].bitrate,v=g*l/b;if(h.b.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+c+"/"+Math.round(b)+"/"+g+"/"+l+"/"+a+"/"+v),b>g&&(!v||p&&!this.bitrateTestDelay||vthis.hls.config.abrBandWidthUpCacheTime))return c}return-1},d(e,[{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,e=this._bwEstimator;if(!(-1===t||e&&e.canEstimate()))return t;var r=this._nextABRAutoLevel;return-1!==t&&(r=Math.min(t,r)),r},set:function(t){this._nextAutoLevel=t}},{key:"_nextABRAutoLevel",get:function(){var t=this.hls,e=t.maxAutoLevel,r=t.levels,i=t.config,n=t.minAutoLevel,a=t.media,o=this.lastLoadedFragLevel,s=this.fragCurrent?this.fragCurrent.duration:0,c=a?a.currentTime:0,u=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,d=this._bwEstimator?this._bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,l=(f.a.bufferInfo(a,c,i.maxBufferHole).end-c)/u,p=this._findBestLevel(o,s,d,n,e,l,i.abrBandWidthFactor,i.abrBandWidthUpFactor,r);if(p>=0)return p;h.b.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var b=s?Math.min(s,i.maxStarvationDelay):i.maxStarvationDelay,g=i.abrBandWidthFactor,v=i.abrBandWidthUpFactor;if(0===l){var y=this.bitrateTestDelay;if(y){b=(s?Math.min(s,i.maxLoadingDelay):i.maxLoadingDelay)-y,h.b.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*b)+" ms"),g=v=1}}return p=this._findBestLevel(o,s,d,n,e,l+b,g,v,r),Math.max(p,0)}}]),e}(s.a);e.a=l},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=r(267),a=function(){function t(e,r,a,o){i(this,t),this.hls=e,this.defaultEstimate_=o,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new n.a(r),this.fast_=new n.a(a)}return t.prototype.sample=function(t,e){t=Math.max(t,this.minDelayMs_);var r=8e3*e/t,i=t/1e3;this.fast_.sample(i,r),this.slow_.sample(i,r)},t.prototype.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},t.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.prototype.destroy=function(){},t}();e.a=a},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(e){i(this,t),this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=0,this.totalWeight_=0}return t.prototype.sample=function(t,e){var r=Math.pow(this.alpha_,t);this.estimate_=e*(1-r)+r*this.estimate_,this.totalWeight_+=t},t.prototype.getTotalWeight=function(){return this.totalWeight_},t.prototype.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/t}return this.estimate_},t}();e.a=n},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(9),f=r(2),c=r(7),h=r(57),u=Object(h.a)(),d=function(t){function e(r){i(this,e);var a=n(this,t.call(this,r,o.a.MEDIA_ATTACHING,o.a.MEDIA_DETACHING,o.a.MANIFEST_PARSED,o.a.BUFFER_RESET,o.a.BUFFER_APPENDING,o.a.BUFFER_CODECS,o.a.BUFFER_EOS,o.a.BUFFER_FLUSHING,o.a.LEVEL_PTS_UPDATED,o.a.LEVEL_UPDATED));return a._msDuration=null,a._levelDuration=null,a._live=null,a._objectUrl=null,a.onsbue=a.onSBUpdateEnd.bind(a),a.onsbe=a.onSBUpdateError.bind(a),a.pendingTracks={},a.tracks={},a}return a(e,t),e.prototype.destroy=function(){s.a.prototype.destroy.call(this)},e.prototype.onLevelPtsUpdated=function(t){var e=t.type,r=this.tracks.audio;if("audio"===e&&r&&"audio/mpeg"===r.container){var i=this.sourceBuffer.audio;if(Math.abs(i.timestampOffset-t.start)>.1){var n=i.updating;try{i.abort()}catch(t){n=!0,f.b.warn("can not abort audio buffer: "+t)}n?this.audioTimestampOffset=t.start:(f.b.warn("change mpeg audio timestamp offset from "+i.timestampOffset+" to "+t.start),i.timestampOffset=t.start)}}},e.prototype.onManifestParsed=function(t){var e=t.audio,r=t.video||t.levels.length&&t.altAudio,i=0;t.altAudio&&(e||r)&&(i=(e?1:0)+(r?1:0),f.b.log(i+" sourceBuffer(s) expected")),this.sourceBufferNb=i},e.prototype.onMediaAttaching=function(t){var e=this.media=t.media;if(e){var r=this.mediaSource=new u;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),e.src=URL.createObjectURL(r),this._objectUrl=e.src}},e.prototype.onMediaDetaching=function(){f.b.log("media source detaching");var t=this.mediaSource;if(t){if("open"===t.readyState)try{t.endOfStream()}catch(t){f.b.warn("onMediaDetaching:"+t.message+" while calling endOfStream")}t.removeEventListener("sourceopen",this.onmso),t.removeEventListener("sourceended",this.onmse),t.removeEventListener("sourceclose",this.onmsc),this.media&&(URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):f.b.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(o.a.MEDIA_DETACHED)},e.prototype.onMediaSourceOpen=function(){f.b.log("media source opened"),this.hls.trigger(o.a.MEDIA_ATTACHED,{media:this.media});var t=this.mediaSource;t&&t.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},e.prototype.checkPendingTracks=function(){var t=this.pendingTracks,e=Object.keys(t).length;e&&(this.sourceBufferNb<=e||0===this.sourceBufferNb)&&(this.createSourceBuffers(t),this.pendingTracks={},this.doAppending())},e.prototype.onMediaSourceClose=function(){f.b.log("media source closed")},e.prototype.onMediaSourceEnded=function(){f.b.log("media source ended")},e.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var t=this.sourceBuffer.audio;f.b.warn("change mpeg audio timestamp offset from "+t.timestampOffset+" to "+this.audioTimestampOffset),t.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var e=this.parent,r=this.segments.reduce(function(t,r){return r.parent===e?t+1:t},0),i={},n=this.sourceBuffer;for(var a in n)i[a]=n[a].buffered;this.hls.trigger(o.a.BUFFER_APPENDED,{parent:e,pending:r,timeRanges:i}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()},e.prototype.onSBUpdateError=function(t){f.b.error("sourceBuffer error:",t),this.hls.trigger(o.a.ERROR,{type:c.b.MEDIA_ERROR,details:c.a.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferReset=function(){var t=this.sourceBuffer;for(var e in t){var r=t[e];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(t){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},e.prototype.onBufferCodecs=function(t){if(0===Object.keys(this.sourceBuffer).length){for(var e in t)this.pendingTracks[e]=t[e];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}},e.prototype.createSourceBuffers=function(t){var e=this.sourceBuffer,r=this.mediaSource;for(var i in t)if(!e[i]){var n=t[i],a=n.levelCodec||n.codec,s=n.container+";codecs="+a;f.b.log("creating sourceBuffer("+s+")");try{var h=e[i]=r.addSourceBuffer(s);h.addEventListener("updateend",this.onsbue),h.addEventListener("error",this.onsbe),this.tracks[i]={codec:a,container:n.container},n.buffer=h}catch(t){f.b.error("error while trying to add sourceBuffer:"+t.message),this.hls.trigger(o.a.ERROR,{type:c.b.MEDIA_ERROR,details:c.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:t,mimeType:s})}}this.hls.trigger(o.a.BUFFER_CREATED,{tracks:t})},e.prototype.onBufferAppending=function(t){this._needsFlush||(this.segments?this.segments.push(t):this.segments=[t],this.doAppending())},e.prototype.onBufferAppendFail=function(t){f.b.error("sourceBuffer error:",t.event),this.hls.trigger(o.a.ERROR,{type:c.b.MEDIA_ERROR,details:c.a.BUFFER_APPENDING_ERROR,fatal:!1})},e.prototype.onBufferEos=function(t){var e=this.sourceBuffer,r=t.type;for(var i in e)r&&i!==r||e[i].ended||(e[i].ended=!0,f.b.log(i+" sourceBuffer now EOS"));this.checkEos()},e.prototype.checkEos=function(){var t=this.sourceBuffer,e=this.mediaSource;if(!e||"open"!==e.readyState)return void(this._needsEos=!1);for(var r in t){var i=t[r];if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}f.b.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{e.endOfStream()}catch(t){f.b.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},e.prototype.onBufferFlushing=function(t){this.flushRange&&(this.flushRange.push({start:t.startOffset,end:t.endOffset,type:t.type}),this.flushBufferCounter=0,this.doFlush())},e.prototype.onLevelUpdated=function(t){var e=t.details;e.fragments.length>0&&(this._levelDuration=e.totalduration+e.fragments[0].start,this._live=e.live,this.updateMediaElementDuration())},e.prototype.updateMediaElementDuration=function(){var t=this.hls.config,e=void 0;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var r in this.sourceBuffer)if(!0===this.sourceBuffer[r].updating)return;e=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&&!0===t.liveDurationInfinity?(f.b.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>e||e===1/0||isNaN(e))&&(f.b.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},e.prototype.doFlush=function(){for(;this.flushRange.length;){var t=this.flushRange[0];if(!this.flushBuffer(t.start,t.end,t.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var e=0,r=this.sourceBuffer;try{for(var i in r)e+=r[i].buffered.length}catch(t){f.b.error("error while accessing sourceBuffer.buffered")}this.appended=e,this.hls.trigger(o.a.BUFFER_FLUSHED)}},e.prototype.doAppending=function(){var t=this.hls,e=this.sourceBuffer,r=this.segments;if(Object.keys(e).length){if(this.media.error)return this.segments=[],void f.b.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(this.hls.media&&this.mediaSource.duration&&this.hls.config.hlsFrameChasing){var i=this.mediaSource.duration-this.hls.media.currentTime;i<=this.hls.config.chasingFirstParagraph?this.hls.media.playbackRate=1:i>=this.hls.config.chasingSecondParagraph?this.hls.media.playbackRate=this.hls.config.chasingSecondSpeed:this.hls.media.playbackRate=this.hls.config.chasingFirstSpeed}if(r&&r.length){var n=r.shift();try{var a=n.type,s=e[a];s?s.updating?r.unshift(n):(s.ended=!1,this.parent=n.parent,s.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(e){f.b.error("error while trying to append buffer:"+e.message),r.unshift(n);var h={type:c.b.MEDIA_ERROR,parent:n.parent};22!==e.code?(this.appendError?this.appendError++:this.appendError=1,h.details=c.a.BUFFER_APPEND_ERROR,this.appendError>t.config.appendErrorMaxRetry?(f.b.log("fail "+t.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],h.fatal=!0,t.trigger(o.a.ERROR,h)):(h.fatal=!1,t.trigger(o.a.ERROR,h))):(this.segments=[],h.details=c.a.BUFFER_FULL_ERROR,h.fatal=!1,t.trigger(o.a.ERROR,h))}}}},e.prototype.flushBuffer=function(t,e,r){var i=void 0,n=void 0,a=void 0,o=void 0,s=void 0,c=void 0,h=this.sourceBuffer;if(Object.keys(h).length){if(f.b.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+t+"/"+e),this.flushBufferCounter.5)return this.flushBufferCounter++,f.b.log("flush "+u+" ["+s+","+c+"], of ["+a+","+o+"], pos:"+this.media.currentTime),i.remove(s,c),!1}catch(t){f.b.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else f.b.warn("abort flushing too many retries");f.b.log("buffer flushed")}return!0},e}(s.a);e.a=d},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(9),f=function(){function t(t,e){for(var r=0;rthis.autoLevelCapping&&e.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},e.prototype.getMaxLevel=function(t){var r=this;if(!this.levels)return-1;var i=this.levels.filter(function(i,n){return e.isLevelAllowed(n,r.restrictedLevels)&&n<=t});return e.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},e.prototype._startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},e.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},e.isLevelAllowed=function(t){return-1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).indexOf(t)},e.getMaxLevelByMediaSize=function(t,e,r){if(!t||t&&!t.length)return-1;for(var i=t.length-1,n=0;n=e||a.height>=r)&&function(t,e){return!e||(t.width!==e.width||t.height!==e.height)}(a,t[n+1])){i=n;break}}return i},f(e,[{key:"mediaWidth",get:function(){var t=void 0,r=this.media;return r&&(t=r.width||r.clientWidth||r.offsetWidth,t*=e.contentScaleFactor),t}},{key:"mediaHeight",get:function(){var t=void 0,r=this.media;return r&&(t=r.height||r.clientHeight||r.offsetHeight,t*=e.contentScaleFactor),t}}],[{key:"contentScaleFactor",get:function(){var t=1;try{t=window.devicePixelRatio}catch(t){}return t}}]),e}(s.a);e.a=c},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(9),f=r(2),c=function(t){function e(r){return i(this,e),n(this,t.call(this,r,o.a.MEDIA_ATTACHING))}return a(e,t),e.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},e.prototype.onMediaAttaching=function(t){var e=this.hls.config;if(e.capLevelOnFPSDrop){"function"==typeof(this.video=t.media instanceof HTMLVideoElement?t.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),e.fpsDroppedMonitoringPeriod)}},e.prototype.checkFPS=function(t,e,r){var i=performance.now();if(e){if(this.lastTime){var n=i-this.lastTime,a=r-this.lastDroppedFrames,s=e-this.lastDecodedFrames,c=1e3*a/n,h=this.hls;if(h.trigger(o.a.FPS_DROP,{currentDropped:a,currentDecoded:s,totalDroppedFrames:r}),c>0&&a>h.config.fpsDroppedMonitoringThreshold*s){var u=h.currentLevel;f.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(-1===h.autoLevelCapping||h.autoLevelCapping>=u)&&(u-=1,h.trigger(o.a.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:h.currentLevel}),h.autoLevelCapping=u,h.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=e}},e.prototype.checkFPSInterval=function(){var t=this.video;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},e}(s.a);e.a=c},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=r(2),a=function(){function t(e){i(this,t),e&&e.xhrSetup&&(this.xhrSetup=e.xhrSetup)}return t.prototype.destroy=function(){this.abort(),this.loader=null},t.prototype.abort=function(){var t=this.loader;t&&4!==t.readyState&&(this.stats.aborted=!0,t.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},t.prototype.load=function(t,e,r){this.context=t,this.config=e,this.callbacks=r,this.retryDelay=e.retryDelay,this.reload()},t.prototype.reload=function(){this.stats={trequest:performance.now(),retry:0},this.loadInternal()},t.prototype.loadInternal=function(){var t=void 0,e=this.context;t=this.loader=new XMLHttpRequest;var r=this.stats;r.tfirst=0,r.loaded=0;var i=this.xhrSetup;try{if(i)try{i(t,e.url)}catch(r){t.open("GET",e.url,!0),i(t,e.url)}t.readyState||t.open("GET",e.url,!0)}catch(r){return void this.callbacks.onError({code:t.status,text:r.message},e,t)}e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),t.send()},t.prototype.readystatechange=function(t){var e=t.currentTarget,r=e.readyState,i=this.stats,a=this.context,o=this.config;if(!i.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===i.tfirst&&(i.tfirst=Math.max(performance.now(),i.trequest)),4===r){var s=e.status;if(s>=200&&s<300){i.tload=Math.max(i.tfirst,performance.now());var f=void 0,c=void 0;"arraybuffer"===a.responseType?(f=e.response,c=f.byteLength):(f=e.responseText,c=f.length),i.loaded=i.total=c;var h={url:e.responseURL,data:f};this.callbacks.onSuccess(h,i,a,e)}else i.retry>=o.maxRetry||s>=400&&s<499?(n.b.error(s+" while loading "+a.url),this.callbacks.onError({code:s,text:e.statusText},a,e)):(n.b.warn(s+" while loading "+a.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),i.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),o.timeout)},t.prototype.loadtimeout=function(){n.b.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},t.prototype.loadprogress=function(t){var e=t.currentTarget,r=this.stats;r.loaded=t.loaded,t.lengthComputable&&(r.total=t.total);var i=this.callbacks.onProgress;i&&i(r,this.context,null,e)},t}();e.a=a},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(9),f=r(2),c=r(7),h=function(){function t(t,e){for(var r=0;r1&&setTimeout(this.tick,1),this.ticks=0)},e.prototype.doTick=function(){this.updateTrack(this.trackId)},e.prototype.onError=function(t){t.fatal&&t.type===c.b.NETWORK_ERROR&&this.cleanTimer()},e.prototype.onManifestLoading=function(){this.tracks=[],this.trackId=-1},e.prototype.onManifestParsed=function(t){var e=this,r=t.audioTracks||[],i=!1;this.tracks=r,this.hls.trigger(o.a.AUDIO_TRACKS_UPDATED,{audioTracks:r});var n=0;r.forEach(function(t){if(t.default&&!i)return e.audioTrack=n,void(i=!0);n++}),!1===i&&r.length&&(f.b.log("no default audio track defined, use first audio track as default"),this.audioTrack=0)},e.prototype.onAudioTrackLoaded=function(t){t.id=0&&t=0&&t0&&-1===t?(l.b.log("audio:override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=m.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:t,this.state=m.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=t,this.state=m.STOPPED},e.prototype.stopLoad=function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragmentTracker.removeFragment(t),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=m.STOPPED},e.prototype.doTick=function(){var t=void 0,e=void 0,r=void 0,i=this.hls,n=i.config;switch(this.state){case m.ERROR:case m.PAUSED:case m.BUFFER_FLUSHING:break;case m.STARTING:this.state=m.WAITING_TRACK,this.loadedmetadata=!1;break;case m.IDLE:var a=this.tracks;if(!a)break;if(!this.media&&(this.startFragRequested||!n.startFragPrefetch))break;if(this.loadedmetadata)t=this.media.currentTime;else if(void 0===(t=this.nextLoadPosition))break;var f=this.mediaBuffer?this.mediaBuffer:this.media,h=this.videoBuffer?this.videoBuffer:this.media,u=s.a.bufferInfo(f,t,n.maxBufferHole),d=s.a.bufferInfo(h,t,n.maxBufferHole),b=u.len,v=u.end,y=this.fragPrevious,_=Math.min(n.maxBufferLength,n.maxMaxBufferLength),w=Math.max(_,d.len),S=this.audioSwitch,E=this.trackId;if((bR||u.nextStart))return;l.b.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=R+.05}if(r.initSegment&&!r.initSegment.data)D=r.initSegment;else if(v<=R){if(D=A[0],null!==this.videoTrackCC&&D.cc!==this.videoTrackCC&&(D=Object(p.b)(A,this.videoTrackCC)),r.live&&D.loadIdx&&D.loadIdx===this.fragLoadIdx){var I=u.nextStart?u.nextStart:R;return l.b.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(I+.05)),void(this.media.currentTime=I+.05)}}else{var M=void 0,x=n.maxFragLookUpTolerance,L=y?A[y.sn-A[0].sn+1]:void 0,O=function(t){var e=Math.min(x,t.duration);return t.start+t.duration-e<=v?1:t.start-e>v&&t.start?-1:0};vk-x&&(x=0),M=L&&!O(L)?L:o.a.search(A,O)):M=A[T-1],M&&(D=M,R=M.start,y&&D.level===y.level&&D.sn===y.sn&&(D.sn=P||B)&&(l.b.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=m.IDLE);break;case m.WAITING_INIT_PTS:var N=this.videoTrackCC;if(void 0===this.initPTS[N])break;var F=this.waitingFragment;if(F){var U=F.frag.cc;N!==U?(e=this.tracks[this.trackId],e.details&&e.details.live&&(l.b.warn("Waiting fragment CC ("+U+") does not match video track CC ("+N+")"),this.waitingFragment=null,this.state=m.IDLE)):(this.state=m.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=m.IDLE;break;case m.STOPPED:case m.FRAG_LOADING:case m.PARSING:case m.PARSED:case m.ENDED:}},e.prototype.onMediaAttached=function(t){var e=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("ended",this.onvended);var r=this.config;this.tracks&&r.autoStartLoad&&this.startLoad(r.startPosition)},e.prototype.onMediaDetaching=function(){var t=this.media;t&&t.ended&&(l.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},e.prototype.onMediaSeeking=function(){this.state===m.ENDED&&(this.state=m.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),this.tick()},e.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},e.prototype.onAudioTracksUpdated=function(t){l.b.log("audio tracks updated"),this.tracks=t.audioTracks},e.prototype.onAudioTrackSwitching=function(t){var e=!!t.url;this.trackId=t.id,this.fragCurrent=null,this.state=m.PAUSED,this.waitingFragment=null,e?this.setInterval(100):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),e&&(this.audioSwitch=!0,this.state=m.IDLE),this.tick()},e.prototype.onAudioTrackLoaded=function(t){var e=t.details,r=t.id,i=this.tracks[r],n=e.totalduration,a=0;if(l.b.log("track "+r+" loaded ["+e.startSN+","+e.endSN+"],duration:"+n),e.live){var o=i.details;o&&e.fragments.length>0?(h.a(o,e),a=e.fragments[0].start,e.PTSKnown?l.b.log("live audio playlist sliding:"+a.toFixed(3)):l.b.log("live audio playlist - outdated PTS, unknown sliding")):(e.PTSKnown=!1,l.b.log("live audio playlist - first load, unknown sliding"))}else e.PTSKnown=!1;if(i.details=e,!this.startFragRequested){if(-1===this.startPosition){var s=e.startTimeOffset;isNaN(s)?this.startPosition=0:(l.b.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s)}this.nextLoadPosition=this.startPosition}this.state===m.WAITING_TRACK&&(this.state=m.IDLE),this.tick()},e.prototype.onKeyLoaded=function(){this.state===m.KEY_LOADING&&(this.state=m.IDLE,this.tick())},e.prototype.onFragLoaded=function(t){var e=this.fragCurrent,r=t.frag;if(this.state===m.FRAG_LOADING&&e&&"audio"===r.type&&r.level===e.level&&r.sn===e.sn){var i=this.tracks[this.trackId],n=i.details,a=n.totalduration,o=e.level,s=e.sn,h=e.cc,u=this.config.defaultAudioCodec||i.audioCodec||"mp4a.40.2",d=this.stats=t.stats;if("initSegment"===s)this.state=m.IDLE,d.tparsed=d.tbuffered=performance.now(),n.initSegment.data=t.payload,this.hls.trigger(c.a.FRAG_BUFFERED,{stats:d,frag:e,id:"audio"}),this.tick();else{this.state=m.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new f.a(this.hls,"audio"));var p=this.initPTS[h],b=n.initSegment?n.initSegment.data:[];if(n.initSegment||void 0!==p){this.pendingBuffering=!0,l.b.log("Demuxing "+s+" of ["+n.startSN+" ,"+n.endSN+"],track "+o);this.demuxer.push(t.payload,b,u,null,e,a,!1,p)}else l.b.log("unknown video PTS for continuity counter "+h+", waiting for video PTS before demuxing audio frag "+s+" of ["+n.startSN+" ,"+n.endSN+"],track "+o),this.waitingFragment=t,this.state=m.WAITING_INIT_PTS}}this.fragLoadError=0},e.prototype.onFragParsingInitSegment=function(t){var e=this.fragCurrent,r=t.frag;if(e&&"audio"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===m.PARSING){var i=t.tracks,n=void 0;if(i.video&&delete i.video,n=i.audio){n.levelCodec=n.codec,n.id=t.id,this.hls.trigger(c.a.BUFFER_CODECS,i),l.b.log("audio track:audio,container:"+n.container+",codecs[level/parsed]=["+n.levelCodec+"/"+n.codec+"]");var a=n.initSegment;if(a){var o={type:"audio",data:a,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[o]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(c.a.BUFFER_APPENDING,o))}this.tick()}}},e.prototype.onFragParsingData=function(t){var e=this,r=this.fragCurrent,i=t.frag;if(r&&"audio"===t.id&&"audio"===t.type&&i.sn===r.sn&&i.level===r.level&&this.state===m.PARSING){var n=this.trackId,a=this.tracks[n],o=this.hls;isNaN(t.endPTS)&&(t.endPTS=t.startPTS+r.duration,t.endDTS=t.startDTS+r.duration),r.addElementaryStream(v.a.ElementaryStreamTypes.AUDIO),l.b.log("parsed "+t.type+",PTS:["+t.startPTS.toFixed(3)+","+t.endPTS.toFixed(3)+"],DTS:["+t.startDTS.toFixed(3)+"/"+t.endDTS.toFixed(3)+"],nb:"+t.nb),h.b(a.details,r,t.startPTS,t.endPTS);var s=this.audioSwitch,f=this.media,u=!1;if(s&&f)if(f.readyState){var p=f.currentTime;l.b.log("switching audio track : currentTime:"+p),p>=t.startPTS&&(l.b.log("switching audio track : flushing all audio"),this.state=m.BUFFER_FLUSHING,o.trigger(c.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),u=!0,this.audioSwitch=!1,o.trigger(c.a.AUDIO_TRACK_SWITCHED,{id:n}))}else this.audioSwitch=!1,o.trigger(c.a.AUDIO_TRACK_SWITCHED,{id:n});var b=this.pendingData;if(!b)return console.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),void o.trigger(c.a.ERROR,{type:d.b.MEDIA_ERROR,details:null,fatal:!0});this.audioSwitch||([t.data1,t.data2].forEach(function(e){e&&e.length&&b.push({type:t.type,data:e,parent:"audio",content:"data"})}),!u&&b.length&&(b.forEach(function(t){e.state===m.PARSING&&(e.pendingBuffering=!0,e.hls.trigger(c.a.BUFFER_APPENDING,t))}),this.pendingData=[],this.appended=!0)),this.tick()}},e.prototype.onFragParsed=function(t){var e=this.fragCurrent,r=t.frag;e&&"audio"===t.id&&r.sn===e.sn&&r.level===e.level&&this.state===m.PARSING&&(this.stats.tparsed=performance.now(),this.state=m.PARSED,this._checkAppendedParsed())},e.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},e.prototype.onBufferCreated=function(t){var e=t.tracks.audio;e&&(this.mediaBuffer=e.buffer,this.loadedmetadata=!0),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},e.prototype.onBufferAppended=function(t){if("audio"===t.parent){var e=this.state;e!==m.PARSING&&e!==m.PARSED||(this.pendingBuffering=t.pending>0,this._checkAppendedParsed())}},e.prototype._checkAppendedParsed=function(){if(!(this.state!==m.PARSED||this.appended&&this.pendingBuffering)){var t=this.fragCurrent,e=this.stats,r=this.hls;if(t){this.fragPrevious=t,e.tbuffered=performance.now(),r.trigger(c.a.FRAG_BUFFERED,{stats:e,frag:t,id:"audio"});var i=this.mediaBuffer?this.mediaBuffer:this.media;l.b.log("audio buffered : "+u.a.toString(i.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,r.trigger(c.a.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=m.IDLE}this.tick()}},e.prototype.onError=function(t){var e=t.frag;if(!e||"audio"===e.type)switch(t.details){case d.a.FRAG_LOAD_ERROR:case d.a.FRAG_LOAD_TIMEOUT:if(!t.fatal){var r=this.fragLoadError;r?r++:r=1;var i=this.config;if(r<=i.fragLoadingMaxRetry){this.fragLoadError=r;var n=Math.min(Math.pow(2,r-1)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);l.b.warn("audioStreamController: frag loading failed, retry in "+n+" ms"),this.retryDate=performance.now()+n,this.state=m.FRAG_LOADING_WAITING_RETRY}else l.b.error("audioStreamController: "+t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.state=m.ERROR}break;case d.a.AUDIO_TRACK_LOAD_ERROR:case d.a.AUDIO_TRACK_LOAD_TIMEOUT:case d.a.KEY_LOAD_ERROR:case d.a.KEY_LOAD_TIMEOUT:this.state!==m.ERROR&&(this.state=t.fatal?m.ERROR:m.IDLE,l.b.warn("audioStreamController: "+t.details+" while loading frag,switch to "+this.state+" state ..."));break;case d.a.BUFFER_FULL_ERROR:if("audio"===t.parent&&(this.state===m.PARSING||this.state===m.PARSED)){var a=this.mediaBuffer,o=this.media.currentTime;if(a&&s.a.isBuffered(a,o)&&s.a.isBuffered(a,o+.5)){var f=this.config;f.maxMaxBufferLength>=f.maxBufferLength&&(f.maxMaxBufferLength/=2,l.b.warn("audio:reduce max buffer length to "+f.maxMaxBufferLength+"s")),this.state=m.IDLE}else l.b.warn("buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=m.BUFFER_FLUSHING,this.hls.trigger(c.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}},e.prototype.onBufferFlushed=function(){var t=this,e=this.pendingData;e&&e.length?(l.b.log("appending pending audio data on Buffer Flushed"),e.forEach(function(e){t.hls.trigger(c.a.BUFFER_APPENDING,e)}),this.appended=!0,this.pendingData=[],this.state=m.PARSED):(this.state=m.IDLE,this.fragPrevious=null,this.tick())},y(e,[{key:"state",set:function(t){if(this.state!==t){var e=this.state;this._state=t,l.b.log("audio stream:"+e+"->"+t)}},get:function(){return this._state}}]),e}(b.a);e.a=_},function(t,e,r){"use strict";function i(t,e,r,i){for(var a=void 0,o=void 0,s=void 0,f=void 0,c=void 0,h=window.VTTCue||window.TextTrackCue,u=0;u=16?f--:f++,navigator.userAgent.match(/Firefox\//)?o.line=u+1:o.line=u>7?u-2:u+1,o.align="left",o.position=Math.max(0,Math.min(100,f/32*100+(navigator.userAgent.match(/Firefox\//)?50:0))),t.addCue(o)}}Object.defineProperty(e,"__esModule",{value:!0}),e.newCue=i;var n=r(109)},function(t,e,r){"use strict";e.a=function(){function t(t){return"string"==typeof t&&(!!a[t.toLowerCase()]&&t.toLowerCase())}function e(t){return"string"==typeof t&&(!!o[t.toLowerCase()]&&t.toLowerCase())}function r(t){for(var e=1;e100)throw new Error("Position must be between 0 and 100.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",r({},c,{get:function(){return w},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");w=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",r({},c,{get:function(){return S},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");S=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",r({},c,{get:function(){return E},set:function(t){var r=e(t);if(!r)throw new SyntaxError("An invalid or illegal string was specified.");E=r,this.hasBeenReset=!0}})),s.displayState=void 0,f)return s}if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var n="auto",a={"":!0,lr:!0,rl:!0},o={start:!0,middle:!0,end:!0,left:!0,right:!0};return i.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},i}()},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}function s(t,e,r,i){return Math.min(e,i)-Math.max(t,r)}var f=r(5),c=r(9),h=r(277),u=r(278),d=r(279),l=r(2),p=r(108),b=function(t){function e(r){i(this,e);var a=n(this,t.call(this,r,f.a.MEDIA_ATTACHING,f.a.MEDIA_DETACHING,f.a.FRAG_PARSING_USERDATA,f.a.FRAG_DECRYPTED,f.a.MANIFEST_LOADING,f.a.MANIFEST_LOADED,f.a.FRAG_LOADED,f.a.LEVEL_SWITCHING,f.a.INIT_PTS_FOUND));if(a.hls=r,a.config=r.config,a.enabled=!0,a.Cues=r.config.cueHandler,a.textTracks=[],a.tracks=[],a.unparsedVttFrags=[],a.initPTS=void 0,a.cueRanges=[],a.captionsTracks={},a.captionsProperties={textTrack1:{label:a.config.captionsTextTrack1Label,languageCode:a.config.captionsTextTrack1LanguageCode},textTrack2:{label:a.config.captionsTextTrack2Label,languageCode:a.config.captionsTextTrack2LanguageCode}},a.config.enableCEA708Captions){var o=new u.a(a,"textTrack1"),s=new u.a(a,"textTrack2");a.cea608Parser=new h.a(0,o,s)}return a}return a(e,t),e.prototype.addCues=function(t,e,r,i){for(var n=this.cueRanges,a=!1,o=n.length;o--;){var f=n[o],c=s(f[0],f[1],e,r);if(c>=0&&(f[0]=Math.min(f[0],e),f[1]=Math.max(f[1],r),a=!0,c/(r-e)>.5))return}a||n.push([e,r]),this.Cues.newCue(this.captionsTracks[t],e,r,i)},e.prototype.onInitPtsFound=function(t){var e=this;void 0===this.initPTS&&(this.initPTS=t.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEach(function(t){e.onFragLoaded(t)}),this.unparsedVttFrags=[])},e.prototype.getExistingTrack=function(t){var e=this.media;if(e)for(var r=0;r=r&&console.log(this.time+" ["+t+"] "+e)}},p=function(t){for(var e=[],r=0;rs&&(l.log("ERROR","Too large cursor position "+this.pos),this.pos=s)},t.prototype.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var r=this.pos+1;r=144&&this.backSpace();var e=a(t);if(this.pos>=s)return void l.log("ERROR","Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!");this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1)},t.prototype.clearFromPos=function(t){var e=void 0;for(e=t;e0&&(r=t?"["+e.join(" | ")+"]":e.join("\n")),r},t.prototype.getTextAndFormat=function(){return this.rows},t}(),m=function(){function t(e,r){i(this,t),this.chNr=e,this.outputFilter=r,this.mode=null,this.verbose=0,this.displayedMemory=new y,this.nonDisplayedMemory=new y,this.lastOutputScreen=new y,this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return t.prototype.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},t.prototype.getHandler=function(){return this.outputFilter},t.prototype.setHandler=function(t){this.outputFilter=t},t.prototype.setPAC=function(t){this.writeScreen.setPAC(t)},t.prototype.setBkgData=function(t){this.writeScreen.setBkgData(t)},t.prototype.setMode=function(t){t!==this.mode&&(this.mode=t,l.log("INFO","MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},t.prototype.insertChars=function(t){for(var e=0;e=46,e.italics)e.foreground="white";else{var r=Math.floor(t/2)-16,i=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=i[r]}l.log("INFO","MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},t.prototype.outputDataUpdate=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=l.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),!0===t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue()),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},t.prototype.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}(),_=function(){function t(e,r,n){i(this,t),this.field=e||1,this.outputs=[r,n],this.channels=[new m(1,r),new m(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return t.prototype.getHandler=function(t){return this.channels[t].getHandler()},t.prototype.setHandler=function(t,e){this.channels[t].setHandler(e)},t.prototype.addData=function(t,e){var r=void 0,i=void 0,n=void 0,a=!1;this.lastTime=t,l.setTime(t);for(var o=0;o ("+p([i,n])+")"),r=this.parseCmd(i,n),r||(r=this.parseMidrow(i,n)),r||(r=this.parsePAC(i,n)),r||(r=this.parseBackgroundAttributes(i,n)),!r&&(a=this.parseChars(i,n)))if(this.currChNr&&this.currChNr>=0){var s=this.channels[this.currChNr-1];s.insertChars(a)}else l.log("WARNING","No channel found yet. TEXT-MODE?");r?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,l.log("WARNING","Couldn't parse cleaned data "+p([i,n])+" orig: "+p([e[o],e[o+1]])))}else this.dataCounters.padding+=2},t.prototype.parseCmd=function(t,e){var r=null,i=(20===t||28===t)&&e>=32&&e<=47,n=(23===t||31===t)&&e>=33&&e<=35;if(!i&&!n)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,l.log("DEBUG","Repeated command ("+p([t,e])+") is dropped"),!0;r=20===t||23===t?1:2;var a=this.channels[r-1];return 20===t||28===t?32===e?a.ccRCL():33===e?a.ccBS():34===e?a.ccAOF():35===e?a.ccAON():36===e?a.ccDER():37===e?a.ccRU(2):38===e?a.ccRU(3):39===e?a.ccRU(4):40===e?a.ccFON():41===e?a.ccRDC():42===e?a.ccTR():43===e?a.ccRTD():44===e?a.ccEDM():45===e?a.ccCR():46===e?a.ccENM():47===e&&a.ccEOC():a.ccTO(e-32),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=r,!0},t.prototype.parseMidrow=function(t,e){var r=null;if((17===t||25===t)&&e>=32&&e<=47){if((r=17===t?1:2)!==this.currChNr)return l.log("ERROR","Mismatch channel in midrow parsing"),!1;return this.channels[r-1].ccMIDROW(e),l.log("DEBUG","MIDROW ("+p([t,e])+")"),!0}return!1},t.prototype.parsePAC=function(t,e){var r=null,i=null,n=(t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127,a=(16===t||24===t)&&e>=64&&e<=95;if(!n&&!a)return!1;if(t===this.lastCmdA&&e===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=t<=23?1:2,i=e>=64&&e<=95?1===r?f[t]:h[t]:1===r?c[t]:u[t];var o=this.interpretPAC(i,e);return this.channels[r-1].setPAC(o),this.lastCmdA=t,this.lastCmdB=e,this.currChNr=r,!0},t.prototype.interpretPAC=function(t,e){var r=e,i={color:null,italics:!1,indent:null,underline:!1,row:t};return r=e>95?e-96:e-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i},t.prototype.parseChars=function(t,e){var r=null,i=null,n=null;if(t>=25?(r=2,n=t-8):(r=1,n=t),n>=17&&n<=19){var o=e;o=17===n?e+80:18===n?e+112:e+144,l.log("INFO","Special char '"+a(o)+"' in channel "+r),i=[o]}else t>=32&&t<=127&&(i=0===e?[t]:[t,e]);if(i){var s=p(i);l.log("DEBUG","Char codes = "+s.join(",")),this.lastCmdA=null,this.lastCmdB=null}return i},t.prototype.parseBackgroundAttributes=function(t,e){var r=void 0,i=void 0,n=void 0,a=void 0,o=(16===t||24===t)&&e>=32&&e<=47,s=(23===t||31===t)&&e>=45&&e<=47;return!(!o&&!s)&&(r={},16===t||24===t?(i=Math.floor((e-32)/2),r.background=d[i],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0)),n=t<24?1:2,a=this.channels[n-1],a.setBkgData(r),this.lastCmdA=null,this.lastCmdB=null,!0)},t.prototype.reset=function(){for(var t=0;tt)&&(this.startTime=t),this.endTime=e,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},t}();e.a=n},function(t,e,r){"use strict";var i=r(109),n=r(40),a=function(t,e,r){return t.substr(r||0,e.length)===e},o=function(t){var e=parseInt(t.substr(-3)),r=parseInt(t.substr(-6,2)),i=parseInt(t.substr(-9,2)),n=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;return isNaN(e)||isNaN(r)||isNaN(i)||isNaN(n)?-1:(e+=1e3*r,e+=6e4*i,e+=36e5*n)},s=function(t){for(var e=5381,r=t.length;r;)e=33*e^t.charCodeAt(--r);return(e>>>0).toString()},f=function(t,e,r){var i=t[e],n=t[i.prevCC];if(!n||!n.new&&i.new)return t.ccOffset=t.presentationOffset=i.start,void(i.new=!1);for(;n&&n.new;)t.ccOffset+=i.start-n.start,i.new=!1,i=n,n=t[i.prevCC];t.presentationOffset=r},c={parse:function(t,e,r,c,h,u){var d=/\r\n|\n\r|\n|\r/g,l=Object(n.b)(new Uint8Array(t)).trim().replace(d,"\n").split("\n"),p="00:00.000",b=0,g=0,v=0,y=[],m=void 0,_=!0,w=new i.a;w.oncue=function(t){var e=r[c],i=r.ccOffset;e&&e.new&&(void 0!==g?i=r.ccOffset=e.start:f(r,c,v)),v&&(i=v+r.ccOffset-r.presentationOffset),t.startTime+=i-g-.5,t.endTime+=i-g-.5,t.id=s(t.startTime.toString())+s(t.endTime.toString())+s(t.text),t.text=decodeURIComponent(encodeURIComponent(t.text)),t.endTime>0&&y.push(t)},w.onparsingerror=function(t){m=t},w.onflush=function(){if(m&&u)return void u(m);h(y)},l.forEach(function(t){if(_){if(a(t,"X-TIMESTAMP-MAP=")){_=!1,t.substr(16).split(",").forEach(function(t){a(t,"LOCAL:")?p=t.substr(6):a(t,"MPEGTS:")&&(b=parseInt(t.substr(7)))});try{e=e<0?e+8589934592:e,b-=e,g=o(p)/1e3,v=b/9e4,-1===g&&(m=new Error("Malformed X-TIMESTAMP-MAP: "+t))}catch(e){m=new Error("Malformed X-TIMESTAMP-MAP: "+t)}return}""===t&&(e>0&&(g=e/9e4),_=!1)}w.parse(t+"\n")}),w.flush()}};e.a=c},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t){for(var e=[],r=0;r=r.length)&&(this._stopTimer(),this.trackId=t,c.b.log("switching to subtitle track "+t),e.trigger(s.a.SUBTITLE_TRACK_SWITCH,{id:t}),-1!==t)){var i=r[t],n=i.details;n&&!n.live||(c.b.log("(re)loading playlist for subtitle track "+t),e.trigger(s.a.SUBTITLE_TRACK_LOADING,{url:i.url,id:t}))}},e.prototype._stopTimer=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},e.prototype._toggleTrackModes=function(t){var e=this.media,r=this.subtitleDisplay,i=this.trackId;if(e){var n=o(e.textTracks);if(-1===t)[].slice.call(n).forEach(function(t){t.mode="disabled"});else{var a=n[i];a&&(a.mode="disabled")}var s=n[t];s&&(s.mode=r?"showing":"hidden")}},h(e,[{key:"subtitleTracks",get:function(){return this.tracks}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.trackId!==t&&(this._toggleTrackModes(t),this.setSubtitleTrackInternal(t))}}]),e}(f.a);e.a=u},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(5),s=r(2),f=r(56),c=r(58),h={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING"},u=function(t){function e(r){i(this,e);var a=n(this,t.call(this,r,o.a.MEDIA_ATTACHED,o.a.ERROR,o.a.KEY_LOADED,o.a.FRAG_LOADED,o.a.SUBTITLE_TRACKS_UPDATED,o.a.SUBTITLE_TRACK_SWITCH,o.a.SUBTITLE_TRACK_LOADED,o.a.SUBTITLE_FRAG_PROCESSED));return a.config=r.config,a.vttFragSNsProcessed={},a.vttFragQueues=void 0,a.currentlyProcessing=null,a.state=h.STOPPED,a.currentTrackId=-1,a.decrypter=new f.a(r.observer,r.config),a}return a(e,t),e.prototype.onHandlerDestroyed=function(){this.state=h.STOPPED},e.prototype.clearVttFragQueues=function(){var t=this;this.vttFragQueues={},this.tracks.forEach(function(e){t.vttFragQueues[e.id]=[]})},e.prototype.nextFrag=function(){if(null===this.currentlyProcessing&&this.currentTrackId>-1&&this.vttFragQueues[this.currentTrackId].length){var t=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.fragCurrent=t,this.hls.trigger(o.a.FRAG_LOADING,{frag:t}),this.state=h.FRAG_LOADING}},e.prototype.onSubtitleFragProcessed=function(t){t.success&&this.vttFragSNsProcessed[t.frag.trackId].push(t.frag.sn),this.currentlyProcessing=null,this.state=h.IDLE,this.nextFrag()},e.prototype.onMediaAttached=function(){this.state=h.IDLE},e.prototype.onError=function(t){var e=t.frag;e&&"subtitle"!==e.type||this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())},e.prototype.doTick=function(){var t=this;switch(this.state){case h.IDLE:var e=this.tracks,r=this.currentTrackId,i=this.vttFragSNsProcessed[r],n=this.vttFragQueues[r],a=this.currentlyProcessing?this.currentlyProcessing.sn:-1,f=function(t){return i.indexOf(t.sn)>-1},c=function(t){return n.some(function(e){return e.sn===t.sn})};if(!e)break;var u;if(r0&&null!=r&&null!=r.key&&"AES-128"===r.method){var a=void 0;try{a=performance.now()}catch(t){a=Date.now()}this.decrypter.decrypt(t.payload,r.key.buffer,r.iv.buffer,function(t){var e=void 0;try{e=performance.now()}catch(t){e=Date.now()}n.trigger(o.a.FRAG_DECRYPTED,{frag:i,payload:t,stats:{tstart:a,tdecrypt:e}})})}},e}(c.a);e.a=u},function(t,e,r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o=r(9),s=r(5),f=r(7),c=r(2),h=function(){function t(t,e){for(var r=0;r1){var s=arguments[1];void 0!==s&&(o=s?Number(s):0)!=o&&(o=0)}var f=Math.min(Math.max(o,0),i),c=f-a;if(c<0)return!1;for(var h=-1;++h