text: !function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=45)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(4),n=r(30);t.UINT8={len:1,get:(e,t)=>e.readUInt8(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=0&&r<=255),a.ok(t>=0),a.ok(this.len<=e.length),e.writeUInt8(r,t)}},t.UINT16_LE={len:2,get:(e,t)=>e.readUInt16LE(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=0&&r<=65535),a.ok(t>=0),a.ok(this.len<=e.length),e.writeUInt16LE(r,t)}},t.UINT16_BE={len:2,get:(e,t)=>e.readUInt16BE(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=0&&r<=65535),a.ok(t>=0),a.ok(this.len<=e.length),e.writeUInt16BE(r,t)}},t.UINT24_LE={len:3,get:(e,t)=>e.readUIntLE(t,3),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=0&&r<=16777215),a.ok(t>=0),a.ok(this.len<=e.length),e.writeUIntLE(r,t,3)}},t.UINT24_BE={len:3,get:(e,t)=>e.readUIntBE(t,3),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=0&&r<=16777215),a.ok(t>=0),a.ok(this.len<=e.length),e.writeUIntBE(r,t,3)}},t.UINT32_LE={len:4,get:(e,t)=>e.readUInt32LE(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=0&&r<=4294967295),a.ok(t>=0),a.ok(this.len<=e.length),e.writeUInt32LE(r,t)}},t.UINT32_BE={len:4,get:(e,t)=>e.readUInt32BE(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=0&&r<=4294967295),a.ok(t>=0),a.ok(this.len<=e.length),e.writeUInt32BE(r,t)}},t.INT8={len:1,get:(e,t)=>e.readInt8(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=-128&&r<=127),a.ok(t>=0),a.ok(this.len<=e.length),e.writeInt8(r,t)}},t.INT16_BE={len:2,get:(e,t)=>e.readInt16BE(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=-32768&&r<=32767),a.ok(t>=0),a.ok(this.len<=e.length),e.writeInt16BE(r,t)}},t.INT16_LE={len:2,get:(e,t)=>e.readInt16LE(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=-32768&&r<=32767),a.ok(t>=0),a.ok(this.len<=e.length),e.writeInt16LE(r,t)}},t.INT24_LE={len:3,get:(e,t)=>e.readIntLE(t,3),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=-8388608&&r<=8388607),a.ok(t>=0),a.ok(this.len<=e.length),e.writeIntLE(r,t,3)}},t.INT24_BE={len:3,get:(e,t)=>e.readIntBE(t,3),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=-8388608&&r<=8388607),a.ok(t>=0),a.ok(this.len<=e.length),e.writeIntBE(r,t,3)}},t.INT32_BE={len:4,get:(e,t)=>e.readInt32BE(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=-2147483648&&r<=2147483647),a.ok(t>=0),a.ok(this.len<=e.length),e.writeInt32BE(r,t)}},t.INT32_LE={len:4,get:(e,t)=>e.readInt32LE(t),put(e,t,r){return a.equal(typeof t,"number"),a.equal(typeof r,"number"),a.ok(r>=-2147483648&&r<=2147483647),a.ok(t>=0),a.ok(this.len<=e.length),e.writeInt32LE(r,t)}},t.UINT64_LE={len:8,get(e,t){return function(e,t,r){r>>>=0;let a=e[t>>>=0],n=1,i=0;for(;++i<r&&(n*=256);)a+=e[t+i]*n;return a}(e,t,this.len)},put(e,t,r){return function(e,t,r,a){t=+t,a>>>=0;let n=1,i=0;e[r>>>=0]=255&t;for(;++i<a&&(n*=256);)e[r+i]=t/n&255;return r+a}(e,r,t,this.len)}},t.INT64_LE={len:8,get(e,t){return function(e,t,r){r>>>=0;let a=e[t>>>=0],n=1,i=0;for(;++i<r&&(n*=256);)a+=e[t+i]*n;a>=(n*=128)&&(a-=Math.pow(2,8*r));return a}(e,t,this.len)},put(e,t,r){return s(e,r,t,this.len)}},t.UINT64_BE={len:8,get(e,t){return o(e,t,this.len)},put(e,t,r){return c(e,r,t,this.len)}},t.INT64_BE={len:8,get(e,t){return u(e,t,this.len)},put(e,t,r){return l(e,r,t,this.len)}},t.Float16_BE={len:2,get(e,t){return n.read(e,t,!1,10,this.len)},put(e,t,r){return n.write(e,r,t,!1,10,this.len)}},t.Float16_LE={len:2,get(e,t){return n.read(e,t,!0,10,this.len)},put(e,t,r){return n.write(e,r,t,!0,10,this.len)}},t.Float32_BE={len:4,get:(e,t)=>e.readFloatBE(t),put:(e,t,r)=>e.writeFloatBE(r,t)},t.Float32_LE={len:4,get:(e,t)=>e.readFloatLE(t),put:(e,t,r)=>e.writeFloatLE(r,t)},t.Float64_BE={len:8,get:(e,t)=>e.readDoubleBE(t),put:(e,t,r)=>e.writeDoubleBE(r,t)},t.Float64_LE={len:8,get:(e,t)=>e.readDoubleLE(t),put:(e,t,r)=>e.writeDoubleLE(r,t)},t.Float80_BE={len:10,get(e,t){return n.read(e,t,!1,63,this.len)},put(e,t,r){return n.write(e,r,t,!1,63,this.len)}},t.Float80_LE={len:10,get(e,t){return n.read(e,t,!0,63,this.len)},put(e,t,r){return n.write(e,r,t,!0,63,this.len)}};t.IgnoreType=class{constructor(e){this.len=e}get(e,t){}};t.BufferType=class{constructor(e){this.len=e}get(e,t){return e.slice(t,t+this.len)}};t.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return e.toString(this.encoding,t,t+this.len)}};class i{constructor(e){this.len=e}static decode(e,t,r){let a="";for(let n=t;n<r;++n)a+=i.codePointToString(i.singleByteDecoder(e[n]));return a}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(i.inRange(e,0,127))return e;const t=i.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return i.decode(e,t,t+this.len)}}function s(e,t,r,a){t=+t;let n=0,i=1,s=0;for(e[r>>>=0]=255&t;++n<a&&(i*=256);)t<0&&0===s&&0!==e[r+n-1]&&(s=1),e[r+n]=(t/i>>0)-s&255;return r+a}function o(e,t,r){r>>>=0;let a=e[(t>>>=0)+--r],n=1;for(;r>0&&(n*=256);)a+=e[t+--r]*n;return a}function c(e,t,r,a){t=+t;let n=(a>>>=0)-1,i=1;for(e[(r>>>=0)+n]=255&t;--n>=0&&(i*=256);)e[r+n]=t/i&255;return r+a}function u(e,t,r){let a=r>>>=0,n=1,i=e[(t>>>=0)+--a];for(;a>0&&(n*=256);)i+=e[t+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*r)),i}function l(e,t,r,a){t=+t;let n=a-1,i=1,s=0;for(e[(r>>>=0)+n]=255&t;--n>=0&&(i*=256);)t<0&&0===s&&0!==e[r+n+1]&&(s=1),e[r+n]=(t/i>>0)-s&255;return r+a}t.AnsiStringType=i,i.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],t.writeIntLE=s,t.readUIntBE=o,t.writeUIntBE=c,t.readIntBE=u,t.writeIntBE=l},function(e,t,r){(function(a){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let a=0,n=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(a++,"%c"===e&&(n=a))}),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==a&&"env"in a&&(e=a.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(64)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(9))},function(e,t,r){"use strict";(function(e){var a=r(51),n=r(30),i=r(31);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return u(this,e,t,r)}function u(e,t,r,a){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,a){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(a||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===a?new Uint8Array(t):void 0===a?new Uint8Array(t,r):new Uint8Array(t,r,a);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=f(e,t);return e}(e,t,r,a):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var a=0|m(t,r),n=(e=o(e,a)).write(t,r);n!==a&&(e=e.slice(0,n));return e}(e,t,r):function(e,t){if(c.isBuffer(t)){var r=0|p(t.length);return 0===(e=o(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(a=t.length)!=a?o(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}var a;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(l(t),e=o(e,t<0?0:0|p(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function f(e,t){var r=t.length<0?0:0|p(t.length);e=o(e,r);for(var a=0;a<r;a+=1)e[a]=255&t[a];return e}function p(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(a)return j(e).length;t=(""+t).toLowerCase(),a=!0}}function h(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function g(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function y(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,a)),c.isBuffer(t))return 0===t.length?-1:b(e,t,r,a,n);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,a,n){var i,s=1,o=e.length,c=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;s=2,o/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){var l=-1;for(i=r;i<o;i++)if(u(e,i)===u(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===c)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(r+c>o&&(r=o-c),i=r;i>=0;i--){for(var d=!0,f=0;f<c;f++)if(u(e,i+f)!==u(t,f)){d=!1;break}if(d)return i}return-1}function T(e,t,r,a){r=Number(r)||0;var n=e.length-r;a?(a=Number(a))>n&&(a=n):a=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");a>i/2&&(a=i/2);for(var s=0;s<a;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[r+s]=o}return s}function w(e,t,r,a){return W(j(t,e.length-r),e,r,a)}function k(e,t,r,a){return W(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,a)}function v(e,t,r,a){return k(e,t,r,a)}function I(e,t,r,a){return W(H(t),e,r,a)}function E(e,t,r,a){return W(function(e,t){for(var r,a,n,i=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),a=r>>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function S(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n<r;){var i,s,o,c,u=e[n],l=null,d=u>239?4:u>223?3:u>191?2:1;if(n+d<=r)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(i=e[n+1]))&&(c=(31&u)<<6|63&i)>127&&(l=c);break;case 3:i=e[n+1],s=e[n+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=e[n+1],s=e[n+2],o=e[n+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&o)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,a.push(l>>>10&1023|55296),l=56320|1023&l),a.push(l),n+=d}return function(e){var t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a<t;)r+=String.fromCharCode.apply(String,e.slice(a,a+=_));return r}(a)}t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return u(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return function(e,t,r,a){return l(t),t<=0?o(e,t):void 0!==r?"string"==typeof a?o(e,t).fill(r,a):o(e,t).fill(r):o(e,t)}(null,e,t,r)},c.allocUnsafe=function(e){return d(null,e)},c.allocUnsafeSlow=function(e){return d(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n<i;++n)if(e[n]!==t[n]){r=e[n],a=t[n];break}return r<a?-1:a<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var a=c.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var s=e[r];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(a,n),n+=s.length}return a},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):h.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,a,n){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(a>>>=0),s=(r>>>=0)-(t>>>=0),o=Math.min(i,s),u=this.slice(a,n),l=e.slice(t,r),d=0;d<o;++d)if(u[d]!==l[d]){i=u[d],s=l[d];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},c.prototype.write=function(e,t,r,a){if(void 0===t)a="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)a=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===a&&(a="utf8")):(a=r,r=void 0)}var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return T(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return k(this,e,t,r);case"latin1":case"binary":return v(this,e,t,r);case"base64":return I(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function A(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n)a+=String.fromCharCode(127&e[n]);return a}function B(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;n<r;++n)a+=String.fromCharCode(e[n]);return a}function x(e,t,r){var a=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>a)&&(r=a);for(var n="",i=t;i<r;++i)n+=U(e[i]);return n}function F(e,t,r){for(var a=e.slice(t,r),n="",i=0;i<a.length;i+=2)n+=String.fromCharCode(a[i]+256*a[i+1]);return n}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,a,n,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<i)throw new RangeError('"value" argument is out of bounds');if(r+a>e.length)throw new RangeError("Index out of range")}function M(e,t,r,a){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-r,2);n<i;++n)e[r+n]=(t&255<<8*(a?n:1-n))>>>8*(a?n:1-n)}function O(e,t,r,a){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-r,4);n<i;++n)e[r+n]=t>>>8*(a?n:3-n)&255}function z(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,a,i){return i||z(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function L(e,t,r,a,i){return i||z(e,0,r,8),n.write(e,t,r,a,52,8),r+8}c.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=c.prototype;else{var n=t-e;r=new c(n,void 0);for(var i=0;i<n;++i)r[i]=this[i+e]}return r},c.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var a=this[e],n=1,i=0;++i<t&&(n*=256);)a+=this[e+i]*n;return a},c.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var a=this[e+--t],n=1;t>0&&(n*=256);)a+=this[e+--t]*n;return a},c.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var a=this[e],n=1,i=0;++i<t&&(n*=256);)a+=this[e+i]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),n.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),n.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),n.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),n.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||D(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i<r&&(n*=256);)this[t+i]=e/n&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||D(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,i=1;for(this[t+n]=255&e;--n>=0&&(i*=256);)this[t+n]=e/i&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):O(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}var i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s>>0)-o&255;return t+r},c.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}var i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s>>0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):O(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<r&&(a=r),a===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-r&&(a=e.length-t+r);var n,i=a-r;if(this===e&&r<t&&t<a)for(n=i-1;n>=0;--n)e[n+t]=this[n+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(n=0;n<i;++n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},c.prototype.fill=function(e,t,r,a){if("string"==typeof e){if("string"==typeof t?(a=t,t=0,r=this.length):"string"==typeof r&&(a=r,r=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!c.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=c.isBuffer(e)?e:j(new c(e,a).toString()),o=s.length;for(i=0;i<r-t;++i)this[i+t]=s[i%o]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function j(e,t){var r;t=t||1/0;for(var a=e.length,n=null,i=[],s=0;s<a;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(e){return a.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,a){for(var n=0;n<a&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,r(10))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(4),n=r(70);class i{static findZero(e,t,r,a){let n=t;if("utf16"===a){for(;0!==e[n]||0!==e[n+1];){if(n>=r)return r;n+=2}return n}for(;0!==e[n];){if(n>=r)return r;n++}return n}static trimRightNull(e){const t=e.indexOf("\0");return-1===t?e:e.substr(0,t)}static swapBytes(e){const t=e.length;a.ok(0==(1&t),"Buffer length must be even");for(let r=0;r<t;r+=2){const t=e[r];e[r]=e[r+1],e[r+1]=t}return e}static readUTF16String(e){let t=0;return 254===e[0]&&255===e[1]?(e=i.swapBytes(e),t=2):255===e[0]&&254===e[1]&&(t=2),e.toString("ucs2",t)}static decodeString(e,t){if(255===e[0]&&254===e[1]&&254===e[2]&&255===e[3]&&(e=e.slice(2)),"utf16le"===t||"utf16"===t)return i.readUTF16String(e);if("utf8"===t)return e.toString("utf8");if("iso-8859-1"===t)return n.Windows1292Decoder.decode(e);throw Error(t+" encoding is not supported!")}static stripNulls(e){return e=(e=e.replace(/^\x00+/g,"")).replace(/\x00+$/g,"")}static getBitAllignedNumber(e,t,r,a){const n=r%8;let s=e[t+~~(r/8)];s&=255>>n;const o=8-n,c=a-o;return c<0?s>>=8-n-a:c>0&&(s<<=c,s|=i.getBitAllignedNumber(e,t,r+o,c)),s}static isBitSet(e,t,r){return 1===i.getBitAllignedNumber(e,t,r,1)}static a2hex(e){const t=[];for(let r=0,a=e.length;r<a;r++){const a=Number(e.charCodeAt(r)).toString(16);t.push(1===a.length?"0"+a:a)}return t.join(" ")}}function s(e){return 10*Math.log10(e)}function o(e){return Math.pow(10,e/10)}t.default=i,i.strtokBITSET={get:(e,t,r)=>0!=(e[t]&1<<r),len:1},t.ratioToDb=s,t.dbToRatio=o,t.toRatio=function(e){const t=e.split(" ").map(e=>e.trim().toLowerCase());if(t.length>=1){const e=parseFloat(t[0]);return 2===t.length&&"db"===t[1]?{dB:e,ratio:o(e)}:{dB:s(e),ratio:e}}}},function(e,t,r){"use strict";(function(t){function a(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n<i;++n)if(e[n]!==t[n]){r=e[n],a=t[n];break}return r<a?-1:a<r?1:0}function n(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var i=r(53),s=Object.prototype.hasOwnProperty,o=Array.prototype.slice,c="foo"===function(){}.name;function u(e){return Object.prototype.toString.call(e)}function l(e){return!n(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var d=e.exports=y,f=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(i.isFunction(e)){if(c)return e.name;var t=e.toString().match(f);return t&&t[1]}}function m(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function h(e){if(c||!i.isFunction(e))return i.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function g(e,t,r,a,n){throw new d.AssertionError({message:r,actual:e,expected:t,operator:a,stackStartFunction:n})}function y(e,t){e||g(e,!0,t,"==",d.ok)}function b(e,t,r,s){if(e===t)return!0;if(n(e)&&n(t))return 0===a(e,t);if(i.isDate(e)&&i.isDate(t))return e.getTime()===t.getTime();if(i.isRegExp(e)&&i.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&u(e)===u(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===a(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(n(e)!==n(t))return!1;var c=(s=s||{actual:[],expected:[]}).actual.indexOf(e);return-1!==c&&c===s.expected.indexOf(t)||(s.actual.push(e),s.expected.push(t),function(e,t,r,a){if(null==e||null==t)return!1;if(i.isPrimitive(e)||i.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var n=T(e),s=T(t);if(n&&!s||!n&&s)return!1;if(n)return e=o.call(e),t=o.call(t),b(e,t,r);var c,u,l=v(e),d=v(t);if(l.length!==d.length)return!1;for(l.sort(),d.sort(),u=l.length-1;u>=0;u--)if(l[u]!==d[u])return!1;for(u=l.length-1;u>=0;u--)if(c=l[u],!b(e[c],t[c],r,a))return!1;return!0}(e,t,r,s))}return r?e===t:e==t}function T(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function k(e,t,r,a){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(a=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),a=(r&&r.name?" ("+r.name+").":".")+(a?" "+a:"."),e&&!n&&g(n,r,"Missing expected exception"+a);var s="string"==typeof a,o=!e&&n&&!r;if((!e&&i.isError(n)&&s&&w(n,r)||o)&&g(n,r,"Got unwanted exception"+a),e&&n&&r&&!w(n,r)||!e&&n)throw n}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(h(e.actual),128)+" "+e.operator+" "+m(h(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var a=r.stack,n=p(t),i=a.indexOf("\n"+n);if(i>=0){var s=a.indexOf("\n",i+1);a=a.substring(s+1)}this.stack=a}}},i.inherits(d.AssertionError,Error),d.fail=g,d.ok=y,d.equal=function(e,t,r){e!=t&&g(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,a){b(t,r,!0)&&g(t,r,a,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){k(!0,e,t,r)},d.doesNotThrow=function(e,t,r){k(!1,e,t,r)},d.ifError=function(e){if(e)throw e};var v=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(10))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(3),n=/^[\w-©][\w-\x000-3]/;t.FourCcToken={len:4,get:(e,r)=>{const i=e.toString("binary",r,r+t.FourCcToken.len);if(!i.match(n))throw new Error(`FourCC contains invalid characters: ${a.default.a2hex(i)}`);return i},put:(t,r,a)=>{const n=e.from(a,"binary");if(4!==n.length)throw new Error("Invalid length");return n.copy(t,r)}}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BasicParser=class{init(e,t,r){return this.metadata=e,this.tokenizer=t,this.options=r,this}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(50),n=r(58);var i=r(17);t.EndOfStreamError=i.EndOfStreamError,t.fromStream=function(e,t){return t=t||{},new a.ReadStreamTokenizer(e,t)},t.fromBuffer=function(e,t){return new n.BufferTokenizer(e,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(18);class n{constructor(e,t){this.tagTypes=e,this.tagMap=t}static parseGenre(e){const t=e.trim().split(/\((.*?)\)/g).filter(e=>""!==e),r=[];for(let e of t)/^\d+$/.test(e)&&!isNaN(parseInt(e,10))&&(e=a.Genres[e]),r.push(e);return r.filter(e=>void 0!==e).join("/")}static toIntOrNull(e){const t=parseInt(e,10);return isNaN(t)?null:t}static normalizeTrack(e){const t=e.toString().split("/");return{no:parseInt(t[0],10)||null,of:parseInt(t[1],10)||null}}mapGenericTag(e,t){e={id:e.id,value:e.value},this.postMap(e,t);const r=this.getCommonName(e.id);return r?{id:r,value:e.value}:null}getCommonName(e){return this.tagMap[e]}postMap(e,t){}}t.CommonTagMapper=n,n.maxRatingScore=1},function(e,t){var r,a,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var c,u=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&p())}function p(){if(!l){var e=o(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!1,function(e){if(a===clearTimeout)return clearTimeout(e);if((a===s||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function h(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new m(e,t)),1!==u.length||l||o(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=h,n.addListener=h,n.once=h,n.off=h,n.removeListener=h,n.removeAllListeners=h,n.emit=h,n.prependListener=h,n.prependOnceListener=h,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";var a=r(19),n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var i=r(16);i.inherits=r(11);var s=r(35),o=r(28);i.inherits(d,s);for(var c=n(o.prototype),u=0;u<c.length;u++){var l=c[u];d.prototype[l]||(d.prototype[l]=o.prototype[l])}function d(e){if(!(this instanceof d))return new d(e);s.call(this,e),o.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||a.nextTick(p,this)}function p(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),a.nextTick(t,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(7),i=r(4),s=r(3),o=r(6),c=r(71),u=r(0),l=a("music-metadata:parser:APEv2"),d="APEv2",f="APETAGEX";class p extends o.BasicParser{constructor(){super(...arguments),this.ape={}}static tryParseApeHeader(e,t,r){const a=new p;return a.init(e,t,r),a.tryParseApeHeader()}static calculateDuration(e){let t=e.totalFrames>1?e.blocksPerFrame*(e.totalFrames-1):0;return(t+=e.finalFrameBlocks)/e.sampleRate}static async findApeFooterOffset(t,r){const a=e.alloc(c.TagFooter.len);await t.randomRead(a,0,c.TagFooter.len,r-c.TagFooter.len);const n=c.TagFooter.get(a,0);if("APETAGEX"===n.ID)return l(`APE footer header at offset=${r}`),{footer:n,offset:r-n.size}}static parseTagFooter(e,t,r){const a=c.TagFooter.get(t,t.length-c.TagFooter.len);i.strictEqual(a.ID,f,"APEv2 Footer preamble"),n.fromBuffer(t);const s=new p;return s.init(e,n.fromBuffer(t),r),s.parseTags(a)}async tryParseApeHeader(){if(this.tokenizer.fileInfo.size&&this.tokenizer.fileInfo.size-this.tokenizer.position<c.TagFooter.len)return void l("No APEv2 header found, end-of-file reached");const t=await this.tokenizer.peekToken(c.TagFooter);if(t.ID===f)return await this.tokenizer.ignore(c.TagFooter.len),this.parseTags(t);if(l(`APEv2 header not found at offset=${this.tokenizer.position}`),this.tokenizer.fileInfo.size){const t=this.tokenizer.fileInfo.size-this.tokenizer.position,r=e.alloc(t);return await this.tokenizer.readBuffer(r),p.parseTagFooter(this.metadata,r,this.options)}}async parse(){const e=await this.tokenizer.readToken(c.DescriptorParser);i.strictEqual(e.ID,"MAC ","descriptor.ID"),this.ape.descriptor=e;const t=e.descriptorBytes-c.DescriptorParser.len,r=await(t>0?this.parseDescriptorExpansion(t):this.parseHeader());return await this.tokenizer.ignore(r.forwardBytes),this.tryParseApeHeader()}async parseTags(t){const r=e.alloc(256);let a=t.size-c.TagFooter.len;l(`Parse APE tags at offset=${this.tokenizer.position}, size=${a}`);for(let n=0;n<t.fields;n++){if(a<c.TagItemHeader.len){this.metadata.addWarning(`APEv2 Tag-header: ${t.fields-n} items remaining, but no more tag data to read.`);break}const i=await this.tokenizer.readToken(c.TagItemHeader);a-=c.TagItemHeader.len+i.size,await this.tokenizer.peekBuffer(r,{length:Math.min(r.length,a)});let o=s.default.findZero(r,0,r.length);const f=await this.tokenizer.readToken(new u.StringType(o,"ascii"));switch(await this.tokenizer.ignore(1),a-=f.length+1,i.flags.dataType){case c.DataType.text_utf8:{const e=(await this.tokenizer.readToken(new u.StringType(i.size,"utf8"))).split(/\x00/g);for(const t of e)this.metadata.addTag(d,f,t);break}case c.DataType.binary:if(this.options.skipCovers)await this.tokenizer.ignore(i.size);else{const t=e.alloc(i.size);await this.tokenizer.readBuffer(t),o=s.default.findZero(t,0,t.length);const r=t.toString("utf8",0,o),a=e.from(t.slice(o+1));this.metadata.addTag(d,f,{description:r,data:a})}break;case c.DataType.external_info:l(`Ignore external info ${f}`),await this.tokenizer.ignore(i.size);break;default:throw new Error(`Unexpected data-type: ${i.flags.dataType}`)}}}async parseDescriptorExpansion(e){return await this.tokenizer.ignore(e),this.parseHeader()}async parseHeader(){const e=await this.tokenizer.readToken(c.Header);return this.metadata.setFormat("lossless",!0),this.metadata.setFormat("container","Monkey's Audio"),this.metadata.setFormat("bitsPerSample",e.bitsPerSample),this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("numberOfChannels",e.channel),this.metadata.setFormat("duration",p.calculateDuration(e)),{forwardBytes:this.ape.descriptor.seekTableBytes+this.ape.descriptor.headerDataBytes+this.ape.descriptor.apeFrameDataBytes+this.ape.descriptor.terminatingDataBytes}}}t.APEv2Parser=p}).call(this,r(2).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(3),i=r(81),s=r(15);class o{static removeUnsyncBytes(e){let t=0,r=0;for(;t<e.length-1;)t!==r&&(e[r]=e[t]),t+=255===e[t]&&0===e[t+1]?2:1,r++;return t<e.length&&(e[r++]=e[t]),e.slice(0,r)}static readFrameHeader(e,t){let r;switch(t){case 2:r={id:e.toString("ascii",0,3),length:a.UINT24_BE.get(e,3)};break;case 3:r={id:e.toString("ascii",0,4),length:a.UINT32_BE.get(e,4),flags:o.readFrameFlags(e.slice(8,10))};break;case 4:r={id:e.toString("ascii",0,4),length:s.UINT32SYNCSAFE.get(e,4),flags:o.readFrameFlags(e.slice(8,10))};break;default:throw new Error("Unexpected majorVer: "+t)}return r}static getFrameHeaderLength(e){switch(e){case 2:return 6;case 3:case 4:return 10;default:throw new Error("header versionIndex is incorrect")}}static readFrameFlags(e){return{status:{tag_alter_preservation:n.default.strtokBITSET.get(e,0,6),file_alter_preservation:n.default.strtokBITSET.get(e,0,5),read_only:n.default.strtokBITSET.get(e,0,4)},format:{grouping_identity:n.default.strtokBITSET.get(e,1,7),compression:n.default.strtokBITSET.get(e,1,3),encryption:n.default.strtokBITSET.get(e,1,2),unsynchronisation:n.default.strtokBITSET.get(e,1,1),data_length_indicator:n.default.strtokBITSET.get(e,1,0)}}}static readFrameData(e,t,r,a,n){const s=new i.FrameParser(r,n);switch(r){case 2:return s.readData(e,t.id,a);case 3:case 4:return t.flags.format.unsynchronisation&&(e=o.removeUnsyncBytes(e)),t.flags.format.data_length_indicator&&(e=e.slice(4,e.length)),s.readData(e,t.id,a);default:throw new Error("Unexpected majorVer: "+r)}}static makeDescriptionTagName(e,t){return e+(t?":"+t:"")}async parse(e,t,r){this.tokenizer=t,this.metadata=e,this.options=r;const a=await this.tokenizer.readToken(s.ID3v2Header);if("ID3"!==a.fileIdentifier)throw new Error("expected ID3-header file-identifier 'ID3' was not found");return this.id3Header=a,this.headerType="ID3v2."+a.version.major,a.flags.isExtendedHeader?this.parseExtendedHeader():this.parseId3Data(a.size)}async parseExtendedHeader(){const e=await this.tokenizer.readToken(s.ExtendedHeader),t=e.size-s.ExtendedHeader.len;return t>0?this.parseExtendedHeaderData(t,e.size):this.parseId3Data(this.id3Header.size-e.size)}async parseExtendedHeaderData(t,r){const a=e.alloc(t);return await this.tokenizer.readBuffer(a,{length:t}),this.parseId3Data(this.id3Header.size-r)}async parseId3Data(t){const r=e.alloc(t);await this.tokenizer.readBuffer(r,{length:t});for(const e of this.parseMetadata(r))if("TXXX"===e.id)for(const t of e.value.text)this.addTag(o.makeDescriptionTagName(e.id,e.value.description),t);else if("COM"===e.id)for(const t of e.value)this.addTag(o.makeDescriptionTagName(e.id,t.description),t.text);else if(Array.isArray(e.value))for(const t of e.value)this.addTag(e.id,t);else this.addTag(e.id,e.value)}addTag(e,t){this.metadata.addTag(this.headerType,e,t)}parseMetadata(e){let t=0;const r=[];for(;t!==e.length;){const a=o.getFrameHeaderLength(this.id3Header.version.major);if(t+a>e.length){this.metadata.addWarning("Illegal ID3v2 tag length");break}const n=e.slice(t,t+=a),i=o.readFrameHeader(n,this.id3Header.version.major);if(""===i.id||"\0\0\0\0"===i.id||-1==="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(i.id[0]))break;const s=e.slice(t,t+=i.length),c=o.readFrameData(s,i,this.id3Header.version.major,!this.options.skipCovers,this.metadata);r.push({id:i.id,value:c})}return r}}t.ID3v2Parser=o}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(3);!function(e){e[e.Other=0]="Other",e[e["32x32 pixels 'file icon' (PNG only)"]=1]="32x32 pixels 'file icon' (PNG only)",e[e["Other file icon"]=2]="Other file icon",e[e["Cover (front)"]=3]="Cover (front)",e[e["Cover (back)"]=4]="Cover (back)",e[e["Leaflet page"]=5]="Leaflet page",e[e["Media (e.g. label side of CD)"]=6]="Media (e.g. label side of CD)",e[e["Lead artist/lead performer/soloist"]=7]="Lead artist/lead performer/soloist",e[e["Artist/performer"]=8]="Artist/performer",e[e.Conductor=9]="Conductor",e[e["Band/Orchestra"]=10]="Band/Orchestra",e[e.Composer=11]="Composer",e[e["Lyricist/text writer"]=12]="Lyricist/text writer",e[e["Recording Location"]=13]="Recording Location",e[e["During recording"]=14]="During recording",e[e["During performance"]=15]="During performance",e[e["Movie/video screen capture"]=16]="Movie/video screen capture",e[e["A bright coloured fish"]=17]="A bright coloured fish",e[e.Illustration=18]="Illustration",e[e["Band/artist logotype"]=19]="Band/artist logotype",e[e["Publisher/Studio logotype"]=20]="Publisher/Studio logotype"}(t.AttachedPictureType||(t.AttachedPictureType={})),t.UINT32SYNCSAFE={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},t.ID3v2Header={len:10,get:(e,r)=>({fileIdentifier:new a.StringType(3,"ascii").get(e,r),version:{major:a.INT8.get(e,r+3),revision:a.INT8.get(e,r+4)},flags:{raw:a.INT8.get(e,r+4),unsynchronisation:n.default.strtokBITSET.get(e,r+5,7),isExtendedHeader:n.default.strtokBITSET.get(e,r+5,6),expIndicator:n.default.strtokBITSET.get(e,r+5,5),footer:n.default.strtokBITSET.get(e,r+5,4)},size:t.UINT32SYNCSAFE.get(e,r+6)})},t.ExtendedHeader={len:10,get:(e,t)=>({size:a.UINT32_BE.get(e,t),extendedFlags:a.UINT16_BE.get(e,t+4),sizeOfPadding:a.UINT32_BE.get(e,t+6),crcDataPresent:n.default.strtokBITSET.get(e,t+4,31)})},t.TextEncodingToken={len:1,get:(e,t)=>{switch(e.readUInt8(t)){case 0:return{encoding:"iso-8859-1"};case 1:return{encoding:"utf16",bom:!0};case 2:return{encoding:"utf16",bom:!1};case 3:default:return{encoding:"utf8",bom:!1}}}}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(4),n=r(32);var i=r(32);t.EndOfStreamError=i.EndOfStreamError;class s{constructor(){this.promise=new Promise((e,t)=>{this.reject=t,this.resolve=e})}}const o=1048576;t.StreamReader=class{constructor(e){if(this.s=e,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",()=>this.reject(new n.EndOfStreamError)),this.s.once("error",e=>this.reject(e)),this.s.once("close",()=>this.reject(new Error("Stream closed")))}async peek(e,t,r){const a=await this.read(e,t,r);return this.peekQueue.push(e.slice(t,t+a)),a}async read(e,t,r){if(0===r)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new n.EndOfStreamError;let a=r,i=0;for(;this.peekQueue.length>0&&a>0;){const r=this.peekQueue.pop(),n=Math.min(r.length,a);r.copy(e,t+i,0,n),i+=n,a-=n,n<r.length&&this.peekQueue.push(r.slice(n))}for(;a>0&&!this.endOfStream;){const r=Math.min(a,o),n=await this._read(e,t+i,r);if(i+=n,n<r)break;a-=n}return i}async _read(e,t,r){a.ok(!this.request,"Concurrent read operation?");const n=this.s.read(r);return n?(n.copy(e,t),n.length):(this.request={buffer:e,offset:t,length:r,deferred:new s},this.s.once("readable",()=>{this.tryRead()}),this.request.deferred.promise.then(e=>(this.request=null,e),e=>{throw this.request=null,e}))}tryRead(){const e=this.s.read(this.request.length);e?(e.copy(this.request.buffer,this.request.offset),this.request.deferred.resolve(e.length)):this.s.once("readable",()=>{this.tryRead()})}reject(e){this.endOfStream=!0,this.request&&(this.request.deferred.reject(e),this.request=null)}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(3),i=r(0),s=r(6),o=r(13),c=a("music-metadata:parser:ID3v1");t.Genres=["Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","A Cappella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House","Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover","Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop","Abstract","Art Rock","Baroque","Bhangra","Big Beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math Rock","New Romantic","Nu-Breakz","Post-Punk","Post-Rock","Psytrance","Shoegaze","Space Rock","Trop Rock","World Music","Neoclassical","Audiobook","Audio Theatre","Neue Deutsche Welle","Podcast","Indie Rock","G-Funk","Dubstep","Garage Rock","Psybient"];const u={len:128,get:(e,t)=>{const r=new l(3).get(e,t);return"TAG"===r?{header:r,title:new l(30).get(e,t+3),artist:new l(30).get(e,t+33),album:new l(30).get(e,t+63),year:new l(4).get(e,t+93),comment:new l(28).get(e,t+97),zeroByte:i.UINT8.get(e,t+127),track:i.UINT8.get(e,t+126),genre:i.UINT8.get(e,t+127)}:null}};class l extends i.StringType{constructor(e){super(e,"binary")}get(e,t){let r=super.get(e,t);return(r=(r=n.default.trimRightNull(r)).trim()).length>0?r:void 0}}class d extends s.BasicParser{static getGenre(e){if(e<t.Genres.length)return t.Genres[e]}async parse(){if(!this.tokenizer.fileInfo.size)return void c("Skip checking for ID3v1 because the file-size is unknown");if(this.options.apeHeader){this.tokenizer.ignore(this.options.apeHeader.offset-this.tokenizer.position);const e=new o.APEv2Parser;e.init(this.metadata,this.tokenizer,this.options),await e.parseTags(this.options.apeHeader.footer)}const e=this.tokenizer.fileInfo.size-u.len;if(this.tokenizer.position>e)return void c("Already consumed the last 128 bytes");const t=await this.tokenizer.readToken(u,e);if(t){c("ID3v1 header found at: pos=%s",this.tokenizer.fileInfo.size-u.len);for(const e of["title","artist","album","comment","track","year"])t[e]&&""!==t[e]&&this.addTag(e,t[e]);const e=d.getGenre(t.genre);e&&this.addTag("genre",e)}else c("ID3v1 header not found at: pos=%s",this.tokenizer.fileInfo.size-u.len)}addTag(e,t){this.metadata.addTag("ID3v1",e,t)}}t.ID3v1Parser=d,t.hasID3v1Header=async function(t){if(t.fileSize>=128){const r=e.alloc(3);return await t.randomRead(r,0,r.length,t.fileSize-128),"TAG"===r.toString("binary")}return!1}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,a,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,s,o=arguments.length;switch(o){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,a)});case 4:return t.nextTick(function(){e.call(null,r,a,n)});default:for(i=new Array(o-1),s=0;s<i.length;)i[s++]=arguments[s];return t.nextTick(function(){e.apply(null,i)})}}}:e.exports=t}).call(this,r(9))},function(e,t,r){var a=r(2),n=a.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=a:(i(a,t),t.Buffer=s),i(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var a=n(e);return void 0!==t?"string"==typeof r?a.fill(t,r):a.fill(t):a.fill(0),a},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(7),n=r(15),i=r(14),s=r(18),o=r(1),c=r(6),u=o("music-metadata:parser:ID3");t.AbstractID3Parser=class extends c.BasicParser{constructor(){super(...arguments),this.id3parser=new i.ID3v2Parser}static async startsWithID3v2Header(e){return"ID3"===(await e.peekToken(n.ID3v2Header)).fileIdentifier}async parse(){try{await this.parseID3v2()}catch(e){if(!(e instanceof a.EndOfStreamError))throw e;u("End-of-stream")}}finalize(){}async parseID3v2(){if(await this.tryReadId3v2Headers(),u("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),await this._parse(),this.options.skipPostHeaders&&this.metadata.hasAny())this.finalize();else{const e=new s.ID3v1Parser;await e.init(this.metadata,this.tokenizer,this.options).parse(),this.finalize()}}async tryReadId3v2Headers(){if("ID3"===(await this.tokenizer.peekToken(n.ID3v2Header)).fileIdentifier)return u("Found ID3v2 header, pos=%s",this.tokenizer.position),await this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(1),i=r(42),s=r(41),o=n("music-metadata:parser:ogg:vorbis1");t.VorbisParser=class{constructor(e,t){this.metadata=e,this.options=t,this.pageSegments=[]}parsePage(t,r){if(t.headerType.firstPage)this.parseFirstPage(t,r);else{if(t.headerType.continued){if(0===this.pageSegments.length)throw new Error("Cannot continue on previous page");this.pageSegments.push(r)}if(t.headerType.lastPage||!t.headerType.continued){if(this.pageSegments.length>0){const t=e.concat(this.pageSegments);this.parseFullPage(t)}this.pageSegments=t.headerType.lastPage?[]:[r]}}t.headerType.lastPage&&this.calculateDuration(t)}flush(){this.parseFullPage(e.concat(this.pageSegments))}parseUserComment(e,t){const r=new i.VorbisDecoder(e,t).parseUserComment();return this.addTag(r.key,r.value),r.len}addTag(e,t){if("METADATA_BLOCK_PICTURE"===e&&"string"==typeof t){if(this.options.skipCovers)return void o("Ignore picture");t=s.VorbisPictureToken.fromBase64(t),o(`Push picture: id=${e}, format=${t.format}`)}else o(`Push tag: id=${e}, value=${t}`);this.metadata.addTag("vorbis",e,t)}parseFirstPage(e,t){this.metadata.setFormat("codec","Vorbis I"),o("Parse first page");const r=s.CommonHeader.get(t,0);if("vorbis"!==r.vorbis)throw new Error("Metadata does not look like Vorbis");if(1!==r.packetType)throw new Error("First Ogg page should be type 1: the identification header");{const e=s.IdentificationHeader.get(t,s.CommonHeader.len);this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("bitrate",e.bitrateNominal),this.metadata.setFormat("numberOfChannels",e.channelMode),o("sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s",e.sampleRate,e.bitrateNominal,e.channelMode)}}parseFullPage(e){const t=s.CommonHeader.get(e,0);switch(o("Parse full page: type=%s, byteLength=%s",t.packetType,e.byteLength),t.packetType){case 3:return this.parseUserCommentList(e,s.CommonHeader.len)}}calculateDuration(e){this.metadata.format.sampleRate&&e.absoluteGranulePosition>=0&&(this.metadata.setFormat("numberOfSamples",e.absoluteGranulePosition),this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate))}parseUserCommentList(e,t){const r=a.UINT32_LE.get(e,t);t+=4,t+=r;let n=a.UINT32_LE.get(e,t);for(t+=4;n-- >0;)t+=this.parseUserComment(e,t)}}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.video=1]="video",e[e.audio=2]="audio",e[e.complex=3]="complex",e[e.logo=4]="logo",e[e.subtitle=17]="subtitle",e[e.button=18]="button",e[e.control=32]="control"}(t.TrackType||(t.TrackType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(8);t.CaseInsensitiveTagMap=class extends a.CommonTagMapper{constructor(e,t){const r={};for(const e of Object.keys(t))r[e.toUpperCase()]=t[e];super(e,r)}getCommonName(e){return this.tagMap[e.toUpperCase()]}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(34);t.ID3Stream=class extends a.Readable{constructor(e){super(),this.buf=e}_read(){this.push(this.buf),this.push(null)}}},function(e,t,r){"use strict";var a,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};a=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,a){var n,i,s,o;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=a?[r,s]:[s,r]:a?s.unshift(r):s.push(r),(n=u(e))>0&&s.length>n&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,o=c,console&&console.warn&&console.warn(o)}return e}function d(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,i(this.listener,this.target,e))}function f(e,t,r){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=d.bind(a);return n.listener=r,a.wrapFn=n,n}function p(e,t,r){var a=e._events;if(void 0===a)return[];var n=a[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):h(n,n.length)}function m(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=new Array(t),a=0;a<t;++a)r[a]=e[a];return r}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var a="error"===e,n=this._events;if(void 0!==n)a=a&&void 0===n.error;else if(!a)return!1;if(a){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var c=n[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,l=h(c,u);for(r=0;r<u;++r)i(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return l(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return l(this,e,t,!0)},o.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,a,n,i,s;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(a=this._events))return this;if(void 0===(r=a[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(a[e]=r[0]),void 0!==a.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,a;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,i=Object.keys(r);for(a=0;a<i.length;++a)"removeListener"!==(n=i[a])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(a=t.length-1;a>=0;a--)this.removeListener(e,t[a]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){(t=e.exports=r(35)).Stream=t,t.Readable=t,t.Writable=r(28),t.Duplex=r(12),t.Transform=r(39),t.PassThrough=r(90)},function(e,t,r){"use strict";(function(t,a,n){var i=r(19);function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var a=e.entry;e.entry=null;for(;a;){var n=a.callback;t.pendingcb--,n(r),a=a.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=b;var o,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?a:i.nextTick;b.WritableState=y;var u=r(16);u.inherits=r(11);var l={deprecate:r(89)},d=r(36),f=r(20).Buffer,p=n.Uint8Array||function(){};var m,h=r(37);function g(){}function y(e,t){o=o||r(12),e=e||{};var a=t instanceof o;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(u||0===u)?u:l,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 d=!1===e.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,a=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,a,n){--t.pendingcb,r?(i.nextTick(n,a),i.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",a)):(n(a),e._writableState.errorEmitted=!0,e.emit("error",a),E(e,t))}(e,r,a,t,n);else{var s=v(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||k(e,r),a?c(w,e,r,s,n):w(e,r,s,n)}}(t,e)},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 s(this)}function b(e){if(o=o||r(12),!(m.call(b,this)||this instanceof o))return new b(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),d.call(this)}function T(e,t,r,a,n,i,s){t.writelen=a,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function w(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),E(e,t)}function k(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,n=new Array(a),i=t.corkedRequestsFree;i.entry=r;for(var o=0,c=!0;r;)n[o]=r,r.isBuf||(c=!1),r=r.next,o+=1;n.allBuffers=c,T(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback;if(T(e,t,!1,t.objectMode?1:u.length,u,l,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)})}function E(e,t){var r=v(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(I,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(b,d),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(m=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!m.call(this,e)||this===b&&(e&&e._writableState instanceof y)}})):m=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var a,n=this._writableState,s=!1,o=!n.objectMode&&(a=e,f.isBuffer(a)||a instanceof p);return o&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=g),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(o||function(e,t,r,a){var n=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),i.nextTick(a,s),n=!1),n}(this,n,e,r))&&(n.pendingcb++,s=function(e,t,r,a,n,i){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,r));return t}(t,a,n);a!==s&&(r=!0,n="buffer",a=s)}var o=t.objectMode?1:a.length;t.length+=o;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:a,encoding:n,isBuf:r,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else T(e,t,!1,o,a,n,i);return c}(this,n,o,e,t,r)),s},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||k(this,e))},b.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var a=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||a.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,a,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=h.destroy,b.prototype._undestroy=h.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(87).setImmediate,r(10))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(7),n=r(59),i=r(127),s=r(13),o=r(18),c=r(128);function u(e,t){return n.ParserFactory.parseOnContentType(e,t)}async function l(e,t={}){let r=e.fileSize;if(await o.hasID3v1Header(e)){r-=128,r-=await c.getLyricsHeaderLength(e)}t.apeHeader=await s.APEv2Parser.findApeFooterOffset(e,r)}t.parseStream=function(e,t,r={}){return u(a.fromStream(e,"string"==typeof t?{mimeType:t}:t),r)},t.parseBuffer=async function(e,t,r={}){const n=new i.RandomBufferReader(e);return await l(n,r),u(a.fromBuffer(e,"string"==typeof t?{mimeType:t}:t),r)},t.parseFromTokenizer=u,t.orderTags=function(e){const t={};for(const r of e)(t[r.id]=t[r.id]||[]).push(r.value);return t},t.ratingToStars=function(e){return void 0===e?0:1+Math.round(4*e)},t.scanAppendingHeaders=l},function(e,t){t.read=function(e,t,r,a,n){var i,s,o=8*n-a-1,c=(1<<o)-1,u=c>>1,l=-7,d=r?n-1:0,f=r?-1:1,p=e[t+d];for(d+=f,i=p&(1<<-l)-1,p>>=-l,l+=o;l>0;i=256*i+e[t+d],d+=f,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=a;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,a),i-=u}return(p?-1:1)*s*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var s,o,c,u=8*i-n-1,l=(1<<u)-1,d=l>>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=a?0:i-1,m=a?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(o=0,s=l):s+d>=1?(o=(t*c-1)*Math.pow(2,n),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;e[r+p]=255&o,p+=m,o/=256,n-=8);for(s=s<<n|o,u+=n;u>0;e[r+p]=255&s,p+=m,s/=256,u-=8);e[r+p-m]|=128*h}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultMessages="End-Of-Stream";t.EndOfStreamError=class extends Error{constructor(){super(t.defaultMessages)}}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const Token=__webpack_require__(0),strtok3=__webpack_require__(7),{stringToBytes:stringToBytes,tarHeaderChecksumMatches:tarHeaderChecksumMatches,uint32SyncSafeToken:uint32SyncSafeToken,uint8ArrayUtf8ByteString:uint8ArrayUtf8ByteString}=__webpack_require__(60),supported=__webpack_require__(61),minimumBytes=4100;async function fromStream(e){const t=await strtok3.fromStream(e);try{return await fromTokenizer(t)}finally{await t.close()}}async function fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Buffer?e:Buffer.from(e);if(t&&t.length>1)return fromTokenizer(strtok3.fromBuffer(t))}function _check(e,t,r){r={offset:0,...r};for(const[a,n]of t.entries())if(r.mask){if(n!==(r.mask[a]&e[a+r.offset]))return!1}else if(n!==e[a+r.offset])return!1;return!0}async function _checkSequence(e,t,r){const a=Buffer.alloc(minimumBytes);return await t.ignore(r),await t.peekBuffer(a,{mayBeLess:!0}),a.includes(Buffer.from(e))}async function fromTokenizer(e){try{return _fromTokenizer(e)}catch(e){if(!(e instanceof strtok3.EndOfStreamError))throw e}}async function _fromTokenizer(e){let t=Buffer.alloc(minimumBytes);const r=(e,r)=>_check(t,e,r),a=(e,t)=>r(stringToBytes(e),t);if(e.fileInfo.size||(e.fileInfo.size=Number.MAX_SAFE_INTEGER),await e.peekBuffer(t,{length:12,mayBeLess:!0}),r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(r([37,33]))return{ext:"ps",mime:"application/postscript"};if(r([31,160])||r([31,157]))return{ext:"Z",mime:"application/x-compress"};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(a("ID3")){await e.ignore(6);const t=await e.readToken(uint32SyncSafeToken);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),fromTokenizer(e))}if(a("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===t[0]||70===t[0])&&r([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(a("FLIF"))return{ext:"flif",mime:"image/flif"};if(a("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(a("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(a("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(a("FORM"))return{ext:"aif",mime:"audio/aiff"};if(r([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(t,{length:30});const r={compressedSize:t.readUInt32LE(18),uncompressedSize:t.readUInt32LE(22),filenameLength:t.readUInt16LE(26),extraFieldLength:t.readUInt16LE(28)};if(r.filename=await e.readToken(new Token.StringType(r.filenameLength,"utf-8")),await e.ignore(r.extraFieldLength),"META-INF/mozilla.rsa"===r.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml")){switch(r.filename.split("/")[0]){case"_rels":break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if("mimetype"===r.filename&&r.compressedSize===r.uncompressedSize){switch(await e.readToken(new Token.StringType(r.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}}await e.ignore(r.compressedSize)}}catch(e){if(!(e instanceof strtok3.EndOfStreamError))throw e}return{ext:"zip",mime:"application/zip"}}if(a("OggS")){await e.ignore(28);const t=Buffer.alloc(8);return await e.readBuffer(t),_check(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(t,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(r([80,75])&&(3===t[2]||5===t[2]||7===t[2])&&(4===t[3]||6===t[3]||8===t[3]))return{ext:"zip",mime:"application/zip"};if(a("ftyp",{offset:4})&&0!=(96&t[8])){const e=uint8ArrayUtf8ByteString(t,8,12).replace("\0"," ").trim();switch(e){case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return e.startsWith("3g")?e.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(a("MThd"))return{ext:"mid",mime:"audio/midi"};if(a("wOFF")&&(r([0,1,0,0],{offset:4})||a("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(a("wOF2")&&(r([0,1,0,0],{offset:4})||a("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(r([212,195,178,161])||r([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(a("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(a("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(a("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(r([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(a("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(a("%PDF")){return await((t,r)=>_checkSequence(t,e,r))("Adobe Illustrator",1350)?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(r([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(r([73,73,42,0]))return a("CR",{offset:8})?{ext:"cr2",mime:"image/x-canon-cr2"}:r([28,0,254,0],{offset:8})?{ext:"nef",mime:"image/x-nikon-nef"}:r([8,0,0,0],{offset:4})&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8}))?{ext:"dng",mime:"image/x-adobe-dng"}:(t=Buffer.alloc(24),await e.peekBuffer(t),(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})?{ext:"arw",mime:"image/x-sony-arw"}:{ext:"tif",mime:"image/tiff"});if(r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(a("MAC "))return{ext:"ape",mime:"audio/ape"};if(r([26,69,223,163])){async function n(){const t=await e.peekNumber(Token.UINT8);let r=128,a=0;for(;0==(t&r);)++a,r>>=1;const n=Buffer.alloc(a+1);return await e.readBuffer(n),n}async function i(){const e=await n(),t=await n();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}const t=await i();switch(await async function(t,r){for(;r>0;){const t=await i();if(17026===t.id)return e.readToken(new Token.StringType(t.len,"utf-8"));await e.ignore(t.len),--r}}(0,t.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(a("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(r([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(a("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(a("MSCF")||a("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(r([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(r([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(a("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(a("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(r([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(a("IMPM"))return{ext:"it",mime:"audio/x-it"};if(r([0,0,1,186])){if(r([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(r([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(r([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(a("<?xml "))return{ext:"xml",mime:"application/xml"};if(a("BEGIN:"))return{ext:"ics",mime:"text/calendar"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([82,97,114,33,26,7])&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(a("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(a("!<arch>")){return await e.ignore(8),"debian-binary"===await e.readToken(new Token.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(r([137,80,78,71,13,10,26,10])){async function s(){return{length:await e.readToken(Token.INT32_BE),type:await e.readToken(new Token.StringType(4,"binary"))}}await e.ignore(8);do{const t=await s();switch(t.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(t.length+4)}}while(e.position<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(r([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(r([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(r([102,114,101,101],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(r([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(r([48,38,178,117,142,102,207,17,166,217])){async function o(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:await e.readToken(Token.UINT64_LE)}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const t=await o();let r=t.size-24;if(_check(t.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const t=Buffer.alloc(16);if(r-=await e.readBuffer(t),_check(t,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"wma",mime:"audio/x-ms-wma"};if(_check(t,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"wmv",mime:"video/x-ms-asf"};break}await e.ignore(r)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((r([126,16,4])||r([126,24,4]))&&r([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(r([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(r([0,0,0,12,106,80,32,32,13,10,135,10])){switch(await e.ignore(20),await e.readToken(new Token.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(r([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(r([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(r([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(t,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),a("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(a("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(a("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(r([48,48,48,48,48,48],{offset:148,mask:[248,248,248,248,248,248]})&&tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([208,207,17,224,161,177,26,225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62]))return{ext:"msi",mime:"application/x-msi"};if(r([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(a("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(r([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(r([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(r([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(r([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(await e.peekBuffer(t,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),r([48,48,48,48,48,48],{offset:148,mask:[248,248,248,248,248,248]})&&tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};for(let e=0;e<2&&e<t.length-16;e++)if(t.length>=e+2&&r([255,224],{offset:e,mask:[255,224]})){if(r([16],{offset:e+1,mask:[22]}))return r([8],{offset:e+1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(r([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}const stream=readableStream=>new Promise((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",async()=>{const e=new stream.PassThrough;let t;t=stream.pipeline?stream.pipeline(readableStream,e,()=>{}):readableStream.pipe(e);const r=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0);try{const t=await fromBuffer(r);e.fileType=t}catch(e){reject(e)}resolve(t)})}),fileType={fromStream:fromStream,fromTokenizer:fromTokenizer,fromBuffer:fromBuffer,stream:stream};Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)}),module.exports=fileType}).call(this,__webpack_require__(2).Buffer)},function(e,t,r){e.exports=n;var a=r(26).EventEmitter;function n(){a.call(this)}r(11)(n,a),n.Readable=r(27),n.Writable=r(91),n.Duplex=r(92),n.Transform=r(93),n.PassThrough=r(94),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",o),r.on("close",c));var s=!1;function o(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===a.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",u),e.on("error",u),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},function(e,t,r){"use strict";(function(t,a){var n=r(19);e.exports=T;var i,s=r(31);T.ReadableState=b;r(26).EventEmitter;var o=function(e,t){return e.listeners(t).length},c=r(36),u=r(20).Buffer,l=t.Uint8Array||function(){};var d=r(16);d.inherits=r(11);var f=r(84),p=void 0;p=f&&f.debuglog?f.debuglog("stream"):function(){};var m,h=r(85),g=r(37);d.inherits(T,c);var y=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var a=t instanceof(i=i||r(12));this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,s=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(m||(m=r(38).StringDecoder),this.decoder=new m(e.encoding),this.encoding=e.encoding)}function T(e){if(i=i||r(12),!(this instanceof T))return new T(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function w(e,t,r,a,n){var i,s=e._readableState;null===t?(s.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,E(e)}(e,s)):(n||(i=function(e,t){var r;a=t,u.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var a;return r}(s,t)),i?e.emit("error",i):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),a?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):k(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?k(e,s,t,!1):C(e,s)):k(e,s,t,!1))):a||(s.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(s)}function k(e,t,r,a){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,a?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),C(e,t)}Object.defineProperty(T.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),T.prototype.destroy=g.destroy,T.prototype._undestroy=g.undestroy,T.prototype._destroy=function(e,t){this.push(null),t(e)},T.prototype.push=function(e,t){var r,a=this._readableState;return a.objectMode?r=!0:"string"==typeof e&&((t=t||a.defaultEncoding)!==a.encoding&&(e=u.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},T.prototype.unshift=function(e){return w(this,e,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(e){return m||(m=r(38).StringDecoder),this._readableState.decoder=new m(e),this._readableState.encoding=e,this};var v=8388608;function I(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=v?e=v:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){p("emit readable"),e.emit("readable"),x(e)}function C(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(_,e,t))}function _(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(p("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function A(e){p("readable nexttick read 0"),e.read(0)}function B(e,t){t.reading||(p("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),x(e),t.flowing&&!t.reading&&e.read(0)}function x(e){var t=e._readableState;for(p("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var a;e<t.head.data.length?(a=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):a=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,a=1,n=r.data;e-=n.length;for(;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(s===i.length?n+=i:n+=i.slice(0,e),0===(e-=s)){s===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(s));break}++a}return t.length-=a,n}(e,t):function(e,t){var r=u.allocUnsafe(e),a=t.head,n=1;a.data.copy(r),e-=a.data.length;for(;a=a.next;){var i=a.data,s=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,s),0===(e-=s)){s===i.length?(++n,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=i.slice(s));break}++n}return t.length-=n,r}(e,t);return a}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(D,t,e))}function D(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var r=0,a=e.length;r<a;r++)if(e[r]===t)return r;return-1}T.prototype.read=function(e){p("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):E(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&P(this),null;var a,n=t.needReadable;return p("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&p("length less than watermark",n=!0),t.ended||t.reading?p("reading or ended",n=!1):n&&(p("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=I(r,t))),null===(a=e>0?F(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==a&&this.emit("data",a),a},T.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},T.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,p("pipe count=%d opts=%j",i.pipesCount,t);var c=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?l:T;function u(t,a){p("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,p("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",d),e.removeListener("error",g),e.removeListener("unpipe",u),r.removeListener("end",l),r.removeListener("end",T),r.removeListener("data",h),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function l(){p("onend"),e.end()}i.endEmitted?n.nextTick(c):r.once("end",c),e.on("unpipe",u);var d=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,x(e))}}(r);e.on("drain",d);var f=!1;var m=!1;function h(t){p("ondata"),m=!1,!1!==e.write(t)||m||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==M(i.pipes,e))&&!f&&(p("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,m=!0),r.pause())}function g(t){p("onerror",t),T(),e.removeListener("error",g),0===o(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",b),T()}function b(){p("onfinish"),e.removeListener("close",y),T()}function T(){p("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",g),e.once("close",y),e.once("finish",b),e.emit("pipe",r),i.flowing||(p("pipe resume"),r.resume()),e},T.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)a[i].emit("unpipe",this,r);return this}var s=M(t.pipes,e);return-1===s?this:(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)},T.prototype.on=function(e,t){var r=c.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var a=this._readableState;a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.emittedReadable=!1,a.reading?a.length&&E(this):n.nextTick(A,this))}return r},T.prototype.addListener=T.prototype.on,T.prototype.resume=function(){var e=this._readableState;return e.flowing||(p("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(B,e,t))}(this,e)),this},T.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},T.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",function(){if(p("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(n){(p("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(a=!0,e.pause()))}),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i<y.length;i++)e.on(y[i],this.emit.bind(this,y[i]));return this._read=function(t){p("wrapped _read",t),a&&(a=!1,e.resume())},this},Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),T._fromList=F}).call(this,r(10),r(9))},function(e,t,r){e.exports=r(26).EventEmitter},function(e,t,r){"use strict";var a=r(19);function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return i||s?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(n,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(n,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";var a=r(20).Buffer,n=a.isEncoding||function(e){switch((e=""+e)&&e.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}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(a.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=a.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var a=t.length-1;if(a<r)return 0;var n=s(t[a]);if(n>=0)return n>0&&(e.lastNeed=n-1),n;if(--a<r||-2===n)return 0;if((n=s(t[a]))>=0)return n>0&&(e.lastNeed=n-2),n;if(--a<r||-2===n)return 0;if((n=s(t[a]))>=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";e.exports=s;var a=r(12),n=r(16);function i(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(!a)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);a.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){c(e,t,r)}):c(this,null,null)}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}n.inherits=r(11),n.inherits(s,a),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,r){var a=this._transformState;if(a.writecb=r,a.writechunk=e,a.writeencoding=t,!a.transforming){var n=this._readableState;(a.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var r=this;a.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e){this.str=e}static fromBin(e,t=0){return new r(this.decode(e,t))}static decode(e,t=0){return(e.readUInt32LE(t).toString(16)+"-"+e.readUInt16LE(t+4).toString(16)+"-"+e.readUInt16LE(t+6).toString(16)+"-"+e.readUInt16BE(t+8).toString(16)+"-"+e.slice(t+10,t+16).toString("hex")).toUpperCase()}static decodeMediaType(e){switch(e.str){case r.AudioMedia.str:return"audio";case r.VideoMedia.str:return"video";case r.CommandMedia.str:return"command";case r.Degradable_JPEG_Media.str:return"degradable-jpeg";case r.FileTransferMedia.str:return"file-transfer";case r.BinaryMedia.str:return"binary"}}static encode(t){const r=e.alloc(16);return r.writeUInt32LE(parseInt(t.slice(0,8),16),0),r.writeUInt16LE(parseInt(t.slice(9,13),16),4),r.writeUInt16LE(parseInt(t.slice(14,18),16),6),e.from(t.slice(19,23),"hex").copy(r,8),e.from(t.slice(24),"hex").copy(r,10),r}equals(e){return this.str===e.str}toBin(){return r.encode(this.str)}}t.default=r,r.HeaderObject=new r("75B22630-668E-11CF-A6D9-00AA0062CE6C"),r.DataObject=new r("75B22636-668E-11CF-A6D9-00AA0062CE6C"),r.SimpleIndexObject=new r("33000890-E5B1-11CF-89F4-00A0C90349CB"),r.IndexObject=new r("D6E229D3-35DA-11D1-9034-00A0C90349BE"),r.MediaObjectIndexObject=new r("FEB103F8-12AD-4C64-840F-2A1D2F7AD48C"),r.TimecodeIndexObject=new r("3CB73FD0-0C4A-4803-953D-EDF7B6228F0C"),r.FilePropertiesObject=new r("8CABDCA1-A947-11CF-8EE4-00C00C205365"),r.StreamPropertiesObject=new r("B7DC0791-A9B7-11CF-8EE6-00C00C205365"),r.HeaderExtensionObject=new r("5FBF03B5-A92E-11CF-8EE3-00C00C205365"),r.CodecListObject=new r("86D15240-311D-11D0-A3A4-00A0C90348F6"),r.ScriptCommandObject=new r("1EFB1A30-0B62-11D0-A39B-00A0C90348F6"),r.MarkerObject=new r("F487CD01-A951-11CF-8EE6-00C00C205365"),r.BitrateMutualExclusionObject=new r("D6E229DC-35DA-11D1-9034-00A0C90349BE"),r.ErrorCorrectionObject=new r("75B22635-668E-11CF-A6D9-00AA0062CE6C"),r.ContentDescriptionObject=new r("75B22633-668E-11CF-A6D9-00AA0062CE6C"),r.ExtendedContentDescriptionObject=new r("D2D0A440-E307-11D2-97F0-00A0C95EA850"),r.ContentBrandingObject=new r("2211B3FA-BD23-11D2-B4B7-00A0C955FC6E"),r.StreamBitratePropertiesObject=new r("7BF875CE-468D-11D1-8D82-006097C9A2B2"),r.ContentEncryptionObject=new r("2211B3FB-BD23-11D2-B4B7-00A0C955FC6E"),r.ExtendedContentEncryptionObject=new r("298AE614-2622-4C17-B935-DAE07EE9289C"),r.DigitalSignatureObject=new r("2211B3FC-BD23-11D2-B4B7-00A0C955FC6E"),r.PaddingObject=new r("1806D474-CADF-4509-A4BA-9AABCB96AAE8"),r.ExtendedStreamPropertiesObject=new r("14E6A5CB-C672-4332-8399-A96952065B5A"),r.AdvancedMutualExclusionObject=new r("A08649CF-4775-4670-8A16-6E35357566CD"),r.GroupMutualExclusionObject=new r("D1465A40-5A79-4338-B71B-E36B8FD6C249"),r.StreamPrioritizationObject=new r("D4FED15B-88D3-454F-81F0-ED5C45999E24"),r.BandwidthSharingObject=new r("A69609E6-517B-11D2-B6AF-00C04FD908E9"),r.LanguageListObject=new r("7C4346A9-EFE0-4BFC-B229-393EDE415C85"),r.MetadataObject=new r("C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA"),r.MetadataLibraryObject=new r("44231C94-9498-49D1-A141-1D134E457054"),r.IndexParametersObject=new r("D6E229DF-35DA-11D1-9034-00A0C90349BE"),r.MediaObjectIndexParametersObject=new r("6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7"),r.TimecodeIndexParametersObject=new r("F55E496D-9797-4B5D-8C8B-604DFE9BFB24"),r.CompatibilityObject=new r("26F18B5D-4584-47EC-9F5F-0E651F0452C9"),r.AdvancedContentEncryptionObject=new r("43058533-6981-49E6-9B74-AD12CB86D58C"),r.AudioMedia=new r("F8699E40-5B4D-11CF-A8FD-00805F5C442B"),r.VideoMedia=new r("BC19EFC0-5B4D-11CF-A8FD-00805F5C442B"),r.CommandMedia=new r("59DACFC0-59E6-11D0-A3AC-00A0C90348F6"),r.JFIF_Media=new r("B61BE100-5B4E-11CF-A8FD-00805F5C442B"),r.Degradable_JPEG_Media=new r("35907DE0-E415-11CF-A917-00805F5C442B"),r.FileTransferMedia=new r("91BD222C-F21C-497A-8B6D-5AA86BFC0185"),r.BinaryMedia=new r("3AFB65E2-47EF-40F2-AC2C-70A90D71D343"),r.ASF_Index_Placeholder_Object=new r("D9AADE20-7C17-4F9C-BC28-8555DD98E2A2")}).call(this,r(2).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(15);class i{constructor(e){this.len=e}static fromBase64(t){return this.fromBuffer(e.from(t,"base64"))}static fromBuffer(e){return new i(e.length).get(e,0)}get(t,r){const i=n.AttachedPictureType[a.UINT32_BE.get(t,r)],s=a.UINT32_BE.get(t,r+=4),o=t.toString("utf-8",r+=4,r+s),c=a.UINT32_BE.get(t,r+=s),u=t.toString("utf-8",r+=4,r+c),l=a.UINT32_BE.get(t,r+=c),d=a.UINT32_BE.get(t,r+=4),f=a.UINT32_BE.get(t,r+=4),p=a.UINT32_BE.get(t,r+=4),m=a.UINT32_BE.get(t,r+=4);return{type:i,format:o,description:u,width:l,height:d,colour_depth:f,indexed_color:p,data:e.from(t.slice(r+=4,r+m))}}}t.VorbisPictureToken=i,t.CommonHeader={len:7,get:(e,t)=>({packetType:e.readUInt8(t),vorbis:new a.StringType(6,"ascii").get(e,t+1)})},t.IdentificationHeader={len:23,get:(e,t)=>({version:e.readUInt32LE(t+0),channelMode:e.readUInt8(t+4),sampleRate:e.readUInt32LE(t+5),bitrateMax:e.readUInt32LE(t+9),bitrateNominal:e.readUInt32LE(t+13),bitrateMin:e.readUInt32LE(t+17)})}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);t.VorbisDecoder=class{constructor(e,t){this.data=e,this.offset=t}readInt32(){const e=a.UINT32_LE.get(this.data,this.offset);return this.offset+=4,e}readStringUtf8(){const e=this.readInt32(),t=this.data.toString("utf8",this.offset,this.offset+e);return this.offset+=e,t}parseUserComment(){const e=this.offset,t=this.readStringUtf8(),r=t.indexOf("=");return{key:t.slice(0,r).toUpperCase(),value:t.slice(r+1),len:this.offset-e}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(5),i=r(4),s=r(1)("music-metadata:parser:MP4:atom");t.Header={len:8,get:(e,t)=>{const r=a.UINT32_BE.get(e,t);if(r<0)throw new Error("Invalid atom header length");return{length:r,name:new a.StringType(4,"binary").get(e,t+4)}},put:(e,t,r)=>(a.UINT32_BE.put(e,t,r.length),n.FourCcToken.put(e,t+4,r.name))},t.ExtendedSize=a.UINT64_BE,t.ftyp={len:4,get:(e,t)=>({type:new a.StringType(4,"ascii").get(e,t)})},t.tkhd={len:4,get:(e,t)=>({type:new a.StringType(4,"ascii").get(e,t)})},t.mhdr={len:8,get:(e,t)=>({version:a.UINT8.get(e,t+0),flags:a.UINT24_BE.get(e,t+1),nextItemID:a.UINT32_BE.get(e,t+4)})};class o{constructor(e,t,r){if(this.len=e,e<t)throw new Error(`Atom ${r} expected to be ${t}, but specifies ${e} bytes long.`);e>t&&s(`Warning: atom ${r} expected to be ${t}, but was actually ${e} bytes long.`)}}t.FixedLengthAtom=o;t.MdhdAtom=class extends o{constructor(e){super(e,24,"mdhd"),this.len=e}get(e,t){return{version:a.UINT8.get(e,t+0),flags:a.UINT24_BE.get(e,t+1),creationTime:a.UINT32_BE.get(e,t+4),modificationTime:a.UINT32_BE.get(e,t+8),timeScale:a.UINT32_BE.get(e,t+12),duration:a.UINT32_BE.get(e,t+16),language:a.UINT16_BE.get(e,t+20),quality:a.UINT16_BE.get(e,t+22)}}};t.MvhdAtom=class extends o{constructor(e){super(e,100,"mvhd"),this.len=e}get(e,t){return{version:a.UINT8.get(e,t),flags:a.UINT24_BE.get(e,t+1),creationTime:a.UINT32_BE.get(e,t+4),modificationTime:a.UINT32_BE.get(e,t+8),timeScale:a.UINT32_BE.get(e,t+12),duration:a.UINT32_BE.get(e,t+16),preferredRate:a.UINT32_BE.get(e,t+20),preferredVolume:a.UINT16_BE.get(e,t+24),previewTime:a.UINT32_BE.get(e,t+72),previewDuration:a.UINT32_BE.get(e,t+76),posterTime:a.UINT32_BE.get(e,t+80),selectionTime:a.UINT32_BE.get(e,t+84),selectionDuration:a.UINT32_BE.get(e,t+88),currentTime:a.UINT32_BE.get(e,t+92),nextTrackID:a.UINT32_BE.get(e,t+96)}}};t.DataAtom=class{constructor(e){this.len=e}get(e,t){return{type:{set:a.UINT8.get(e,t+0),type:a.UINT24_BE.get(e,t+1)},locale:a.UINT24_BE.get(e,t+4),value:new a.BufferType(this.len-8).get(e,t+8)}}};t.NameAtom=class{constructor(e){this.len=e}get(e,t){return{version:a.UINT8.get(e,t),flags:a.UINT24_BE.get(e,t+1),name:new a.StringType(this.len-4,"utf-8").get(e,t+4)}}};t.TrackHeaderAtom=class{constructor(e){this.len=e}get(e,t){return{version:a.UINT8.get(e,t),flags:a.UINT24_BE.get(e,t+1),creationTime:a.UINT32_BE.get(e,t+4),modificationTime:a.UINT32_BE.get(e,t+8),trackId:a.UINT32_BE.get(e,t+12),duration:a.UINT32_BE.get(e,t+20),layer:a.UINT16_BE.get(e,t+24),alternateGroup:a.UINT16_BE.get(e,t+26),volume:a.UINT16_BE.get(e,t+28)}}};const c={len:8,get:(e,t)=>({version:a.UINT8.get(e,t),flags:a.UINT24_BE.get(e,t+1),numberOfEntries:a.UINT32_BE.get(e,t+4)})};class u{constructor(e){this.len=e}get(e,t){return{dataFormat:n.FourCcToken.get(e,t),dataReferenceIndex:a.UINT16_BE.get(e,t+10),description:new a.BufferType(this.len-12).get(e,t+12)}}}t.StsdAtom=class{constructor(e){this.len=e}get(e,t){const r=c.get(e,t);t+=c.len;const n=[];for(let i=0;i<r.numberOfEntries;++i){const r=a.UINT32_BE.get(e,t);t+=a.UINT32_BE.len,n.push(new u(r).get(e,t)),t+=r}return{header:r,table:n}}},t.SoundSampleDescriptionVersion={len:8,get:(e,t)=>({version:a.INT16_BE.get(e,t),revision:a.INT16_BE.get(e,t+2),vendor:a.INT32_BE.get(e,t+4)})},t.SoundSampleDescriptionV0={len:12,get:(e,t)=>({numAudioChannels:a.INT16_BE.get(e,t+0),sampleSize:a.INT16_BE.get(e,t+2),compressionId:a.INT16_BE.get(e,t+4),packetSize:a.INT16_BE.get(e,t+6),sampleRate:a.UINT16_BE.get(e,t+8)+a.UINT16_BE.get(e,t+10)/1e4})};class l{constructor(e,t){this.len=e,this.token=t}get(e,t){const r=a.INT32_BE.get(e,t+4);return{version:a.INT8.get(e,t+0),flags:a.INT24_BE.get(e,t+1),numberOfEntries:r,entries:d(e,this.token,t+8,this.len-8,r)}}}t.TimeToSampleToken={len:8,get:(e,t)=>({count:a.INT32_BE.get(e,t+0),duration:a.INT32_BE.get(e,t+4)})};t.SttsAtom=class extends l{constructor(e){super(e,t.TimeToSampleToken),this.len=e}},t.SampleToChunkToken={len:12,get:(e,t)=>({firstChunk:a.INT32_BE.get(e,t),samplesPerChunk:a.INT32_BE.get(e,t+4),sampleDescriptionId:a.INT32_BE.get(e,t+8)})};t.StscAtom=class extends l{constructor(e){super(e,t.SampleToChunkToken),this.len=e}};t.StszAtom=class{constructor(e){this.len=e}get(e,t){const r=a.INT32_BE.get(e,t+8);return{version:a.INT8.get(e,t),flags:a.INT24_BE.get(e,t+1),sampleSize:a.INT32_BE.get(e,t+4),numberOfEntries:r,entries:d(e,a.INT32_BE,t+12,this.len-12,r)}}};t.StcoAtom=class extends l{constructor(e){super(e,a.INT32_BE),this.len=e}};function d(e,t,r,a,n){if(s(`remainingLen=${a}, numberOfEntries=${n} * token-len=${t.len}`),0===a)return[];i.equal(a,n*t.len,"mismatch number-of-entries with remaining atom-length");const o=[];for(let a=0;a<n;++a)o.push(t.get(e,r)),r+=t.len;return o}t.ChapterText=class{constructor(e){this.len=e}get(e,t){const r=a.INT16_BE.get(e,t+0);return new a.StringType(r,"utf-8").get(e,t+2)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.string=0]="string",e[e.uint=1]="uint",e[e.uid=2]="uid",e[e.bool=3]="bool",e[e.binary=4]="binary",e[e.float=5]="float"}(t.DataType||(t.DataType={})),function(e){e[e.shot=10]="shot",e[e.scene=20]="scene",e[e.track=30]="track",e[e.part=40]="part",e[e.album=50]="album",e[e.edition=60]="edition",e[e.collection=70]="collection"}(t.TargetType||(t.TargetType={})),function(e){e[e.video=1]="video",e[e.audio=2]="audio",e[e.complex=3]="complex",e[e.logo=4]="logo",e[e.subtitle=17]="subtitle",e[e.button=18]="button",e[e.control=32]="control"}(t.TrackType||(t.TrackType={}))},function(e,t,r){var a=r(46);self.addEventListener("message",function(e){var t=e.data;a.fetchFromUrl(t).then(function(e){var t=e.common,r=t.picture;self.postMessage({artist:t.artist,title:t.title,album:t.album,track:t.track.no,track_total:t.track.of,year:t.year,genre:t.genre?t.genre[0]:null,cover:r?URL.createObjectURL(new Blob([r[0].data.buffer])):null})})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(47),n=r(29),i=r(129),s=r(130),o=a("music-metadata-browser:main");var c=r(29);t.parseBuffer=c.parseBuffer,t.parseFromTokenizer=c.parseFromTokenizer,t.orderTags=c.orderTags,t.ratingToStars=c.ratingToStars,t.parseNodeStream=n.parseStream,t.parseReadableStream=async function(e,r,a){const n=new i.ReadableWebToNodeStream(e),s=await t.parseNodeStream(n,"string"==typeof r?{mimeType:r}:r,a);return await n.close(),s},t.parseBlob=async function(e,t){const r=await function(e){return new Promise((t,r)=>{const a=new FileReader;a.onloadend=e=>{let r=e.target.result;r instanceof ArrayBuffer&&(r=s(new Uint8Array(e.target.result))),t(r)},a.onerror=e=>{r(new Error(e.type))},a.onabort=e=>{r(new Error(e.type))},a.readAsArrayBuffer(e)})}(e),a={mimeType:e.type,size:e.size};return e.name&&(a.path=e.name),n.parseBuffer(r,{mimeType:e.type,size:e.size},t)},t.fetchFromUrl=async function(e,t){const r=await fetch(e),a={size:parseInt(r.headers.get("Content-Length"),10),mimeType:r.headers.get("Content-Type")};if(r.ok){if(r.body){const e=await this.parseReadableStream(r.body,a,t);return o("Closing HTTP-readable-stream..."),r.body.locked||await r.body.cancel(),o("HTTP-readable-stream closed."),e}return this.parseBlob(await r.blob(),t)}throw new Error(`HTTP error status=${r.status}: ${r.statusText}`)}},function(e,t,r){(function(a){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let a=0,n=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(a++,"%c"===e&&(n=a))}),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==a&&"env"in a&&(e=a.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(48)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(9))},function(e,t,r){e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return a.colors[Math.abs(t)%a.colors.length]}function a(e){let r;function s(...e){if(!s.enabled)return;const t=s,n=Number(new Date),i=n-(r||n);t.diff=i,t.prev=r,t.curr=n,r=n,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return r;o++;const i=a.formatters[n];if("function"==typeof i){const a=e[o];r=i.call(t,a),e.splice(o,1),o--}return r}),a.formatArgs.call(t,e),(t.log||a.log).apply(t,e)}return s.namespace=e,s.enabled=a.enabled(e),s.useColors=a.useColors(),s.color=t(e),s.destroy=n,s.extend=i,"function"==typeof a.init&&a.init(s),a.instances.push(s),s}function n(){const e=a.instances.indexOf(this);return-1!==e&&(a.instances.splice(e,1),!0)}function i(e,t){const r=a(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return a.debug=a,a.default=a,a.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},a.disable=function(){const e=[...a.names.map(s),...a.skips.map(s).map(e=>"-"+e)].join(",");return a.enable(""),e},a.enable=function(e){let t;a.save(e),a.names=[],a.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length;for(t=0;t<n;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?a.skips.push(new RegExp("^"+e.substr(1)+"$")):a.names.push(new RegExp("^"+e+"$")));for(t=0;t<a.instances.length;t++){const e=a.instances[t];e.enabled=a.enabled(e.namespace)}},a.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=a.skips.length;t<r;t++)if(a.skips[t].test(e))return!1;for(t=0,r=a.names.length;t<r;t++)if(a.names[t].test(e))return!0;return!1},a.humanize=r(49),Object.keys(e).forEach(t=>{a[t]=e[t]}),a.instances=[],a.names=[],a.skips=[],a.formatters={},a.selectColor=t,a.enable(a.load()),a}},function(e,t){var r=1e3,a=60*r,n=60*a,i=24*n,s=7*i,o=365.25*i;function c(e,t,r,a){var n=t>=1.5*r;return Math.round(e/r)+" "+a+(n?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var c=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*a;case"seconds":case"second":case"secs":case"sec":case"s":return c*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=i)return c(e,t,i,"day");if(t>=n)return c(e,t,n,"hour");if(t>=a)return c(e,t,a,"minute");if(t>=r)return c(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=i)return Math.round(e/i)+"d";if(t>=n)return Math.round(e/n)+"h";if(t>=a)return Math.round(e/a)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(52),n=r(17),i=r(55)("strtok3:ReadStreamTokenizer"),s=1e6;t.ReadStreamTokenizer=class extends a.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new n.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){let r=0,a=e.length;if(t){if(Number.isInteger(t.length)?a=t.length:a-=t.offset||0,t.position){const r=t.position-this.position;if(r>0)return await this.ignore(r),this.readBuffer(e,t);if(r<0)throw new Error("`options.position` can be less than `tokenizer.position`")}t.offset&&(r=t.offset)}if(0===a)return 0;const i=await this.streamReader.read(e,r,a);if(this.position+=i,(!t||!t.mayBeLess)&&i<a)throw new n.EndOfStreamError;return i}async peekBuffer(t,r){let a,i=0,s=t.length;if(r&&(r.offset&&(i=r.offset),Number.isInteger(r.length)?s=r.length:s-=r.offset||0,r.position)){const n=r.position-this.position;if(n>0){const o=e.alloc(s+n);return a=await this.peekBuffer(o,{mayBeLess:r.mayBeLess}),o.copy(t,i,n),a-n}if(n<0)throw new Error("Cannot peek from a negative offset in a stream")}if(a=await this.streamReader.peek(t,i,s),(!r||!r.mayBeLess)&&a<s)throw new n.EndOfStreamError;return a}async ignore(t){i(`ignore ${this.position}...${this.position+t-1}`);const r=Math.min(s,t),a=e.alloc(r);let n=0;for(;n<t;){const e=t-n,i=await this.readBuffer(a,{length:Math.min(r,e)});if(i<0)return i;n+=i}return n}}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,a=u(e),s=a[0],o=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,o)),l=0,d=o>0?s-4:s;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],s=0,o=r-n;s<o;s+=16383)i.push(l(e,s,s+16383>o?o:s+16383));1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=s.length;o<c;++o)a[o]=s[o],n[s.charCodeAt(o)]=o;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var n,i,s=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(a[(i=n)>>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(17);t.AbstractTokenizer=class{constructor(t){this.position=0,this.numBuffer=e.alloc(10),this.fileInfo=t||{}}async readToken(t,r){const n=e.alloc(t.len);if(await this.readBuffer(n,{position:r})<t.len)throw new a.EndOfStreamError;return t.get(n,0)}async peekToken(t,r=this.position){const n=e.alloc(t.len);if(await this.peekBuffer(n,{position:r})<t.len)throw new a.EndOfStreamError;return t.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new a.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new a.EndOfStreamError;return e.get(this.numBuffer,0)}async close(){}}}).call(this,r(2).Buffer)},function(e,t,r){(function(e){var a=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},a=0;a<t.length;a++)r[t[a]]=Object.getOwnPropertyDescriptor(e,t[a]);return r},n=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(o(arguments[r]));return t.join(" ")}r=1;for(var a=arguments,i=a.length,s=String(e).replace(n,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(e){return"[Circular]"}default:return e}}),c=a[r];r<i;c=a[++r])h(c)||!w(c)?s+=" "+c:s+=" "+o(c);return s},t.deprecate=function(r,a){if(void 0!==e&&!0===e.noDeprecation)return r;if(void 0===e)return function(){return t.deprecate(r,a).apply(this,arguments)};var n=!1;return function(){if(!n){if(e.throwDeprecation)throw new Error(a);e.traceDeprecation?console.trace(a):console.error(a),n=!0}return r.apply(this,arguments)}};var i,s={};function o(e,r){var a={seen:[],stylize:u};return arguments.length>=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),m(r)?a.showHidden=r:r&&t._extend(a,r),b(a.showHidden)&&(a.showHidden=!1),b(a.depth)&&(a.depth=2),b(a.colors)&&(a.colors=!1),b(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=c),l(a,e,a.depth)}function c(e,t){var r=o.styles[t];return r?"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m":e}function u(e,t){return e}function l(e,r,a){if(e.customInspect&&r&&I(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return y(n)||(n=l(e,n,a)),n}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(h(t))return e.stylize("null","null")}(e,r);if(i)return i;var s=Object.keys(r),o=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),v(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return d(r);if(0===s.length){if(I(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(T(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return e.stylize(Date.prototype.toString.call(r),"date");if(v(r))return d(r)}var u,w="",E=!1,S=["{","}"];(p(r)&&(E=!0,S=["[","]"]),I(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return T(r)&&(w=" "+RegExp.prototype.toString.call(r)),k(r)&&(w=" "+Date.prototype.toUTCString.call(r)),v(r)&&(w=" "+d(r)),0!==s.length||E&&0!=r.length?a<0?T(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,a,n){for(var i=[],s=0,o=t.length;s<o;++s)A(t,String(s))?i.push(f(e,t,r,a,String(s),!0)):i.push("");return n.forEach(function(n){n.match(/^\d+$/)||i.push(f(e,t,r,a,n,!0))}),i}(e,r,a,o,s):s.map(function(t){return f(e,r,a,o,t,E)}),e.seen.pop(),function(e,t,r){if(e.reduce(function(e,t){return 0,t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,a,n,i){var s,o,c;if((c=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?o=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(o=e.stylize("[Setter]","special")),A(a,n)||(s="["+n+"]"),o||(e.seen.indexOf(c.value)<0?(o=h(r)?l(e,c.value,null):l(e,c.value,r-1)).indexOf("\n")>-1&&(o=i?o.split("\n").map(function(e){return"  "+e}).join("\n").substr(2):"\n"+o.split("\n").map(function(e){return"   "+e}).join("\n")):o=e.stylize("[Circular]","special")),b(s)){if(i&&n.match(/^\d+$/))return o;(s=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+o}function p(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function h(e){return null===e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function b(e){return void 0===e}function T(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function k(e){return w(e)&&"[object Date]"===E(e)}function v(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function I(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(b(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var a=e.pid;s[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,a,e)}}else s[r]=function(){};return s[r]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=m,t.isNull=h,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=T,t.isObject=w,t.isDate=k,t.isError=v,t.isFunction=I,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(54);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),C[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",_(),t.format.apply(t,arguments))},t.inherits=r(11),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e};var B="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function x(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(B&&e[B]){var t;if("function"!=typeof(t=e[B]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,B,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,a=new Promise(function(e,a){t=e,r=a}),n=[],i=0;i<arguments.length;i++)n.push(arguments[i]);n.push(function(e,a){e?r(e):t(a)});try{e.apply(this,n)}catch(e){r(e)}return a}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),B&&Object.defineProperty(t,B,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,a(e))},t.promisify.custom=B,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],a=0;a<arguments.length;a++)r.push(arguments[a]);var n=r.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var i=this,s=function(){return n.apply(i,arguments)};t.apply(this,r).then(function(t){e.nextTick(s,null,t)},function(t){e.nextTick(x,t,s)})}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,a(t)),r}}).call(this,r(9))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,r){(function(a){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let a=0,n=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(a++,"%c"===e&&(n=a))}),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==a&&"env"in a&&(e=a.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(56)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(9))},function(e,t,r){e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return a.colors[Math.abs(t)%a.colors.length]}function a(e){let r;function s(...e){if(!s.enabled)return;const t=s,n=Number(new Date),i=n-(r||n);t.diff=i,t.prev=r,t.curr=n,r=n,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return r;o++;const i=a.formatters[n];if("function"==typeof i){const a=e[o];r=i.call(t,a),e.splice(o,1),o--}return r}),a.formatArgs.call(t,e),(t.log||a.log).apply(t,e)}return s.namespace=e,s.enabled=a.enabled(e),s.useColors=a.useColors(),s.color=t(e),s.destroy=n,s.extend=i,"function"==typeof a.init&&a.init(s),a.instances.push(s),s}function n(){const e=a.instances.indexOf(this);return-1!==e&&(a.instances.splice(e,1),!0)}function i(e,t){const r=a(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return a.debug=a,a.default=a,a.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},a.disable=function(){const e=[...a.names.map(s),...a.skips.map(s).map(e=>"-"+e)].join(",");return a.enable(""),e},a.enable=function(e){let t;a.save(e),a.names=[],a.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length;for(t=0;t<n;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?a.skips.push(new RegExp("^"+e.substr(1)+"$")):a.names.push(new RegExp("^"+e+"$")));for(t=0;t<a.instances.length;t++){const e=a.instances[t];e.enabled=a.enabled(e.namespace)}},a.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=a.skips.length;t<r;t++)if(a.skips[t].test(e))return!1;for(t=0,r=a.names.length;t<r;t++)if(a.names[t].test(e))return!0;return!1},a.humanize=r(57),Object.keys(e).forEach(t=>{a[t]=e[t]}),a.instances=[],a.names=[],a.skips=[],a.formatters={},a.selectColor=t,a.enable(a.load()),a}},function(e,t){var r=1e3,a=60*r,n=60*a,i=24*n,s=7*i,o=365.25*i;function c(e,t,r,a){var n=t>=1.5*r;return Math.round(e/r)+" "+a+(n?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var c=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*a;case"seconds":case"second":case"secs":case"sec":case"s":return c*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=i)return c(e,t,i,"day");if(t>=n)return c(e,t,n,"hour");if(t>=a)return c(e,t,a,"minute");if(t>=r)return c(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=i)return Math.round(e/i)+"d";if(t>=n)return Math.round(e/n)+"h";if(t>=a)return Math.round(e/a)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(17);t.BufferTokenizer=class{constructor(e,t){this.buffer=e,this.position=0,this.fileInfo=t||{},this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` can be less than `tokenizer.position`");this.position=t.position}return this.peekBuffer(e,t).then(e=>(this.position+=e,e))}async peekBuffer(e,t){let r=0,n=e.length,i=this.position;if(t){if(t.position){if(t.position<this.position)throw new Error("`options.position` can be less than `tokenizer.position`");i=t.position}Number.isInteger(t.length)?n=t.length:n-=t.offset||0,t.offset&&(r=t.offset)}if(0===n)return Promise.resolve(0);i=i||this.position,n||(n=e.length);const s=Math.min(this.buffer.length-i,n);if(t&&t.mayBeLess||!(s<n))return this.buffer.copy(e,r,i,i+s),s;throw new a.EndOfStreamError}async readToken(e,t){this.position=t||this.position;try{const r=this.peekToken(e,this.position);return this.position+=e.len,r}catch(e){throw this.position+=this.buffer.length-t,e}}async peekToken(e,t=this.position){if(this.buffer.length-t<e.len)throw new a.EndOfStreamError;return e.get(this.buffer,t)}async readNumber(e){return this.readToken(e)}async peekNumber(e){return this.peekToken(e)}async ignore(e){const t=Math.min(this.buffer.length-this.position,e);return this.position+=t,t}async close(){}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(33),n=r(62),i=r(63),s=r(1),o=r(66),c=r(80),u=r(13),l=r(95),d=r(98),f=r(99),p=r(101),m=r(103),h=r(109),g=r(116),y=r(119),b=r(121),T=r(123),w=r(125),k=s("music-metadata:parser:factory");function v(e){const t=n.parse(e),r=i.parse(t.type);return{type:r.type,subtype:r.subtype,suffix:r.suffix,parameters:t.parameters}}t.parseHttpContentType=v;class I{static async parseOnContentType(e,t){const{mimeType:r,path:a,url:n}=await e.fileInfo,i=I.getParserIdForMimeType(r)||I.getParserIdForExtension(a)||I.getParserIdForExtension(n);return i||k("No parser found for MIME-type / extension: "+r),this.parse(e,i,t)}static async parse(t,r,n){if(!r){k("Guess parser on content...");const n=e.alloc(4100);if(await t.peekBuffer(n,{mayBeLess:!0}),t.fileInfo.path&&(r=this.getParserIdForExtension(t.fileInfo.path)),!r){const e=await a.fromBuffer(n);if(!e)throw new Error("Failed to determine audio format");if(k(`Guessed file type is mime=${e.mime}, extension=${e.ext}`),!(r=I.getParserIdForMimeType(e.mime)))throw new Error("Guessed MIME-type not supported: "+e.mime)}}return this._parse(t,r,n)}static getParserIdForExtension(e){if(!e)return;switch(this.getExtension(e).toLocaleLowerCase()||e){case".mp2":case".mp3":case".m2a":case".aac":return"mpeg";case".ape":return"apev2";case".mp4":case".m4a":case".m4b":case".m4pa":case".m4v":case".m4r":case".3gp":return"mp4";case".wma":case".wmv":case".asf":return"asf";case".flac":return"flac";case".ogg":case".ogv":case".oga":case".ogm":case".ogx":case".opus":case".spx":return"ogg";case".aif":case".aiff":case".aifc":return"aiff";case".wav":return"riff";case".wv":case".wvp":return"wavpack";case".mpc":return"musepack";case".dsf":return"dsf";case".dff":return"dsdiff";case".mka":case".mkv":case".mk3d":case".mks":case".webm":return"matroska"}}static async loadParser(e){switch(e){case"aiff":return new c.AIFFParser;case"apev2":return new u.APEv2Parser;case"asf":return new l.AsfParser;case"dsf":return new b.DsfParser;case"dsdiff":return new T.DsdiffParser;case"flac":return new d.FlacParser;case"mp4":return new f.MP4Parser;case"mpeg":return new p.MpegParser;case"musepack":return new m.default;case"ogg":return new h.OggParser;case"riff":return new g.WaveParser;case"wavpack":return new y.WavPackParser;case"matroska":return new w.MatroskaParser;default:throw new Error(`Unknown parser type: ${e}`)}}static async _parse(e,t,r={}){const a=await I.loadParser(t),n=new o.MetadataCollector(r);return await a.init(n,e,r).parse(),n.toCommonMetadata()}static getExtension(e){const t=e.lastIndexOf(".");return-1===t?"":e.slice(t)}static getParserIdForMimeType(e){let t;try{t=v(e)}catch(t){return void k(`Invalid HTTP Content-Type header value: ${e}`)}const r=0===t.subtype.indexOf("x-")?t.subtype.substring(2):t.subtype;switch(t.type){case"audio":switch(r){case"mp3":case"mpeg":return"mpeg";case"flac":return"flac";case"ape":case"monkeys-audio":return"apev2";case"mp4":case"aac":case"aacp":case"m4a":return"mp4";case"ogg":case"opus":case"speex":return"ogg";case"ms-wma":case"ms-wmv":case"ms-asf":return"asf";case"aiff":case"aif":case"aifc":return"aiff";case"vnd.wave":case"wav":case"wave":return"riff";case"wavpack":return"wavpack";case"musepack":return"musepack";case"matroska":case"webm":return"matroska";case"dsf":return"dsf"}break;case"video":switch(r){case"ms-asf":case"ms-wmv":return"asf";case"m4v":case"mp4":return"mp4";case"ogg":return"ogg";case"matroska":case"webm":return"matroska"}break;case"application":switch(r){case"vnd.ms-asf":return"asf";case"ogg":return"ogg"}}}}t.ParserFactory=I}).call(this,r(2).Buffer)},function(e,t,r){"use strict";t.stringToBytes=e=>[...e].map(e=>e.charCodeAt(0));const a=(e,t,r)=>String.fromCharCode(...e.slice(t,r));t.tarHeaderChecksumMatches=e=>{if(e.length<512)return!1;let t=256,r=0;for(let a=0;a<148;a++){const n=e[a];t+=n,r+=128&n}for(let a=156;a<512;a++){const n=e[a];t+=n,r+=128&n}const n=parseInt(a(e,148,154),8);return n===t||n===t-(r<<1)},t.uint8ArrayUtf8ByteString=a,t.uint32SyncSafeToken={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4}},function(e,t,r){"use strict";e.exports={extensions:["jpg","png","apng","gif","webp","flif","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","jxr","psd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","msi","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","wmv","wma","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-wma","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-msi","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/ktx","application/dicom","audio/x-musepack","text/calendar","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P"]}},function(e,t,r){"use strict";var a=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,s=/\\([\u000b\u0020-\u00ff])/g,o=/([\\"])/g,c=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function u(e){var t=String(e);if(i.test(t))return t;if(t.length>0&&!n.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(o,"\\$1")+'"'}function l(e){this.parameters=Object.create(null),this.type=e}t.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!c.test(r))throw new TypeError("invalid type");var a=r;if(t&&"object"==typeof t)for(var n,s=Object.keys(t).sort(),o=0;o<s.length;o++){if(n=s[o],!i.test(n))throw new TypeError("invalid parameter name");a+="; "+n+"="+u(t[n])}return a},t.parse=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=-1!==r?t.substr(0,r).trim():t.trim();if(!c.test(n))throw new TypeError("invalid media type");var i=new l(n.toLowerCase());if(-1!==r){var o,u,d;for(a.lastIndex=r;u=a.exec(t);){if(u.index!==r)throw new TypeError("invalid parameter format");r+=u[0].length,o=u[1].toLowerCase(),'"'===(d=u[2])[0]&&(d=d.substr(1,d.length-2).replace(s,"$1")),i.parameters[o]=d}if(r!==t.length)throw new TypeError("invalid parameter format")}return i}},function(e,t,r){"use strict";var a=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/,n=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/,i=/^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;function s(e,t,r){this.type=e,this.subtype=t,this.suffix=r}t.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.subtype,r=e.suffix,i=e.type;if(!i||!n.test(i))throw new TypeError("invalid type");if(!t||!a.test(t))throw new TypeError("invalid subtype");var s=i+"/"+t;if(r){if(!n.test(r))throw new TypeError("invalid suffix");s+="+"+r}return s},t.parse=function(e){if(!e)throw new TypeError("argument string is required");if("string"!=typeof e)throw new TypeError("argument string is required to be a string");var t=i.exec(e.toLowerCase());if(!t)throw new TypeError("invalid media type");var r,a=t[1],n=t[2],o=n.lastIndexOf("+");-1!==o&&(r=n.substr(o+1),n=n.substr(0,o));return new s(a,n,r)},t.test=function(e){if(!e)throw new TypeError("argument string is required");if("string"!=typeof e)throw new TypeError("argument string is required to be a string");return i.test(e.toLowerCase())}},function(e,t,r){e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return a.colors[Math.abs(t)%a.colors.length]}function a(e){let r;function s(...e){if(!s.enabled)return;const t=s,n=Number(new Date),i=n-(r||n);t.diff=i,t.prev=r,t.curr=n,r=n,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return r;o++;const i=a.formatters[n];if("function"==typeof i){const a=e[o];r=i.call(t,a),e.splice(o,1),o--}return r}),a.formatArgs.call(t,e),(t.log||a.log).apply(t,e)}return s.namespace=e,s.enabled=a.enabled(e),s.useColors=a.useColors(),s.color=t(e),s.destroy=n,s.extend=i,"function"==typeof a.init&&a.init(s),a.instances.push(s),s}function n(){const e=a.instances.indexOf(this);return-1!==e&&(a.instances.splice(e,1),!0)}function i(e,t){const r=a(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return a.debug=a,a.default=a,a.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},a.disable=function(){const e=[...a.names.map(s),...a.skips.map(s).map(e=>"-"+e)].join(",");return a.enable(""),e},a.enable=function(e){let t;a.save(e),a.names=[],a.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length;for(t=0;t<n;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?a.skips.push(new RegExp("^"+e.substr(1)+"$")):a.names.push(new RegExp("^"+e+"$")));for(t=0;t<a.instances.length;t++){const e=a.instances[t];e.enabled=a.enabled(e.namespace)}},a.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=a.skips.length;t<r;t++)if(a.skips[t].test(e))return!1;for(t=0,r=a.names.length;t<r;t++)if(a.names[t].test(e))return!0;return!1},a.humanize=r(65),Object.keys(e).forEach(t=>{a[t]=e[t]}),a.instances=[],a.names=[],a.skips=[],a.formatters={},a.selectColor=t,a.enable(a.load()),a}},function(e,t){var r=1e3,a=60*r,n=60*a,i=24*n,s=7*i,o=365.25*i;function c(e,t,r,a){var n=t>=1.5*r;return Math.round(e/r)+" "+a+(n?"s":"")}e.exports=function(e,t){t=t||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var c=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*a;case"seconds":case"second":case"secs":case"sec":case"s":return c*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=i)return c(e,t,i,"day");if(t>=n)return c(e,t,n,"hour");if(t>=a)return c(e,t,a,"minute");if(t>=r)return c(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=i)return Math.round(e/i)+"d";if(t>=n)return Math.round(e/n)+"h";if(t>=a)return Math.round(e/a)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(23),n=r(1),i=r(67),s=r(68),o=r(8),c=r(3),u=r(33),l=n("music-metadata:collector"),d=["matroska","APEv2","vorbis","ID3v2.4","ID3v2.3","ID3v2.2","exif","asf","iTunes","ID3v1"];function f(e){return e.length>2?e.slice(0,e.length-1).join(", ")+" & "+e[e.length-1]:e.join(" & ")}t.MetadataCollector=class{constructor(e){this.opts=e,this.format={tagTypes:[],trackInfo:[]},this.native={},this.common={track:{no:null,of:null},disk:{no:null,of:null}},this.quality={warnings:[]},this.commonOrigin={},this.originPriority={},this.tagMapper=new s.CombinedTagMapper;let t=1;for(const e of d)this.originPriority[e]=t++;this.originPriority.artificial=500,this.originPriority.id3v1=600}hasAny(){return Object.keys(this.native).length>0}addStreamInfo(e){l(`streamInfo: type=${a.TrackType[e.type]}, codec=${e.codecName}`),this.format.trackInfo.push(e)}setFormat(e,t){l(`format: ${e} = ${t}`),this.format[e]=t,this.opts.observer&&this.opts.observer({metadata:this,tag:{type:"format",id:e,value:t}})}addTag(e,t,r){l(`tag ${e}.${t} = ${r}`),this.native[e]||(this.format.tagTypes.push(e),this.native[e]=[]),this.native[e].push({id:t,value:r}),this.toCommon(e,t,r)}addWarning(e){this.quality.warnings.push({message:e})}postMap(e,t){switch(t.id){case"artist":if(this.commonOrigin.artist===this.originPriority[e])return this.postMap("artificial",{id:"artists",value:t.value});this.common.artists||this.setGenericTag("artificial",{id:"artists",value:t.value});break;case"artists":if(!(this.common.artist&&this.commonOrigin.artist!==this.originPriority.artificial||this.common.artists&&-1!==this.common.artists.indexOf(t.value))){const e={id:"artist",value:f((this.common.artists||[]).concat([t.value]))};this.setGenericTag("artificial",e)}break;case"genre":t.value=o.CommonTagMapper.parseGenre(t.value);break;case"picture":return void this.postFixPicture(t.value).then(r=>{null!==r&&(t.value=r,this.setGenericTag(e,t))});case"totaltracks":return void(this.common.track.of=o.CommonTagMapper.toIntOrNull(t.value));case"totaldiscs":return void(this.common.disk.of=o.CommonTagMapper.toIntOrNull(t.value));case"track":case"disk":const r=this.common[t.id].of;return this.common[t.id]=o.CommonTagMapper.normalizeTrack(t.value),void(this.common[t.id].of=null!=r?r:this.common[t.id].of);case"year":case"originalyear":t.value=parseInt(t.value,10);break;case"date":const a=parseInt(t.value.substr(0,4),10);isNaN(a)||(this.common.year=a);break;case"discogs_label_id":case"discogs_release_id":case"discogs_master_release_id":case"discogs_artist_id":case"discogs_votes":t.value="string"==typeof t.value?parseInt(t.value,10):t.value;break;case"replaygain_track_gain":case"replaygain_track_peak":case"replaygain_album_gain":case"replaygain_album_peak":t.value=c.toRatio(t.value);break;case"replaygain_track_minmax":t.value=t.value.split(",").map(e=>parseInt(e,10));break;case"replaygain_undo":const n=t.value.split(",").map(e=>parseInt(e,10));t.value={leftChannel:n[0],rightChannel:n[1]};break;case"gapless":t.value="1"===t.value;break;case"isrc":if(this.common[t.id]&&-1!==this.common[t.id].indexOf(t.value))return}null!==t.value&&this.setGenericTag(e,t)}toCommonMetadata(){return{format:this.format,native:this.native,quality:this.quality,common:this.common}}async postFixPicture(e){if(e.data.length>0){if(!e.format){const t=await u.fromBuffer(e.data);if(!t)return null;e.format=t.mime}switch(e.format=e.format.toLocaleLowerCase(),e.format){case"image/jpg":e.format="image/jpeg"}return e}return this.addWarning("Empty picture tag found"),null}toCommon(e,t,r){const a={id:t,value:r},n=this.tagMapper.mapTag(e,a,this);n&&this.postMap(e,n)}setGenericTag(e,t){l(`common.${t.id} = ${t.value}`);const r=this.commonOrigin[t.id]||1e3,a=this.originPriority[e];if(i.isSingleton(t.id)){if(!(a<=r))return l(`Ignore native tag (singleton): ${e}.${t.id} = ${t.value}`);this.common[t.id]=t.value,this.commonOrigin[t.id]=a}else if(a===r)i.isUnique(t.id)&&-1!==this.common[t.id].indexOf(t.value)?l(`Ignore duplicate value: ${e}.${t.id} = ${t.value}`):this.common[t.id].push(t.value);else{if(!(a<r))return l(`Ignore native tag (list): ${e}.${t.id} = ${t.value}`);this.common[t.id]=[t.value],this.commonOrigin[t.id]=a}this.opts.observer&&this.opts.observer({metadata:this,tag:{type:"common",id:t.id,value:t.value}})}},t.joinArtists=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commonTags={year:{multiple:!1},track:{multiple:!1},disk:{multiple:!1},title:{multiple:!1},artist:{multiple:!1},artists:{multiple:!0,unique:!0},albumartist:{multiple:!1},album:{multiple:!1},date:{multiple:!1},originaldate:{multiple:!1},originalyear:{multiple:!1},comment:{multiple:!0,unique:!1},genre:{multiple:!0,unique:!0},picture:{multiple:!0,unique:!0},composer:{multiple:!0,unique:!0},lyrics:{multiple:!0,unique:!1},albumsort:{multiple:!1,unique:!0},titlesort:{multiple:!1,unique:!0},work:{multiple:!1,unique:!0},artistsort:{multiple:!1,unique:!0},albumartistsort:{multiple:!1,unique:!0},composersort:{multiple:!0,unique:!0},lyricist:{multiple:!0,unique:!0},writer:{multiple:!0,unique:!0},conductor:{multiple:!0,unique:!0},remixer:{multiple:!0,unique:!0},arranger:{multiple:!0,unique:!0},engineer:{multiple:!0,unique:!0},producer:{multiple:!0,unique:!0},technician:{multiple:!0,unique:!0},djmixer:{multiple:!0,unique:!0},mixer:{multiple:!0,unique:!0},label:{multiple:!0,unique:!0},grouping:{multiple:!1},subtitle:{multiple:!1},discsubtitle:{multiple:!1},totaltracks:{multiple:!1},totaldiscs:{multiple:!1},compilation:{multiple:!1},rating:{multiple:!0},bpm:{multiple:!1},mood:{multiple:!1},media:{multiple:!1},catalognumber:{multiple:!0,unique:!0},tvShow:{multiple:!1},tvShowSort:{multiple:!1},tvSeason:{multiple:!1},tvEpisode:{multiple:!1},tvEpisodeId:{multiple:!1},tvNetwork:{multiple:!1},podcast:{multiple:!1},podcasturl:{multiple:!1},releasestatus:{multiple:!1},releasetype:{multiple:!0},releasecountry:{multiple:!1},script:{multiple:!1},language:{multiple:!1},copyright:{multiple:!1},license:{multiple:!1},encodedby:{multiple:!1},encodersettings:{multiple:!1},gapless:{multiple:!1},barcode:{multiple:!1},isrc:{multiple:!0},asin:{multiple:!1},musicbrainz_recordingid:{multiple:!1},musicbrainz_trackid:{multiple:!1},musicbrainz_albumid:{multiple:!1},musicbrainz_artistid:{multiple:!0},musicbrainz_albumartistid:{multiple:!0},musicbrainz_releasegroupid:{multiple:!1},musicbrainz_workid:{multiple:!1},musicbrainz_trmid:{multiple:!1},musicbrainz_discid:{multiple:!1},acoustid_id:{multiple:!1},acoustid_fingerprint:{multiple:!1},musicip_puid:{multiple:!1},musicip_fingerprint:{multiple:!1},website:{multiple:!1},"performer:instrument":{multiple:!0,unique:!0},averageLevel:{multiple:!1},peakLevel:{multiple:!1},notes:{multiple:!0,unique:!1},key:{multiple:!1},originalalbum:{multiple:!1},originalartist:{multiple:!1},discogs_artist_id:{multiple:!0,unique:!0},discogs_release_id:{multiple:!1},discogs_label_id:{multiple:!1},discogs_master_release_id:{multiple:!1},discogs_votes:{multiple:!1},discogs_rating:{multiple:!1},replaygain_track_peak:{multiple:!1},replaygain_track_gain:{multiple:!1},replaygain_album_peak:{multiple:!1},replaygain_album_gain:{multiple:!1},replaygain_track_minmax:{multiple:!1},replaygain_album_minmax:{multiple:!1},replaygain_undo:{multiple:!1},description:{multiple:!0}},t.isSingleton=function(e){return t.commonTags.hasOwnProperty(e)&&!t.commonTags[e].multiple},t.isUnique=function(e){return!t.commonTags[e].multiple||t.commonTags[e].unique}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(69),n=r(72),i=r(73),s=r(74),o=r(75),c=r(76),u=r(77),l=r(78),d=r(79);t.CombinedTagMapper=class{constructor(){this.tagMappers={},[new a.ID3v1TagMapper,new s.ID3v22TagMapper,new n.ID3v24TagMapper,new c.MP4TagMapper,new c.MP4TagMapper,new u.VorbisTagMapper,new o.APEv2TagMapper,new i.AsfTagMapper,new l.RiffInfoTagMapper,new d.MatroskaTagMapper].forEach(e=>{this.registerTagMapper(e)})}mapTag(e,t,r){if(this.tagMappers[e])return this.tagMappers[e].mapGenericTag(t,r);throw new Error("No generic tag mapper defined for tag-format: "+e)}registerTagMapper(e){for(const t of e.tagTypes)this.tagMappers[t]=e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(8),n={title:"title",artist:"artist",album:"album",year:"year",comment:"comment",track:"track",genre:"genre"};t.ID3v1TagMapper=class extends a.CommonTagMapper{constructor(){super(["ID3v1"],n)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class a{static decode(e){let t="";for(const r in e)e.hasOwnProperty(r)&&(t+=a.codePointToString(a.singleByteDecoder(e[r])));return t}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(a.inRange(e,0,127))return e;const t=a.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}}t.Windows1292Decoder=a,a.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(5);function i(e){return{containsHeader:s(e,31),containsFooter:s(e,30),isHeader:s(e,31),readOnly:s(e,0),dataType:(6&e)>>1}}function s(e,t){return 0!=(e&1<<t)}!function(e){e[e.text_utf8=0]="text_utf8",e[e.binary=1]="binary",e[e.external_info=2]="external_info",e[e.reserved=3]="reserved"}(t.DataType||(t.DataType={})),t.DescriptorParser={len:52,get:(e,t)=>({ID:n.FourCcToken.get(e,t),version:a.UINT32_LE.get(e,t+4)/1e3,descriptorBytes:a.UINT32_LE.get(e,t+8),headerBytes:a.UINT32_LE.get(e,t+12),seekTableBytes:a.UINT32_LE.get(e,t+16),headerDataBytes:a.UINT32_LE.get(e,t+20),apeFrameDataBytes:a.UINT32_LE.get(e,t+24),apeFrameDataBytesHigh:a.UINT32_LE.get(e,t+28),terminatingDataBytes:a.UINT32_LE.get(e,t+32),fileMD5:new a.BufferType(16).get(e,t+36)})},t.Header={len:24,get:(e,t)=>({compressionLevel:a.UINT16_LE.get(e,t),formatFlags:a.UINT16_LE.get(e,t+2),blocksPerFrame:a.UINT32_LE.get(e,t+4),finalFrameBlocks:a.UINT32_LE.get(e,t+8),totalFrames:a.UINT32_LE.get(e,t+12),bitsPerSample:a.UINT16_LE.get(e,t+16),channel:a.UINT16_LE.get(e,t+18),sampleRate:a.UINT32_LE.get(e,t+20)})},t.TagFooter={len:32,get:(e,t)=>({ID:new a.StringType(8,"ascii").get(e,t),version:a.UINT32_LE.get(e,t+8),size:a.UINT32_LE.get(e,t+12),fields:a.UINT32_LE.get(e,t+16),flags:i(a.UINT32_LE.get(e,t+20))})},t.TagItemHeader={len:8,get:(e,t)=>({size:a.UINT32_LE.get(e,t),flags:i(a.UINT32_LE.get(e,t+4))})},t.TagField=e=>new a.BufferType(e.size-t.TagFooter.len),t.parseTagFlags=i,t.isBitSet=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(8),n=r(3),i=r(24),s={TIT2:"title",TPE1:"artist","TXXX:Artists":"artists",TPE2:"albumartist",TALB:"album",TDRV:"date",TORY:"originalyear",TPOS:"disk",TCON:"genre",APIC:"picture",TCOM:"composer","USLT:description":"lyrics",TSOA:"albumsort",TSOT:"titlesort",TOAL:"originalalbum",TSOP:"artistsort",TSO2:"albumartistsort",TSOC:"composersort",TEXT:"lyricist","TXXX:Writer":"writer",TPE3:"conductor",TPE4:"remixer","IPLS:arranger":"arranger","IPLS:engineer":"engineer","IPLS:producer":"producer","IPLS:DJ-mix":"djmixer","IPLS:mix":"mixer",TPUB:"label",TIT1:"grouping",TIT3:"subtitle",TRCK:"track",TCMP:"compilation",POPM:"rating",TBPM:"bpm",TMED:"media","TXXX:CATALOGNUMBER":"catalognumber","TXXX:MusicBrainz Album Status":"releasestatus","TXXX:MusicBrainz Album Type":"releasetype","TXXX:MusicBrainz Album Release Country":"releasecountry","TXXX:RELEASECOUNTRY":"releasecountry","TXXX:SCRIPT":"script",TLAN:"language",TCOP:"copyright",WCOP:"license",TENC:"encodedby",TSSE:"encodersettings","TXXX:BARCODE":"barcode",TSRC:"isrc","TXXX:ASIN":"asin","TXXX:originalyear":"originalyear","UFID:http://musicbrainz.org":"musicbrainz_recordingid","TXXX:MusicBrainz Release Track Id":"musicbrainz_trackid","TXXX:MusicBrainz Album Id":"musicbrainz_albumid","TXXX:MusicBrainz Artist Id":"musicbrainz_artistid","TXXX:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","TXXX:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","TXXX:MusicBrainz Work Id":"musicbrainz_workid","TXXX:MusicBrainz TRM Id":"musicbrainz_trmid","TXXX:MusicBrainz Disc Id":"musicbrainz_discid","TXXX:ACOUSTID_ID":"acoustid_id","TXXX:Acoustid Id":"acoustid_id","TXXX:Acoustid Fingerprint":"acoustid_fingerprint","TXXX:MusicIP PUID":"musicip_puid","TXXX:MusicMagic Fingerprint":"musicip_fingerprint",WOAR:"website",TDRC:"date",TYER:"year",TDOR:"originaldate","TIPL:arranger":"arranger","TIPL:engineer":"engineer","TIPL:producer":"producer","TIPL:DJ-mix":"djmixer","TIPL:mix":"mixer",TMOO:"mood",SYLT:"lyrics",TSST:"discsubtitle",TKEY:"key",COMM:"comment",TOPE:"originalartist","PRIV:AverageLevel":"averageLevel","PRIV:PeakLevel":"peakLevel","TXXX:DISCOGS_ARTIST_ID":"discogs_artist_id","TXXX:DISCOGS_ARTISTS":"artists","TXXX:DISCOGS_ARTIST_NAME":"artists","TXXX:DISCOGS_ALBUM_ARTISTS":"albumartist","TXXX:DISCOGS_CATALOG":"catalognumber","TXXX:DISCOGS_COUNTRY":"releasecountry","TXXX:DISCOGS_DATE":"originaldate","TXXX:DISCOGS_LABEL":"label","TXXX:DISCOGS_LABEL_ID":"discogs_label_id","TXXX:DISCOGS_MASTER_RELEASE_ID":"discogs_master_release_id","TXXX:DISCOGS_RATING":"discogs_rating","TXXX:DISCOGS_RELEASED":"date","TXXX:DISCOGS_RELEASE_ID":"discogs_release_id","TXXX:DISCOGS_VOTES":"discogs_votes","TXXX:CATALOGID":"catalognumber","TXXX:STYLE":"genre","TXXX:REPLAYGAIN_TRACK_PEAK":"replaygain_track_peak","TXXX:REPLAYGAIN_TRACK_GAIN":"replaygain_track_gain","TXXX:REPLAYGAIN_ALBUM_PEAK":"replaygain_album_peak","TXXX:REPLAYGAIN_ALBUM_GAIN":"replaygain_album_gain","TXXX:MP3GAIN_MINMAX":"replaygain_track_minmax","TXXX:MP3GAIN_ALBUM_MINMAX":"replaygain_album_minmax","TXXX:MP3GAIN_UNDO":"replaygain_undo"};class o extends i.CaseInsensitiveTagMap{static toRating(e){return{source:e.email,rating:e.rating>0?(e.rating-1)/254*a.CommonTagMapper.maxRatingScore:void 0}}constructor(){super(["ID3v2.3","ID3v2.4"],s)}postMap(e,t){switch(e.id){case"UFID":"http://musicbrainz.org"===e.value.owner_identifier&&(e.id+=":"+e.value.owner_identifier,e.value=n.default.decodeString(e.value.identifier,"iso-8859-1"));break;case"PRIV":switch(e.value.owner_identifier){case"AverageLevel":case"PeakValue":e.id+=":"+e.value.owner_identifier,e.value=4===e.value.data.length?e.value.data.readUInt32LE(0):null,null===e.value&&t.addWarning("Failed to parse PRIV:PeakValue");break;default:t.addWarning(`Unknown PRIV owner-identifier: ${e.value.owner_identifier}`)}break;case"COMM":e.value=e.value?e.value.text:null;break;case"POPM":e.value=o.toRating(e.value)}}}t.ID3v24TagMapper=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(8),n={Title:"title",Author:"artist","WM/AlbumArtist":"albumartist","WM/AlbumTitle":"album","WM/Year":"date","WM/OriginalReleaseTime":"originaldate","WM/OriginalReleaseYear":"originalyear",Description:"comment","WM/TrackNumber":"track","WM/PartOfSet":"disk","WM/Genre":"genre","WM/Composer":"composer","WM/Lyrics":"lyrics","WM/AlbumSortOrder":"albumsort","WM/TitleSortOrder":"titlesort","WM/ArtistSortOrder":"artistsort","WM/AlbumArtistSortOrder":"albumartistsort","WM/ComposerSortOrder":"composersort","WM/Writer":"lyricist","WM/Conductor":"conductor","WM/ModifiedBy":"remixer","WM/Engineer":"engineer","WM/Producer":"producer","WM/DJMixer":"djmixer","WM/Mixer":"mixer","WM/Publisher":"label","WM/ContentGroupDescription":"grouping","WM/SubTitle":"subtitle","WM/SetSubTitle":"discsubtitle","WM/IsCompilation":"compilation","WM/SharedUserRating":"rating","WM/BeatsPerMinute":"bpm","WM/Mood":"mood","WM/Media":"media","WM/CatalogNo":"catalognumber","MusicBrainz/Album Status":"releasestatus","MusicBrainz/Album Type":"releasetype","MusicBrainz/Album Release Country":"releasecountry","WM/Script":"script","WM/Language":"language",Copyright:"copyright",LICENSE:"license","WM/EncodedBy":"encodedby","WM/EncodingSettings":"encodersettings","WM/Barcode":"barcode","WM/ISRC":"isrc","MusicBrainz/Track Id":"musicbrainz_recordingid","MusicBrainz/Release Track Id":"musicbrainz_trackid","MusicBrainz/Album Id":"musicbrainz_albumid","MusicBrainz/Artist Id":"musicbrainz_artistid","MusicBrainz/Album Artist Id":"musicbrainz_albumartistid","MusicBrainz/Release Group Id":"musicbrainz_releasegroupid","MusicBrainz/Work Id":"musicbrainz_workid","MusicBrainz/TRM Id":"musicbrainz_trmid","MusicBrainz/Disc Id":"musicbrainz_discid","Acoustid/Id":"acoustid_id","Acoustid/Fingerprint":"acoustid_fingerprint","MusicIP/PUID":"musicip_puid","WM/ARTISTS":"artists","WM/InitialKey":"key",ASIN:"asin","WM/Work":"work","WM/AuthorURL":"website","WM/Picture":"picture"};class i extends a.CommonTagMapper{static toRating(e){return{rating:parseFloat(e+1)/5}}constructor(){super(["asf"],n)}postMap(e){switch(e.id){case"WM/SharedUserRating":const t=e.id.split(":");e.value=i.toRating(e.value),e.id=t[0]}}}t.AsfTagMapper=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(8);t.id3v22TagMap={TT2:"title",TP1:"artist",TP2:"albumartist",TAL:"album",TYE:"year",COM:"comment",TRK:"track",TPA:"disk",TCO:"genre",PIC:"picture",TCM:"composer",TOR:"originaldate",TOT:"work",TXT:"lyricist",TP3:"conductor",TPB:"label",TT1:"grouping",TT3:"subtitle",TLA:"language",TCR:"copyright",WCP:"license",TEN:"encodedby",TSS:"encodersettings",WAR:"website","COM:iTunPGAP":"gapless"};t.ID3v22TagMapper=class extends a.CommonTagMapper{constructor(){super(["ID3v2.2"],t.id3v22TagMap)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(24),n={Title:"title",Artist:"artist",Artists:"artists","Album Artist":"albumartist",Album:"album",Year:"date",Originalyear:"originalyear",Originaldate:"originaldate",Comment:"comment",Track:"track",Disc:"disk",DISCNUMBER:"disk",Genre:"genre","Cover Art (Front)":"picture","Cover Art (Back)":"picture",Composer:"composer",Lyrics:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",Lyricist:"lyricist",Writer:"writer",Conductor:"conductor",MixArtist:"remixer",Arranger:"arranger",Engineer:"engineer",Producer:"producer",DJMixer:"djmixer",Mixer:"mixer",Label:"label",Grouping:"grouping",Subtitle:"subtitle",DiscSubtitle:"discsubtitle",Compilation:"compilation",BPM:"bpm",Mood:"mood",Media:"media",CatalogNumber:"catalognumber",MUSICBRAINZ_ALBUMSTATUS:"releasestatus",MUSICBRAINZ_ALBUMTYPE:"releasetype",RELEASECOUNTRY:"releasecountry",Script:"script",Language:"language",Copyright:"copyright",LICENSE:"license",EncodedBy:"encodedby",EncoderSettings:"encodersettings",Barcode:"barcode",ISRC:"isrc",ASIN:"asin",musicbrainz_trackid:"musicbrainz_recordingid",musicbrainz_releasetrackid:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",Acoustid_Id:"acoustid_id",ACOUSTID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",Weblink:"website",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",MP3GAIN_MINMAX:"replaygain_track_minmax",MP3GAIN_UNDO:"replaygain_undo"};t.APEv2TagMapper=class extends a.CaseInsensitiveTagMap{constructor(){super(["APEv2"],n)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(8),n={"©nam":"title","©ART":"artist",aART:"albumartist","----:com.apple.iTunes:Band":"albumartist","©alb":"album","©day":"date","©cmt":"comment",trkn:"track",disk:"disk","©gen":"genre",covr:"picture","©wrt":"composer","©lyr":"lyrics",soal:"albumsort",sonm:"titlesort",soar:"artistsort",soaa:"albumartistsort",soco:"composersort","----:com.apple.iTunes:LYRICIST":"lyricist","----:com.apple.iTunes:CONDUCTOR":"conductor","----:com.apple.iTunes:REMIXER":"remixer","----:com.apple.iTunes:ENGINEER":"engineer","----:com.apple.iTunes:PRODUCER":"producer","----:com.apple.iTunes:DJMIXER":"djmixer","----:com.apple.iTunes:MIXER":"mixer","----:com.apple.iTunes:LABEL":"label","©grp":"grouping","----:com.apple.iTunes:SUBTITLE":"subtitle","----:com.apple.iTunes:DISCSUBTITLE":"discsubtitle",cpil:"compilation",tmpo:"bpm","----:com.apple.iTunes:MOOD":"mood","----:com.apple.iTunes:MEDIA":"media","----:com.apple.iTunes:CATALOGNUMBER":"catalognumber",tvsh:"tvShow",tvsn:"tvSeason",tves:"tvEpisode",sosn:"tvShowSort",tven:"tvEpisodeId",tvnn:"tvNetwork",pcst:"podcast",purl:"podcasturl","----:com.apple.iTunes:MusicBrainz Album Status":"releasestatus","----:com.apple.iTunes:MusicBrainz Album Type":"releasetype","----:com.apple.iTunes:MusicBrainz Album Release Country":"releasecountry","----:com.apple.iTunes:SCRIPT":"script","----:com.apple.iTunes:LANGUAGE":"language",cprt:"copyright","----:com.apple.iTunes:LICENSE":"license","©too":"encodedby",pgap:"gapless","----:com.apple.iTunes:BARCODE":"barcode","----:com.apple.iTunes:ISRC":"isrc","----:com.apple.iTunes:ASIN":"asin","----:com.apple.iTunes:NOTES":"comment","----:com.apple.iTunes:MusicBrainz Track Id":"musicbrainz_recordingid","----:com.apple.iTunes:MusicBrainz Release Track Id":"musicbrainz_trackid","----:com.apple.iTunes:MusicBrainz Album Id":"musicbrainz_albumid","----:com.apple.iTunes:MusicBrainz Artist Id":"musicbrainz_artistid","----:com.apple.iTunes:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","----:com.apple.iTunes:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","----:com.apple.iTunes:MusicBrainz Work Id":"musicbrainz_workid","----:com.apple.iTunes:MusicBrainz TRM Id":"musicbrainz_trmid","----:com.apple.iTunes:MusicBrainz Disc Id":"musicbrainz_discid","----:com.apple.iTunes:Acoustid Id":"acoustid_id","----:com.apple.iTunes:Acoustid Fingerprint":"acoustid_fingerprint","----:com.apple.iTunes:MusicIP PUID":"musicip_puid","----:com.apple.iTunes:fingerprint":"musicip_fingerprint","----:com.apple.iTunes:replaygain_track_gain":"replaygain_track_gain","----:com.apple.iTunes:replaygain_track_peak":"replaygain_track_peak","----:com.apple.iTunes:replaygain_album_gain":"replaygain_album_gain","----:com.apple.iTunes:replaygain_album_peak":"replaygain_album_peak","----:com.apple.iTunes:replaygain_track_minmax":"replaygain_track_minmax","----:com.apple.iTunes:replaygain_album_minmax":"replaygain_album_minmax","----:com.apple.iTunes:replaygain_undo":"replaygain_undo",gnre:"genre","----:com.apple.iTunes:ALBUMARTISTSORT":"albumartistsort","----:com.apple.iTunes:ARTISTS":"artists","----:com.apple.iTunes:ORIGINALDATE":"originaldate","----:com.apple.iTunes:ORIGINALYEAR":"originalyear",desc:"description",ldes:"description"};t.tagType="iTunes";t.MP4TagMapper=class extends a.CommonTagMapper{constructor(){super([t.tagType],n)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(8),n={TITLE:"title",ARTIST:"artist",ARTISTS:"artists",ALBUMARTIST:"albumartist",ALBUM:"album",DATE:"date",ORIGINALDATE:"originaldate",ORIGINALYEAR:"originalyear",COMMENT:"comment",TRACKNUMBER:"track",DISCNUMBER:"disk",GENRE:"genre",METADATA_BLOCK_PICTURE:"picture",COMPOSER:"composer",LYRICS:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",LYRICIST:"lyricist",WRITER:"writer",CONDUCTOR:"conductor",REMIXER:"remixer",ARRANGER:"arranger",ENGINEER:"engineer",PRODUCER:"producer",DJMIXER:"djmixer",MIXER:"mixer",LABEL:"label",GROUPING:"grouping",SUBTITLE:"subtitle",DISCSUBTITLE:"discsubtitle",TRACKTOTAL:"totaltracks",DISCTOTAL:"totaldiscs",COMPILATION:"compilation",RATING:"rating",BPM:"bpm",MOOD:"mood",MEDIA:"media",CATALOGNUMBER:"catalognumber",RELEASESTATUS:"releasestatus",RELEASETYPE:"releasetype",RELEASECOUNTRY:"releasecountry",SCRIPT:"script",LANGUAGE:"language",COPYRIGHT:"copyright",LICENSE:"license",ENCODEDBY:"encodedby",ENCODERSETTINGS:"encodersettings",BARCODE:"barcode",ISRC:"isrc",ASIN:"asin",MUSICBRAINZ_TRACKID:"musicbrainz_recordingid",MUSICBRAINZ_RELEASETRACKID:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",ACOUSTID_ID:"acoustid_id",ACOUSTID_ID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",WEBSITE:"website",NOTES:"notes",TOTALTRACKS:"totaltracks",TOTALDISCS:"totaldiscs",DISCOGS_ARTIST_ID:"discogs_artist_id",DISCOGS_ARTISTS:"artists",DISCOGS_ARTIST_NAME:"artists",DISCOGS_ALBUM_ARTISTS:"albumartist",DISCOGS_CATALOG:"catalognumber",DISCOGS_COUNTRY:"releasecountry",DISCOGS_DATE:"originaldate",DISCOGS_LABEL:"label",DISCOGS_LABEL_ID:"discogs_label_id",DISCOGS_MASTER_RELEASE_ID:"discogs_master_release_id",DISCOGS_RATING:"discogs_rating",DISCOGS_RELEASED:"date",DISCOGS_RELEASE_ID:"discogs_release_id",DISCOGS_VOTES:"discogs_votes",CATALOGID:"catalognumber",STYLE:"genre",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",REPLAYGAIN_ALBUM_GAIN:"replaygain_album_gain",REPLAYGAIN_ALBUM_PEAK:"replaygain_album_peak",REPLAYGAIN_MINMAX:"replaygain_track_minmax",REPLAYGAIN_ALBUM_MINMAX:"replaygain_album_minmax",REPLAYGAIN_UNDO:"replaygain_undo"};class i extends a.CommonTagMapper{static toRating(e,t){return{source:e?e.toLowerCase():e,rating:parseFloat(t)*a.CommonTagMapper.maxRatingScore}}constructor(){super(["vorbis"],n)}postMap(e){if(0===e.id.indexOf("RATING:")){const t=e.id.split(":");e.value=i.toRating(t[1],e.value),e.id=t[0]}}}t.VorbisTagMapper=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(8);t.riffInfoTagMap={IART:"artist",ICRD:"date",INAM:"title",TITL:"title",IPRD:"album",ITRK:"track",COMM:"comment",ICMT:"comment",ICNT:"releasecountry",GNRE:"genre",IWRI:"writer",RATE:"rating",YEAR:"year",ISFT:"encodedby",CODE:"encodedby",TURL:"website",IGNR:"genre",IENG:"engineer",ITCH:"technician",IMED:"media",IRPD:"album"};t.RiffInfoTagMapper=class extends a.CommonTagMapper{constructor(){super(["exif"],t.riffInfoTagMap)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(24),n={"segment:title":"title","album:ARITST":"albumartist","album:ARITSTSORT":"albumartistsort","album:TITLE":"album","album:DATE_RECORDED":"originaldate","track:ARTIST":"artist","track:ARTISTSORT":"artistsort","track:TITLE":"title","track:PART_NUMBER":"track","track:MUSICBRAINZ_TRACKID":"musicbrainz_recordingid","track:MUSICBRAINZ_ALBUMID":"musicbrainz_albumid","track:MUSICBRAINZ_ARTISTID":"musicbrainz_artistid","track:PUBLISHER":"label",picture:"picture"};t.MatroskaTagMapper=class extends a.CaseInsensitiveTagMap{constructor(){super(["matroska"],n)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(1),i=r(7),s=r(14),o=r(5),c=r(6),u=r(82),l=r(83),d=r(25),f=n("music-metadata:parser:aiff");t.AIFFParser=class extends c.BasicParser{async parse(){if("FORM"!==(await this.tokenizer.readToken(l.Header)).chunkID)throw new Error("Invalid Chunk-ID, expected 'FORM'");const e=await this.tokenizer.readToken(o.FourCcToken);switch(e){case"AIFF":this.metadata.setFormat("container",e),this.isCompressed=!1;break;case"AIFC":this.metadata.setFormat("container","AIFF-C"),this.isCompressed=!0;break;default:throw Error("Unsupported AIFF type: "+e)}this.metadata.setFormat("lossless",!this.isCompressed);try{for(;;){const e=await this.tokenizer.readToken(l.Header);f(`Chunk id=${e.chunkID}`);const t=2*Math.round(e.chunkSize/2),r=await this.readData(e);await this.tokenizer.ignore(t-r)}}catch(e){if(!(e instanceof i.EndOfStreamError))throw e;f("End-of-stream")}}async readData(e){switch(e.chunkID){case"COMM":const t=await this.tokenizer.readToken(new u.Common(e,this.isCompressed));return this.metadata.setFormat("bitsPerSample",t.sampleSize),this.metadata.setFormat("sampleRate",t.sampleRate),this.metadata.setFormat("numberOfChannels",t.numChannels),this.metadata.setFormat("numberOfSamples",t.numSampleFrames),this.metadata.setFormat("duration",t.numSampleFrames/t.sampleRate),this.metadata.setFormat("codec",t.compressionName),e.chunkSize;case"ID3 ":const r=await this.tokenizer.readToken(new a.BufferType(e.chunkSize)),n=new d.ID3Stream(r),o=i.fromStream(n);return await(new s.ID3v2Parser).parse(this.metadata,o,this.options),e.chunkSize;case"SSND":return this.metadata.format.duration&&this.metadata.setFormat("bitrate",8*e.chunkSize/this.metadata.format.duration),0;default:return 0}}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(0),i=r(3),s=r(15),o=a("music-metadata:id3v2:frame-parser"),c="iso-8859-1";class u{constructor(e,t){this.major=e,this.warningCollector=t}readData(t,r,a){if(0===t.length)return;const{encoding:l,bom:d}=s.TextEncodingToken.get(t,0),f=t.length;let p=0,m=[];const h=u.getNullTerminatorLength(l);let g;const y={};switch(o(`Parsing tag type=${r}, encoding=${l}, bom=${d}`),"TXXX"!==r&&"T"===r[0]?"T*":r){case"T*":case"IPLS":const b=i.default.decodeString(t.slice(1),l).replace(/\x00+$/,"");switch(r){case"TMCL":case"TIPL":case"IPLS":m=this.splitValue(r,b),m=u.functionList(m);break;case"TRK":case"TRCK":case"TPOS":m=b;break;case"TCOM":case"TCON":case"TEXT":case"TOLY":case"TOPE":case"TPE1":case"TSRC":m=this.splitValue(r,b);break;default:m=this.major>=4?this.splitValue(r,b):[b]}break;case"TXXX":m={description:(m=u.readIdentifierAndData(t,p+1,f,l)).id,text:this.splitValue(r,i.default.decodeString(m.data,l).replace(/\x00+$/,""))};break;case"PIC":case"APIC":if(a){const r={};switch(p+=1,this.major){case 2:r.format=i.default.decodeString(t.slice(p,p+3),l),p+=3;break;case 3:case 4:g=i.default.findZero(t,p,f,c),r.format=i.default.decodeString(t.slice(p,g),c),p=g+1;break;default:throw new Error("Warning: unexpected major versionIndex: "+this.major)}r.format=u.fixPictureMimeType(r.format),r.type=s.AttachedPictureType[t[p]],p+=1,g=i.default.findZero(t,p,f,l),r.description=i.default.decodeString(t.slice(p,g),l),p=g+h,r.data=e.from(t.slice(p,f)),m=r}break;case"CNT":case"PCNT":m=n.UINT32_BE.get(t,0);break;case"SYLT":for(p+=7,m=[];p<f;){const e=t.slice(p,p=i.default.findZero(t,p,f,l));p+=5,m.push(i.default.decodeString(e,l))}break;case"ULT":case"USLT":case"COM":case"COMM":p+=1,y.language=i.default.decodeString(t.slice(p,p+3),c),p+=3,g=i.default.findZero(t,p,f,l),y.description=i.default.decodeString(t.slice(p,g),l),p=g+h,y.text=i.default.decodeString(t.slice(p,f),l).replace(/\x00+$/,""),m=[y];break;case"UFID":m={owner_identifier:(m=u.readIdentifierAndData(t,p,f,c)).id,identifier:m.data};break;case"PRIV":m={owner_identifier:(m=u.readIdentifierAndData(t,p,f,c)).id,data:m.data};break;case"POPM":g=i.default.findZero(t,p,f,c);const T=i.default.decodeString(t.slice(p,g),c),w=f-(p=g+1);m={email:T,rating:t.readUInt8(p),counter:w>=5?t.readUInt32BE(p+1):void 0};break;case"GEOB":{g=i.default.findZero(t,p+1,f,l);const e=i.default.decodeString(t.slice(p+1,g),c);p=g+1,g=i.default.findZero(t,p,f-p,l);const r=i.default.decodeString(t.slice(p,g),c);p=g+1,g=i.default.findZero(t,p,f-p,l),m={type:e,filename:r,description:i.default.decodeString(t.slice(p,g),c),data:t.slice(p+1,f)};break}case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":m=i.default.decodeString(t.slice(p,g),l);break;case"WXXX":{g=i.default.findZero(t,p+1,f,l);const e=i.default.decodeString(t.slice(p+1,g),c);p=g+1,m={description:e,url:i.default.decodeString(t.slice(p,f-p),l)};break}case"MCDI":m=t.slice(0,f);break;default:o("Warning: unsupported id3v2-tag-type: "+r)}return m}static fixPictureMimeType(e){switch(e=e.toLocaleLowerCase()){case"jpg":return"image/jpeg";case"png":return"image/png"}return e}static functionList(e){const t={};for(let r=0;r+1<e.length;r+=2){const a=e[r+1].split(",");t[e[r]]=t.hasOwnProperty(e[r])?t[e[r]].concat(a):a}return t}splitValue(e,t){let r;return this.major<4?(r=t.split(/\x00/g)).length>1?this.warningCollector.addWarning(`ID3v2.${this.major} ${e} uses non standard null-separator.`):r=t.split(/\//g):r=t.split(/\x00/g),u.trimArray(r)}static trimArray(e){return e.map(e=>e.replace(/\x00+$/,"").trim())}static readIdentifierAndData(e,t,r,a){const n=i.default.findZero(e,t,r,a),s=i.default.decodeString(e.slice(t,n),a);return t=n+u.getNullTerminatorLength(a),{id:s,data:e.slice(t,r)}}static getNullTerminatorLength(e){return"utf16"===e?2:1}}t.FrameParser=u}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(4),i=r(5);t.Common=class{constructor(e,t){this.isAifc=t;const r=t?22:18;n.ok(e.chunkSize>=r,`COMMON CHUNK size should always be at least ${r}`),this.len=e.chunkSize}get(e,t){const r=e.readUInt16BE(t+8)-16398,n=e.readUInt16BE(t+8+2),s={numChannels:e.readUInt16BE(t),numSampleFrames:e.readUInt32BE(t+2),sampleSize:e.readUInt16BE(t+6),sampleRate:r<0?n>>Math.abs(r):n<<r};if(this.isAifc){if(s.compressionType=i.FourCcToken.get(e,t+18),this.len>22){const r=e.readInt8(t+22);if(23+r+(r+1)%2!==this.len)throw new Error("Illegal pstring length");s.compressionName=new a.StringType(r,"binary").get(e,t+23)}}else s.compressionName="PCM";return s}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(5);t.Header={len:8,get:(e,t)=>({chunkID:a.FourCcToken.get(e,t),chunkSize:e.readUInt32BE(t+4)})}},function(e,t){},function(e,t,r){"use strict";var a=r(20).Buffer,n=r(86);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,r,n,i=a.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,r=i,n=o,t.copy(r,n),o+=s.data.length,s=s.next;return i},e}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(88),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(10))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,s,o,c=1,u={},l=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick(function(){m(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){m(e.data)},a=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(n=d.documentElement,a=function(e){var t=d.createElement("script");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(m,0,e)}:(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&m(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),a=function(t){e.postMessage(s+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var n={callback:e,args:t};return u[c]=n,a(c),c++},f.clearImmediate=p}function p(e){delete u[e]}function m(e){if(l)setTimeout(m,0,e);else{var t=u[e];if(t){l=!0;try{!function(e){var t=e.callback,a=e.args;switch(a.length){case 0:t();break;case 1:t(a[0]);break;case 2:t(a[0],a[1]);break;case 3:t(a[0],a[1],a[2]);break;default:t.apply(r,a)}}(t)}finally{p(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(10),r(9))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var a=!1;return function(){if(!a){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),a=!0}return e.apply(this,arguments)}}}).call(this,r(10))},function(e,t,r){"use strict";e.exports=i;var a=r(39),n=r(16);function i(e){if(!(this instanceof i))return new i(e);a.call(this,e)}n.inherits=r(11),n.inherits(i,a),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(28)},function(e,t,r){e.exports=r(12)},function(e,t,r){e.exports=r(27).Transform},function(e,t,r){e.exports=r(27).PassThrough},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(23),n=r(40),i=r(96),s=r(1),o=r(6),c=s("music-metadata:parser:ASF"),u="asf";t.AsfParser=class extends o.BasicParser{async parse(){const e=await this.tokenizer.readToken(i.TopLevelHeaderObjectToken);if(!e.objectId.equals(n.default.HeaderObject))throw new Error("expected asf header; but was not found; got: "+e.objectId.str);try{await this.parseObjectHeader(e.numberOfHeaderObjects)}catch(e){c("Error while parsing ASF: %s",e)}}async parseObjectHeader(e){let t;do{const e=await this.tokenizer.readToken(i.HeaderObjectToken);switch(c("header GUID=%s",e.objectId.str),e.objectId.str){case i.FilePropertiesObject.guid.str:const r=await this.tokenizer.readToken(new i.FilePropertiesObject(e));this.metadata.setFormat("duration",r.playDuration/1e7),this.metadata.setFormat("bitrate",r.maximumBitrate);break;case i.StreamPropertiesObject.guid.str:const s=await this.tokenizer.readToken(new i.StreamPropertiesObject(e));this.metadata.setFormat("container","ASF/"+s.streamType);break;case i.HeaderExtensionObject.guid.str:const o=await this.tokenizer.readToken(new i.HeaderExtensionObject);await this.parseExtensionObject(o.extensionDataSize);break;case i.ContentDescriptionObjectState.guid.str:t=await this.tokenizer.readToken(new i.ContentDescriptionObjectState(e)),this.addTags(t);break;case i.ExtendedContentDescriptionObjectState.guid.str:t=await this.tokenizer.readToken(new i.ExtendedContentDescriptionObjectState(e)),this.addTags(t);break;case n.default.CodecListObject.str:const u=await i.readCodecEntries(this.tokenizer);u.forEach(e=>{this.metadata.addStreamInfo({type:e.type.videoCodec?a.TrackType.video:a.TrackType.audio,codecName:e.codecName})});const l=u.filter(e=>e.type.audioCodec).map(e=>e.codecName).join("/");this.metadata.setFormat("codec",l);break;case n.default.StreamBitratePropertiesObject.str:await this.tokenizer.ignore(e.objectSize-i.HeaderObjectToken.len);break;case n.default.PaddingObject.str:c("Padding: %s bytes",e.objectSize-i.HeaderObjectToken.len),await this.tokenizer.ignore(e.objectSize-i.HeaderObjectToken.len);break;default:this.metadata.addWarning("Ignore ASF-Object-GUID: "+e.objectId.str),c("Ignore ASF-Object-GUID: %s",e.objectId.str),await this.tokenizer.readToken(new i.IgnoreObjectState(e))}}while(--e)}addTags(e){e.forEach(e=>{this.metadata.addTag(u,e.id,e.value)})}async parseExtensionObject(e){do{const t=await this.tokenizer.readToken(i.HeaderObjectToken);switch(t.objectId.str){case i.ExtendedStreamPropertiesObjectState.guid.str:await this.tokenizer.readToken(new i.ExtendedStreamPropertiesObjectState(t));break;case i.MetadataObjectState.guid.str:const e=await this.tokenizer.readToken(new i.MetadataObjectState(t));this.addTags(e);break;case i.MetadataLibraryObjectState.guid.str:const r=await this.tokenizer.readToken(new i.MetadataLibraryObjectState(t));this.addTags(r);break;case n.default.PaddingObject.str:await this.tokenizer.ignore(t.objectSize-i.HeaderObjectToken.len);break;case n.default.CompatibilityObject.str:this.tokenizer.ignore(t.objectSize-i.HeaderObjectToken.len);break;case n.default.ASF_Index_Placeholder_Object.str:await this.tokenizer.ignore(t.objectSize-i.HeaderObjectToken.len);break;default:this.metadata.addWarning("Ignore ASF-Object-GUID: "+t.objectId.str),await this.tokenizer.readToken(new i.IgnoreObjectState(t))}e-=t.objectSize}while(e>0)}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(3),n=r(0),i=r(40),s=r(97),o=r(15);!function(e){e[e.UnicodeString=0]="UnicodeString",e[e.ByteArray=1]="ByteArray",e[e.Bool=2]="Bool",e[e.DWord=3]="DWord",e[e.QWord=4]="QWord",e[e.Word=5]="Word"}(t.DataType||(t.DataType={})),t.TopLevelHeaderObjectToken={len:30,get:(e,t)=>({objectId:i.default.fromBin(new n.BufferType(16).get(e,t)),objectSize:n.UINT64_LE.get(e,t+16),numberOfHeaderObjects:n.UINT32_LE.get(e,t+24)})},t.HeaderObjectToken={len:24,get:(e,t)=>({objectId:i.default.fromBin(new n.BufferType(16).get(e,t)),objectSize:n.UINT64_LE.get(e,t+16)})};class c{constructor(e){this.len=e.objectSize-t.HeaderObjectToken.len}postProcessTag(e,t,r,a){if("WM/Picture"===t)e.push({id:t,value:k.fromBuffer(a)});else{const n=s.AsfUtil.getParserForAttr(r);if(!n)throw new Error("unexpected value headerType: "+r);e.push({id:t,value:n(a)})}}}t.State=c;t.IgnoreObjectState=class extends c{constructor(e){super(e)}get(e,t){return null}};class u extends c{constructor(e){super(e)}get(e,t){return{fileId:i.default.fromBin(e,t),fileSize:n.UINT64_LE.get(e,t+16),creationDate:n.UINT64_LE.get(e,t+24),dataPacketsCount:n.UINT64_LE.get(e,t+32),playDuration:n.UINT64_LE.get(e,t+40),sendDuration:n.UINT64_LE.get(e,t+48),preroll:n.UINT64_LE.get(e,t+56),flags:{broadcast:a.default.strtokBITSET.get(e,t+64,24),seekable:a.default.strtokBITSET.get(e,t+64,25)},minimumDataPacketSize:n.UINT32_LE.get(e,t+68),maximumDataPacketSize:n.UINT32_LE.get(e,t+72),maximumBitrate:n.UINT32_LE.get(e,t+76)}}}t.FilePropertiesObject=u,u.guid=i.default.FilePropertiesObject;class l extends c{constructor(e){super(e)}get(e,t){return{streamType:i.default.decodeMediaType(i.default.fromBin(e,t)),errorCorrectionType:i.default.fromBin(e,t+8)}}}t.StreamPropertiesObject=l,l.guid=i.default.StreamPropertiesObject;class d{constructor(){this.len=22}get(e,t){return{reserved1:i.default.fromBin(e,t),reserved2:e.readUInt16LE(t+16),extensionDataSize:e.readUInt32LE(t+18)}}}t.HeaderExtensionObject=d,d.guid=i.default.HeaderExtensionObject;const f={len:20,get:(e,t)=>({entryCount:e.readUInt16LE(t+16)})};async function p(e){const t=await e.readNumber(n.UINT16_LE);return(await e.readToken(new n.StringType(2*t,"utf16le"))).replace("\0","")}async function m(t){const r=await t.readNumber(n.UINT16_LE),a=e.alloc(r);return await t.readBuffer(a),a}async function h(e){const t=await e.readNumber(n.UINT16_LE);return{type:{videoCodec:1==(1&t),audioCodec:2==(2&t)},codecName:await p(e),description:await p(e),information:await m(e)}}t.readCodecEntries=async function(e){const t=await e.readToken(f),r=[];for(let a=0;a<t.entryCount;++a)r.push(await h(e));return r};class g extends c{constructor(e){super(e)}get(e,t){const r=[];let a=t+10;for(let n=0;n<g.contentDescTags.length;++n){const i=e.readUInt16LE(t+2*n);if(i>0){const t=g.contentDescTags[n],o=a+i;r.push({id:t,value:s.AsfUtil.parseUnicodeAttr(e.slice(a,o))}),a=o}}return r}}t.ContentDescriptionObjectState=g,g.guid=i.default.ContentDescriptionObject,g.contentDescTags=["Title","Author","Copyright","Description","Rating"];class y extends c{constructor(e){super(e)}get(e,t){const r=[],a=e.readUInt16LE(t);let n=t+2;for(let t=0;t<a;t+=1){const t=e.readUInt16LE(n);n+=2;const a=s.AsfUtil.parseUnicodeAttr(e.slice(n,n+t));n+=t;const i=e.readUInt16LE(n);n+=2;const o=e.readUInt16LE(n);n+=2;const c=e.slice(n,n+o);n+=o,this.postProcessTag(r,a,i,c)}return r}}t.ExtendedContentDescriptionObjectState=y,y.guid=i.default.ExtendedContentDescriptionObject;class b extends c{constructor(e){super(e)}get(e,t){return{startTime:n.UINT64_LE.get(e,t),endTime:n.UINT64_LE.get(e,t+8),dataBitrate:e.readInt32LE(t+12),bufferSize:e.readInt32LE(t+16),initialBufferFullness:e.readInt32LE(t+20),alternateDataBitrate:e.readInt32LE(t+24),alternateBufferSize:e.readInt32LE(t+28),alternateInitialBufferFullness:e.readInt32LE(t+32),maximumObjectSize:e.readInt32LE(t+36),flags:{reliableFlag:a.default.strtokBITSET.get(e,t+40,0),seekableFlag:a.default.strtokBITSET.get(e,t+40,1),resendLiveCleanpointsFlag:a.default.strtokBITSET.get(e,t+40,2)},streamNumber:e.readInt16LE(t+42),streamLanguageId:e.readInt16LE(t+44),averageTimePerFrame:e.readInt32LE(t+52),streamNameCount:e.readInt32LE(t+54),payloadExtensionSystems:e.readInt32LE(t+56),streamNames:[],streamPropertiesObject:null}}}t.ExtendedStreamPropertiesObjectState=b,b.guid=i.default.ExtendedStreamPropertiesObject;class T extends c{constructor(e){super(e)}get(e,t){const r=[],a=e.readUInt16LE(t);let n=t+2;for(let t=0;t<a;t+=1){n+=4;const t=e.readUInt16LE(n);n+=2;const a=e.readUInt16LE(n);n+=2;const i=e.readUInt32LE(n);n+=4;const o=s.AsfUtil.parseUnicodeAttr(e.slice(n,n+t));n+=t;const c=e.slice(n,n+i);if(n+=i,!s.AsfUtil.getParserForAttr(a))throw new Error("unexpected value headerType: "+a);this.postProcessTag(r,o,a,c)}return r}}t.MetadataObjectState=T,T.guid=i.default.MetadataObject;class w extends T{constructor(e){super(e)}}t.MetadataLibraryObjectState=w,w.guid=i.default.MetadataLibraryObject;class k{constructor(e){this.len=e}static fromBase64(t){return this.fromBuffer(e.from(t,"base64"))}static fromBuffer(e){return new k(e.length).get(e,0)}get(e,t){const r=e.readUInt8(t++),a=e.readInt32LE(t);let n=5;for(;0!==e.readUInt16BE(n);)n+=2;const i=e.slice(5,n).toString("utf16le");for(;0!==e.readUInt16BE(n);)n+=2;const s=e.slice(5,n).toString("utf16le");return{type:o.AttachedPictureType[r],format:i,description:s,size:a,data:e.slice(n+4)}}}t.WmPictureToken=k}).call(this,r(2).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(3),n=r(0);class i{static getParserForAttr(e){return i.attributeParsers[e]}static parseUnicodeAttr(e){return a.default.stripNulls(a.default.decodeString(e,"utf16le"))}static parseByteArrayAttr(t){const r=e.alloc(t.length);return t.copy(r),r}static parseBoolAttr(e,t=0){return 1===i.parseWordAttr(e,t)}static parseDWordAttr(e,t=0){return e.readUInt32LE(t)}static parseQWordAttr(e,t=0){return n.UINT64_LE.get(e,t)}static parseWordAttr(e,t=0){return e.readUInt16LE(t)}}t.AsfUtil=i,i.attributeParsers=[i.parseUnicodeAttr,i.parseByteArrayAttr,i.parseBoolAttr,i.parseDWordAttr,i.parseQWordAttr,i.parseWordAttr,i.parseByteArrayAttr]}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(3),n=r(0),i=r(41),s=r(21),o=r(5),c=r(1),u=r(22),l=r(42),d=c("music-metadata:parser:FLAC");var f;!function(e){e[e.STREAMINFO=0]="STREAMINFO",e[e.PADDING=1]="PADDING",e[e.APPLICATION=2]="APPLICATION",e[e.SEEKTABLE=3]="SEEKTABLE",e[e.VORBIS_COMMENT=4]="VORBIS_COMMENT",e[e.CUESHEET=5]="CUESHEET",e[e.PICTURE=6]="PICTURE"}(f||(f={}));t.FlacParser=class extends s.AbstractID3Parser{constructor(){super(...arguments),this.padding=0}init(e,t,r){return super.init(e,t,r),this.vorbisParser=new u.VorbisParser(e,r),this}async _parse(){if("fLaC"!==(await this.tokenizer.readToken(o.FourCcToken)).toString())throw new Error("Invalid FLAC preamble");let e;do{e=await this.tokenizer.readToken(p.BlockHeader),await this.parseDataBlock(e)}while(!e.lastBlock);if(this.tokenizer.fileInfo.size&&this.metadata.format.duration){const e=this.tokenizer.fileInfo.size-this.tokenizer.position;this.metadata.setFormat("bitrate",8*e/this.metadata.format.duration)}}parseDataBlock(e){switch(d(`blockHeader type=${e.type}, length=${e.length}`),e.type){case f.STREAMINFO:return this.parseBlockStreamInfo(e.length);case f.PADDING:this.padding+=e.length;break;case f.APPLICATION:case f.SEEKTABLE:break;case f.VORBIS_COMMENT:return this.parseComment(e.length);case f.CUESHEET:break;case f.PICTURE:return this.parsePicture(e.length).then();default:this.metadata.addWarning("Unknown block type: "+e.type)}return this.tokenizer.ignore(e.length).then()}async parseBlockStreamInfo(e){if(e!==p.BlockStreamInfo.len)throw new Error("Unexpected block-stream-info length");const t=await this.tokenizer.readToken(p.BlockStreamInfo);this.metadata.setFormat("container","FLAC"),this.metadata.setFormat("codec","FLAC"),this.metadata.setFormat("lossless",!0),this.metadata.setFormat("numberOfChannels",t.channels),this.metadata.setFormat("bitsPerSample",t.bitsPerSample),this.metadata.setFormat("sampleRate",t.sampleRate),this.metadata.setFormat("duration",t.totalSamples/t.sampleRate)}async parseComment(e){const t=await this.tokenizer.readToken(new n.BufferType(e)),r=new l.VorbisDecoder(t,0);r.readStringUtf8();const a=r.readInt32();for(let e=0;e<a;e++){const e=r.parseUserComment();this.vorbisParser.addTag(e.key,e.value)}}async parsePicture(e){if(this.options.skipCovers)return this.tokenizer.ignore(e);{const t=await this.tokenizer.readToken(new i.VorbisPictureToken(e));this.vorbisParser.addTag("METADATA_BLOCK_PICTURE",t)}}};class p{}p.BlockHeader={len:4,get:(e,t)=>({lastBlock:a.default.strtokBITSET.get(e,t,7),type:a.default.getBitAllignedNumber(e,t,1,7),length:n.UINT24_BE.get(e,t+1)})},p.BlockStreamInfo={len:34,get:(e,t)=>({minimumBlockSize:n.UINT16_BE.get(e,t),maximumBlockSize:n.UINT16_BE.get(e,t+2)/1e3,minimumFrameSize:n.UINT24_BE.get(e,t+4),maximumFrameSize:n.UINT24_BE.get(e,t+7),sampleRate:n.UINT24_BE.get(e,t+10)>>4,channels:a.default.getBitAllignedNumber(e,t+12,4,3)+1,bitsPerSample:a.default.getBitAllignedNumber(e,t+12,7,5)+1,totalSamples:a.default.getBitAllignedNumber(e,t+13,4,36),fileMD5:new n.BufferType(16).get(e,t+18)})}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(0),i=r(4),s=r(6),o=r(100),c=r(43),u=r(18),l=r(23),d=a("music-metadata:parser:MP4"),f="iTunes",p={raw:{lossy:!1,format:"raw"},MAC3:{lossy:!0,format:"MACE 3:1"},MAC6:{lossy:!0,format:"MACE 6:1"},ima4:{lossy:!0,format:"IMA 4:1"},ulaw:{lossy:!0,format:"uLaw 2:1"},alaw:{lossy:!0,format:"uLaw 2:1"},Qclp:{lossy:!0,format:"QUALCOMM PureVoice"},".mp3":{lossy:!0,format:"MPEG-1 layer 3"},alac:{lossy:!1,format:"ALAC"},"ac-3":{lossy:!0,format:"AC-3"},mp4a:{lossy:!0,format:"MPEG-4/AAC"},mp4s:{lossy:!0,format:"MP4S"},c608:{lossy:!0,format:"CEA-608"},c708:{lossy:!0,format:"CEA-708"}};function m(e,t,r){return r.indexOf(e)===t}class h extends s.BasicParser{static read_BE_Signed_Integer(e){return n.readIntBE(e,0,e.length)}static read_BE_Unsigned_Integer(e){return n.readUIntBE(e,0,e.length)}async parse(){this.tracks=[];let e=this.tokenizer.fileInfo.size;for(;!this.tokenizer.fileInfo.size||e>0;){try{if("\0\0\0\0"===(await this.tokenizer.peekToken(c.Header)).name){const e=`Error at offset=${this.tokenizer.position}: box.id=0`;d(e),this.addWarning(e);break}}catch(e){const t=`Error at offset=${this.tokenizer.position}: ${e.message}`;d(t),this.addWarning(t);break}e-=(await o.Atom.readAtom(this.tokenizer,e=>this.handleAtom(e),null)).header.length}const t=[];this.tracks.forEach(e=>{const r=[];e.soundSampleDescription.forEach(e=>{const t={},a=p[e.dataFormat];if(a?(r.push(a.format),t.codecName=a.format):t.codecName=`<${e.dataFormat}>`,e.description){const{description:r}=e;r.sampleRate>0&&(t.type=l.TrackType.audio,t.audio={samplingFrequency:r.sampleRate,bitDepth:r.sampleSize,channels:r.numAudioChannels})}this.metadata.addStreamInfo(t)}),r.length>=1&&t.push(r.join("/"))}),t.length>0&&this.metadata.setFormat("codec",t.filter(m).join("+"));const r=this.tracks.filter(e=>e.soundSampleDescription.length>=1&&e.soundSampleDescription[0].description&&e.soundSampleDescription[0].description.sampleRate>0);if(r.length>=1){const e=r[0],t=e.duration/e.timeScale;this.metadata.setFormat("duration",t);const a=e.soundSampleDescription[0];a.description&&(this.metadata.setFormat("sampleRate",a.description.sampleRate),this.metadata.setFormat("bitsPerSample",a.description.sampleSize),this.metadata.setFormat("numberOfChannels",a.description.numAudioChannels));const n=p[a.dataFormat];n&&this.metadata.setFormat("lossless",!n.lossy),this.calculateBitRate()}}async handleAtom(e){if(e.parent)switch(e.parent.header.name){case"ilst":case"<id>":return this.parseMetadataItemData(e);case"stbl":switch(e.header.name){case"stsd":return this.parseAtom_stsd(e.getPayloadLength());case"stsc":return this.parseAtom_stsc(e.getPayloadLength());case"stts":return this.parseAtom_stts(e.getPayloadLength());case"stsz":return this.parseAtom_stsz(e.getPayloadLength());case"stco":return this.parseAtom_stco(e.getPayloadLength());default:d(`Ignore: stbl/${e.header.name} atom`)}}switch(e.header.name){case"ftyp":const t=await this.parseAtom_ftyp(e.getPayloadLength());d(`ftyp: ${t.join("/")}`);const r=t.filter(m).join("/");return void this.metadata.setFormat("container",r);case"mdhd":return this.parseAtom_mdhd(e);case"mvhd":return this.parseAtom_mvhd(e);case"chap":return void(this.getTrackDescription().chapterList=await this.parseAtom_chap(e));case"tkhd":return void await this.parseAtom_tkhd(e.getPayloadLength());case"mdat":return this.audioLengthInBytes=e.getPayloadLength(),this.calculateBitRate(),this.parseAtom_mdat(e.getPayloadLength())}await this.tokenizer.ignore(e.getPayloadLength()),d(`Ignore atom data: path=${e.atomPath}, payload-len=${e.getPayloadLength()}`)}getTrackDescription(){return this.tracks[this.tracks.length-1]}calculateBitRate(){this.audioLengthInBytes&&this.metadata.format.duration&&this.metadata.setFormat("bitrate",8*this.audioLengthInBytes/this.metadata.format.duration)}addTag(e,t){this.metadata.addTag(f,e,t)}addWarning(e){d("Warning: "+e),this.metadata.addWarning(e)}parseMetadataItemData(e){let t=e.header.name;return e.readAtoms(this.tokenizer,async e=>{switch(e.header.name){case"data":return this.parseValueAtom(t,e);case"name":const r=await this.tokenizer.readToken(new c.NameAtom(e.getPayloadLength()));t+=":"+r.name;break;case"mean":const a=await this.tokenizer.readToken(new c.NameAtom(e.getPayloadLength()));t+=":"+a.name;break;default:const i=await this.tokenizer.readToken(new n.BufferType(e.getPayloadLength()));this.addWarning("Unsupported meta-item: "+t+"["+e.header.name+"] => value="+i.toString("hex")+" ascii="+i.toString("ascii"))}},e.getPayloadLength())}async parseValueAtom(t,r){const a=await this.tokenizer.readToken(new c.DataAtom(r.header.length-c.Header.len));if(0!==a.type.set)throw new Error("Unsupported type-set != 0: "+a.type.set);switch(a.type.type){case 0:switch(t){case"trkn":case"disk":const e=n.UINT8.get(a.value,3),r=n.UINT8.get(a.value,5);this.addTag(t,e+"/"+r);break;case"gnre":const i=n.UINT8.get(a.value,1),s=u.Genres[i-1];this.addTag(t,s)}break;case 1:case 18:this.addTag(t,a.value.toString("utf-8"));break;case 13:if(this.options.skipCovers)break;this.addTag(t,{format:"image/jpeg",data:e.from(a.value)});break;case 14:if(this.options.skipCovers)break;this.addTag(t,{format:"image/png",data:e.from(a.value)});break;case 21:this.addTag(t,h.read_BE_Signed_Integer(a.value));break;case 22:this.addTag(t,h.read_BE_Unsigned_Integer(a.value));break;case 65:this.addTag(t,a.value.readInt8(0));break;case 66:this.addTag(t,a.value.readInt16BE(0));break;case 67:this.addTag(t,a.value.readInt32BE(0));break;default:this.addWarning(`atom key=${t}, has unknown well-known-type (data-type): ${a.type.type}`)}}async parseAtom_mvhd(e){await this.tokenizer.ignore(e.getPayloadLength())}async parseAtom_mdhd(e){const t=await this.tokenizer.readToken(new c.MdhdAtom(e.getPayloadLength())),r=this.getTrackDescription();r.creationTime=t.creationTime,r.modificationTime=t.modificationTime,r.timeScale=t.timeScale,r.duration=t.duration}async parseAtom_ftyp(e){const t=await this.tokenizer.readToken(c.ftyp);if((e-=c.ftyp.len)>0){const r=await this.parseAtom_ftyp(e),a=t.type.replace(/\W/g,"");return a.length>0&&r.push(a),r}return[]}async parseAtom_tkhd(e){const t=await this.tokenizer.readToken(new c.TrackHeaderAtom(e));this.tracks.push(t)}async parseAtom_stsd(e){const t=await this.tokenizer.readToken(new c.StsdAtom(e));this.getTrackDescription().soundSampleDescription=t.table.map(e=>this.parseSoundSampleDescription(e))}async parseAtom_stsc(e){const t=await this.tokenizer.readToken(new c.StscAtom(e));this.getTrackDescription().sampleToChunkTable=t.entries}async parseAtom_stts(e){const t=await this.tokenizer.readToken(new c.SttsAtom(e));this.getTrackDescription().timeToSampleTable=t.entries}parseSoundSampleDescription(e){const t={dataFormat:e.dataFormat,dataReferenceIndex:e.dataReferenceIndex};let r=0;const a=c.SoundSampleDescriptionVersion.get(e.description,r);return r+=c.SoundSampleDescriptionVersion.len,0===a.version||1===a.version?t.description=c.SoundSampleDescriptionV0.get(e.description,r):d(`Warning: sound-sample-description ${a} not implemented`),t}async parseAtom_chap(e){const t=[];let r=e.getPayloadLength();for(;r>=n.UINT32_BE.len;)t.push(await this.tokenizer.readNumber(n.UINT32_BE)),r-=n.UINT32_BE.len;return t}async parseAtom_stsz(e){const t=await this.tokenizer.readToken(new c.StszAtom(e)),r=this.getTrackDescription();r.sampleSize=t.sampleSize,r.sampleSizeTable=t.entries}async parseAtom_stco(e){const t=await this.tokenizer.readToken(new c.StcoAtom(e));this.getTrackDescription().chunkOffsetTable=t.entries}async parseAtom_mdat(e){if(this.options.includeChapters){const t=this.tracks.filter(e=>e.chapterList);if(1===t.length){const r=t[0].chapterList,a=this.tracks.filter(e=>-1!==r.indexOf(e.trackId));if(1===a.length)return this.parseChapterTrack(a[0],t[0],e)}}await this.tokenizer.ignore(e)}async parseChapterTrack(e,t,r){e.sampleSize||i.equal(e.chunkOffsetTable.length,e.sampleSizeTable.length,"chunk-offset-table & sample-size-table length");const a=[];for(let n=0;n<e.chunkOffsetTable.length&&r>0;++n){const s=e.chunkOffsetTable[n]-this.tokenizer.position,o=e.sampleSize>0?e.sampleSize:e.sampleSizeTable[n];r-=s+o,i.ok(r>=0,"Chapter chunk exceeding token length"),await this.tokenizer.ignore(s);const u=await this.tokenizer.readToken(new c.ChapterText(o));d(`Chapter ${n+1}: ${u}`);const l={title:u,sampleOffset:this.findSampleOffset(t,this.tokenizer.position)};d(`Chapter title=${l.title}, offset=${l.sampleOffset}/${this.tracks[0].duration}`),a.push(l)}this.metadata.setFormat("chapters",a),await this.tokenizer.ignore(r)}findSampleOffset(e,t){let r=0;e.timeToSampleTable.forEach(e=>{r+=e.count*e.duration}),d(`Total duration=${r}`);let a=0;for(;a<e.chunkOffsetTable.length&&e.chunkOffsetTable[a]<t;)++a;return this.getChunkDuration(a+1,e)}getChunkDuration(e,t){let r=0,a=t.timeToSampleTable[r].count,n=t.timeToSampleTable[r].duration,i=1,s=this.getSamplesPerChunk(i,t.sampleToChunkTable),o=0;for(;i<e;){const e=Math.min(a,s);o+=e*n,a-=e,0===(s-=e)?(++i,s=this.getSamplesPerChunk(i,t.sampleToChunkTable)):(++r,a=t.timeToSampleTable[r].count,n=t.timeToSampleTable[r].duration)}return o}getSamplesPerChunk(e,t){for(let r=0;r<t.length-1;++r)if(e>=t[r].firstChunk&&e<t[r+1].firstChunk)return t[r].samplesPerChunk;return t[t.length-1].samplesPerChunk}}t.MP4Parser=h}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(43),i=a("music-metadata:parser:MP4:Atom");class s{constructor(e,t,r){this.header=e,this.extended=t,this.parent=r,this.children=[],this.atomPath=(this.parent?this.parent.atomPath+".":"")+this.header.name}static async readAtom(e,t,r){const a=e.position,o=await e.readToken(n.Header),c=1===o.length;c&&(o.length=await e.readToken(n.ExtendedSize));const u=new s(o,c,r);return i(`parse atom name=${u.atomPath}, extended=${u.extended}, offset=${a}, len=${u.header.length}`),await u.readData(e,t),u}getHeaderLength(){return this.extended?16:8}getPayloadLength(){return this.header.length-this.getHeaderLength()}async readAtoms(e,t,r){for(;r>0;){const a=await s.readAtom(e,t,this);this.children.push(a),r-=a.header.length}}async readData(e,t){switch(this.header.name){case"moov":case"udta":case"trak":case"mdia":case"minf":case"stbl":case"<id>":case"ilst":case"tref":return this.readAtoms(e,t,this.getPayloadLength());case"meta":return await e.ignore(4),this.readAtoms(e,t,this.getPayloadLength()-4);case"mdhd":case"mvhd":case"tkhd":case"stsz":case"mdat":default:return t(this)}}}t.Atom=s},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(4),n=r(0),i=r(7),s=r(1),o=r(3),c=r(21),u=r(102),l=s("music-metadata:parser:mpeg"),d=1024,f={AudioObjectTypes:["AAC Main","AAC LC","AAC SSR","AAC LTP"],SamplingFrequencies:[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,void 0,void 0,-1]},p=[void 0,["front-center"],["front-left","front-right"],["front-center","front-left","front-right"],["front-center","front-left","front-right","back-center"],["front-center","front-left","front-right","back-left","back-right"],["front-center","front-left","front-right","back-left","back-right","LFE-channel"],["front-center","front-left","front-right","side-left","side-right","back-left","back-right","LFE-channel"]];class m{constructor(e,t){this.versionIndex=o.default.getBitAllignedNumber(e,t+1,3,2),this.layer=m.LayerDescription[o.default.getBitAllignedNumber(e,t+1,5,2)],this.versionIndex>1&&0===this.layer?this.parseAdtsHeader(e,t):this.parseMpegHeader(e,t),this.isProtectedByCRC=!o.default.isBitSet(e,t+1,7)}calcDuration(e){return e*this.calcSamplesPerFrame()/this.samplingRate}calcSamplesPerFrame(){return m.samplesInFrameTable[1===this.version?0:1][this.layer]}calculateSideInfoLength(){if(3!==this.layer)return 2;if(3===this.channelModeIndex){if(1===this.version)return 17;if(2===this.version||2.5===this.version)return 9}else{if(1===this.version)return 32;if(2===this.version||2.5===this.version)return 17}}calcSlotSize(){return[null,4,1,1][this.layer]}parseMpegHeader(e,t){this.container="MPEG",this.bitrateIndex=o.default.getBitAllignedNumber(e,t+2,0,4),this.sampRateFreqIndex=o.default.getBitAllignedNumber(e,t+2,4,2),this.padding=o.default.isBitSet(e,t+2,6),this.privateBit=o.default.isBitSet(e,t+2,7),this.channelModeIndex=o.default.getBitAllignedNumber(e,t+3,0,2),this.modeExtension=o.default.getBitAllignedNumber(e,t+3,2,2),this.isCopyrighted=o.default.isBitSet(e,t+3,4),this.isOriginalMedia=o.default.isBitSet(e,t+3,5),this.emphasis=o.default.getBitAllignedNumber(e,t+3,7,2),this.version=m.VersionID[this.versionIndex],this.channelMode=m.ChannelMode[this.channelModeIndex],this.codec=`MPEG ${this.version} Layer ${this.layer}`;const r=this.calcBitrate();if(!r)throw new Error("Cannot determine bit-rate");if(this.bitrate=1e3*r,this.samplingRate=this.calcSamplingRate(),null==this.samplingRate)throw new Error("Cannot determine sampling-rate")}parseAdtsHeader(e,t){l("layer=0 => ADTS"),this.version=2===this.versionIndex?4:2,this.container="ADTS/MPEG-"+this.version;const r=o.default.getBitAllignedNumber(e,t+2,0,2);this.codec="AAC",this.codecProfile=f.AudioObjectTypes[r],l(`MPEG-4 audio-codec=${this.codec}`);const a=o.default.getBitAllignedNumber(e,t+2,2,4);this.samplingRate=f.SamplingFrequencies[a],l(`sampling-rate=${this.samplingRate}`);const n=o.default.getBitAllignedNumber(e,t+2,7,3);this.mp4ChannelConfig=p[n],l(`channel-config=${this.mp4ChannelConfig.join("+")}`),this.frameLength=o.default.getBitAllignedNumber(e,t+3,6,2)<<11}calcBitrate(){if(0===this.bitrateIndex||15===this.bitrateIndex)return;const e=`${Math.floor(this.version)}${this.layer}`;return m.bitrate_index[this.bitrateIndex][e]}calcSamplingRate(){return 3===this.sampRateFreqIndex?null:m.sampling_rate_freq_index[this.version][this.sampRateFreqIndex]}}m.SyncByte1=255,m.SyncByte2=224,m.VersionID=[2.5,null,2,1],m.LayerDescription=[0,3,2,1],m.ChannelMode=["stereo","joint_stereo","dual_channel","mono"],m.bitrate_index={1:{11:32,12:32,13:32,21:32,22:8,23:8},2:{11:64,12:48,13:40,21:48,22:16,23:16},3:{11:96,12:56,13:48,21:56,22:24,23:24},4:{11:128,12:64,13:56,21:64,22:32,23:32},5:{11:160,12:80,13:64,21:80,22:40,23:40},6:{11:192,12:96,13:80,21:96,22:48,23:48},7:{11:224,12:112,13:96,21:112,22:56,23:56},8:{11:256,12:128,13:112,21:128,22:64,23:64},9:{11:288,12:160,13:128,21:144,22:80,23:80},10:{11:320,12:192,13:160,21:160,22:96,23:96},11:{11:352,12:224,13:192,21:176,22:112,23:112},12:{11:384,12:256,13:224,21:192,22:128,23:128},13:{11:416,12:320,13:256,21:224,22:144,23:144},14:{11:448,12:384,13:320,21:256,22:160,23:160}},m.sampling_rate_freq_index={1:{0:44100,1:48e3,2:32e3},2:{0:22050,1:24e3,2:16e3},2.5:{0:11025,1:12e3,2:8e3}},m.samplesInFrameTable=[[0,384,1152,1152],[0,384,1152,576]];const h={len:4,get:(e,t)=>new m(e,t)};t.MpegParser=class extends c.AbstractID3Parser{constructor(){super(...arguments),this.frameCount=0,this.syncFrameCount=-1,this.countSkipFrameData=0,this.totalDataLength=0,this.bitrates=[],this.calculateEofDuration=!1,this.buf_frame_header=e.alloc(4),this.syncPeek={buf:e.alloc(d),len:0}}async _parse(){this.metadata.setFormat("lossless",!1);try{let e=!1;for(;!e;)await this.sync(),e=await this.parseCommonMpegHeader()}catch(e){if(!(e instanceof i.EndOfStreamError))throw e;if(l("End-of-stream"),this.calculateEofDuration){const e=this.frameCount*this.samplesPerFrame;this.metadata.setFormat("numberOfSamples",e);const t=e/this.metadata.format.sampleRate;l(`Calculate duration at EOF: ${t} sec.`,t),this.metadata.setFormat("duration",t)}}}finalize(){const e=this.metadata.format,t=this.metadata.native.hasOwnProperty("ID3v1");if(e.duration&&this.tokenizer.fileInfo.size){const r=this.tokenizer.fileInfo.size-this.mpegOffset-(t?128:0);e.codecProfile&&"V"===e.codecProfile[0]&&this.metadata.setFormat("bitrate",8*r/e.duration)}else if(this.tokenizer.fileInfo.size&&"CBR"===e.codecProfile){const r=this.tokenizer.fileInfo.size-this.mpegOffset-(t?128:0),a=Math.round(r/this.frame_size)*this.samplesPerFrame;this.metadata.setFormat("numberOfSamples",a);const n=a/e.sampleRate;l("Calculate CBR duration based on file size: %s",n),this.metadata.setFormat("duration",n)}}async sync(){let e=!1;for(;;){let t=0;if(this.syncPeek.len=await this.tokenizer.peekBuffer(this.syncPeek.buf,{length:d,mayBeLess:!0}),this.syncPeek.len<=256)throw new i.EndOfStreamError;for(;;){if(e&&224==(224&this.syncPeek.buf[t]))return this.buf_frame_header[0]=m.SyncByte1,this.buf_frame_header[1]=this.syncPeek.buf[t],await this.tokenizer.ignore(t),l(`Sync at offset=${this.tokenizer.position-1}, frameCount=${this.frameCount}`),this.syncFrameCount===this.frameCount&&(l(`Re-synced MPEG stream, frameCount=${this.frameCount}`),this.frameCount=0,this.frame_size=0),void(this.syncFrameCount=this.frameCount);if(e=!1,-1===(t=this.syncPeek.buf.indexOf(m.SyncByte1,t))){if(this.syncPeek.len<this.syncPeek.buf.length)throw new i.EndOfStreamError;await this.tokenizer.ignore(this.syncPeek.len);break}++t,e=!0}}}async parseCommonMpegHeader(){let e;0===this.frameCount&&(this.mpegOffset=this.tokenizer.position-1),await this.tokenizer.peekBuffer(this.buf_frame_header,{offset:1,length:3});try{e=h.get(this.buf_frame_header,0)}catch(e){return await this.tokenizer.ignore(1),this.metadata.addWarning("Parse error: "+e.message),!1}return await this.tokenizer.ignore(3),this.metadata.setFormat("container",e.container),this.metadata.setFormat("codec",e.codec),this.metadata.setFormat("lossless",!1),this.metadata.setFormat("sampleRate",e.samplingRate),this.frameCount++,e.version>=2&&0===e.layer?this.parseAdts(e):this.parseAudioFrameHeader(e)}async parseAudioFrameHeader(e){this.metadata.setFormat("numberOfChannels","mono"===e.channelMode?1:2),this.metadata.setFormat("bitrate",e.bitrate),this.frameCount<2e5&&l("offset=%s MP%s bitrate=%s sample-rate=%s",this.tokenizer.position-4,e.layer,e.bitrate,e.samplingRate);const t=e.calcSlotSize();if(null===t)throw new Error("invalid slot_size");const r=e.calcSamplesPerFrame();l(`samples_per_frame=${r}`);const a=r/8*e.bitrate/e.samplingRate+(e.padding?t:0);if(this.frame_size=Math.floor(a),this.audioFrameHeader=e,this.bitrates.push(e.bitrate),1===this.frameCount)return this.offset=h.len,await this.skipSideInformation(),!1;if(3===this.frameCount){if(this.areAllSame(this.bitrates)){if(this.samplesPerFrame=r,this.metadata.setFormat("codecProfile","CBR"),this.tokenizer.fileInfo.size)return!0}else if(this.metadata.format.duration)return!0;if(!this.options.duration)return!0}return this.options.duration&&4===this.frameCount&&(this.samplesPerFrame=r,this.calculateEofDuration=!0),this.offset=4,e.isProtectedByCRC?(await this.parseCrc(),!1):(await this.skipSideInformation(),!1)}async parseAdts(t){const r=e.alloc(3);await this.tokenizer.readBuffer(r),t.frameLength+=o.default.getBitAllignedNumber(r,0,0,11),this.totalDataLength+=t.frameLength,this.samplesPerFrame=1024;const a=t.samplingRate/this.samplesPerFrame,n=8*(0===this.frameCount?0:this.totalDataLength/this.frameCount)*a+.5;if(this.metadata.setFormat("bitrate",n),l(`frame-count=${this.frameCount}, size=${t.frameLength} bytes, bit-rate=${n}`),await this.tokenizer.ignore(t.frameLength>7?t.frameLength-7:1),3===this.frameCount){if(this.metadata.setFormat("codecProfile",t.codecProfile),t.mp4ChannelConfig&&this.metadata.setFormat("numberOfChannels",t.mp4ChannelConfig.length),!this.options.duration)return!0;this.calculateEofDuration=!0}return!1}async parseCrc(){return this.crc=await this.tokenizer.readNumber(n.INT16_BE),this.offset+=2,this.skipSideInformation()}async skipSideInformation(){const e=this.audioFrameHeader.calculateSideInfoLength();await this.tokenizer.readToken(new n.BufferType(e)),this.offset+=e,await this.readXtraInfoHeader()}async readXtraInfoHeader(){const e=await this.tokenizer.readToken(u.InfoTagHeaderTag);switch(this.offset+=u.InfoTagHeaderTag.len,e){case"Info":return this.metadata.setFormat("codecProfile","CBR"),this.readXingInfoHeader();case"Xing":const r=await this.readXingInfoHeader(),a=(t=r.vbrScale,"V"+Math.floor((100-t)/10));return this.metadata.setFormat("codecProfile",a),null;case"Xtra":break;case"LAME":const n=await this.tokenizer.readToken(u.LameEncoderVersion);return this.offset+=u.LameEncoderVersion.len,this.metadata.setFormat("tool","LAME "+n),await this.skipFrameData(this.frame_size-this.offset),null}var t;const r=this.frame_size-this.offset;return r<0?this.metadata.addWarning("Frame "+this.frameCount+"corrupt: negative frameDataLeft"):await this.skipFrameData(r),null}async readXingInfoHeader(){const e=await this.tokenizer.readToken(u.XingInfoTag);if(this.offset+=u.XingInfoTag.len,this.metadata.setFormat("tool",o.default.stripNulls(e.codec)),1==(1&e.headerFlags[3])){const t=this.audioFrameHeader.calcDuration(e.numFrames);return this.metadata.setFormat("duration",t),l("Get duration from Xing header: %s",this.metadata.format.duration),e}const t=this.frame_size-this.offset;return await this.skipFrameData(t),e}async skipFrameData(e){a.ok(e>=0,"frame-data-left cannot be negative"),await this.tokenizer.ignore(e),this.countSkipFrameData+=e}areAllSame(e){const t=e[0];return e.every(e=>e===t)}}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);t.InfoTagHeaderTag=new a.StringType(4,"ascii"),t.LameEncoderVersion=new a.StringType(6,"ascii"),t.XingInfoTag={len:136,get:(e,t)=>({headerFlags:new a.BufferType(4).get(e,t),numFrames:a.UINT32_BE.get(e,t+4),streamSize:a.UINT32_BE.get(e,t+8),vbrScale:a.UINT32_BE.get(e,t+112),codec:new a.StringType(9,"ascii").get(e,t+116),infoTagRevision:a.UINT8.get(e,t+125)>>4,vbrMethod:15&a.UINT8.get(e,t+125)})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(0),i=r(104),s=r(106),o=r(21),c=a("music-metadata:parser:musepack");t.default=class extends o.AbstractID3Parser{async _parse(){let e;switch(await this.tokenizer.peekToken(new n.StringType(3,"binary"))){case"MP+":c("Musepack stream-version 7"),e=new s.MpcSv7Parser;break;case"MPC":c("Musepack stream-version 8"),e=new i.MpcSv8Parser;break;default:throw new Error("Invalid Musepack signature prefix")}return e.init(this.metadata,this.tokenizer,this.options),e.parse()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(4),i=r(6),s=r(105),o=r(13),c=r(5),u=a("music-metadata:parser:musepack");t.MpcSv8Parser=class extends i.BasicParser{constructor(){super(...arguments),this.audioLength=0}async parse(){const e=await this.tokenizer.readToken(c.FourCcToken);return n.equal(e,"MPCK","Magic number"),this.metadata.setFormat("container","Musepack, SV8"),this.parsePacket()}async parsePacket(){const e=new s.StreamReader(this.tokenizer);for(;;){const t=await e.readPacketHeader();switch(u(`packet-header key=${t.key}, payloadLength=${t.payloadLength}`),t.key){case"SH":const r=await e.readStreamHeader(t.payloadLength);this.metadata.setFormat("numberOfSamples",r.sampleCount),this.metadata.setFormat("sampleRate",r.sampleFrequency),this.metadata.setFormat("duration",r.sampleCount/r.sampleFrequency),this.metadata.setFormat("numberOfChannels",r.channelCount);break;case"AP":this.audioLength+=t.payloadLength,await this.tokenizer.ignore(t.payloadLength);break;case"RG":case"EI":case"SO":case"ST":case"CT":await this.tokenizer.ignore(t.payloadLength);break;case"SE":return this.metadata.setFormat("bitrate",8*this.audioLength/this.metadata.format.duration),o.APEv2Parser.tryParseApeHeader(this.metadata,this.tokenizer,this.options);default:throw new Error(`Unexpected header: ${t.key}`)}}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(3),i=r(1)("music-metadata:parser:musepack:sv8"),s=new a.StringType(2,"binary"),o={len:5,get:(e,t)=>({crc:a.UINT32_LE.get(e,t),streamVersion:a.UINT8.get(e,t+4)})},c={len:2,get:(e,t)=>({sampleFrequency:[44100,48e3,37800,32e3][n.default.getBitAllignedNumber(e,t,0,3)],maxUsedBands:n.default.getBitAllignedNumber(e,t,3,5),channelCount:n.default.getBitAllignedNumber(e,t+1,0,4)+1,msUsed:n.default.isBitSet(e,t+1,4),audioBlockFrames:n.default.getBitAllignedNumber(e,t+1,5,3)})};t.StreamReader=class{constructor(e){this.tokenizer=e}async readPacketHeader(){const e=await this.tokenizer.readToken(s),t=await this.readVariableSizeField();return{key:e,payloadLength:t.value-2-t.len}}async readStreamHeader(e){const t={};i(`Reading SH at offset=${this.tokenizer.position}`);const r=await this.tokenizer.readToken(o);e-=o.len,Object.assign(t,r),i(`SH.streamVersion = ${r.streamVersion}`);const a=await this.readVariableSizeField();e-=a.len,t.sampleCount=a.value;const n=await this.readVariableSizeField();e-=n.len,t.beginningOfSilence=n.value;const s=await this.tokenizer.readToken(c);return e-=c.len,Object.assign(t,s),await this.tokenizer.ignore(e),t}async readVariableSizeField(e=1,t=0){let r=await this.tokenizer.readNumber(a.UINT8);return 0==(128&r)?{len:e,value:t+r}:(r&=127,r+=t,this.readVariableSizeField(e+1,r<<7))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(4),i=r(6),s=r(107),o=r(13),c=r(108),u=a("music-metadata:parser:musepack");t.MpcSv7Parser=class extends i.BasicParser{constructor(){super(...arguments),this.audioLength=0}async parse(){const e=await this.tokenizer.readToken(s.Header);n.equal(e.signature,"MP+","Magic number"),u(`stream-version=${e.streamMajorVersion}.${e.streamMinorVersion}`),this.metadata.setFormat("container","Musepack, SV7"),this.metadata.setFormat("sampleRate",e.sampleFrequency);const t=1152*(e.frameCount-1)+e.lastFrameLength;this.metadata.setFormat("numberOfSamples",t),this.duration=t/e.sampleFrequency,this.metadata.setFormat("duration",this.duration),this.bitreader=new c.BitReader(this.tokenizer),this.metadata.setFormat("numberOfChannels",e.midSideStereo||e.intensityStereo?2:1);const r=await this.bitreader.read(8);return this.metadata.setFormat("codec",(r/100).toFixed(2)),await this.skipAudioData(e.frameCount),u(`End of audio stream, switching to APEv2, offset=${this.tokenizer.position}`),o.APEv2Parser.tryParseApeHeader(this.metadata,this.tokenizer,this.options)}async skipAudioData(e){for(;e-- >0;){const e=await this.bitreader.read(20);this.audioLength+=20+e,await this.bitreader.ignore(e)}const t=await this.bitreader.read(11);this.audioLength+=t,this.metadata.setFormat("bitrate",this.audioLength/this.duration)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(3);t.Header={len:24,get:(e,t)=>{const r={signature:e.toString("binary",t,t+3),streamMinorVersion:n.default.getBitAllignedNumber(e,t+3,0,4),streamMajorVersion:n.default.getBitAllignedNumber(e,t+3,4,4),frameCount:a.UINT32_LE.get(e,t+4),maxLevel:a.UINT16_LE.get(e,t+8),sampleFrequency:[44100,48e3,37800,32e3][n.default.getBitAllignedNumber(e,t+10,0,2)],link:n.default.getBitAllignedNumber(e,t+10,2,2),profile:n.default.getBitAllignedNumber(e,t+10,4,4),maxBand:n.default.getBitAllignedNumber(e,t+11,0,6),intensityStereo:n.default.isBitSet(e,t+11,6),midSideStereo:n.default.isBitSet(e,t+11,7),titlePeak:a.UINT16_LE.get(e,t+12),titleGain:a.UINT16_LE.get(e,t+14),albumPeak:a.UINT16_LE.get(e,t+16),albumGain:a.UINT16_LE.get(e,t+18),lastFrameLength:a.UINT32_LE.get(e,t+20)>>>20&2047,trueGapless:n.default.isBitSet(e,t+23,0)};return r.lastFrameLength=r.trueGapless?a.UINT32_LE.get(e,20)>>>20&2047:0,r}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);t.BitReader=class{constructor(e){this.tokenizer=e,this.pos=0,this.dword=void 0}async read(e){for(;void 0===this.dword;)this.dword=await this.tokenizer.readToken(a.UINT32_LE);let t=this.dword;return this.pos+=e,this.pos<32?(t>>>=32-this.pos)&(1<<e)-1:(this.pos-=32,0===this.pos?(this.dword=void 0,t&(1<<e)-1):(this.dword=await this.tokenizer.readToken(a.UINT32_LE),this.pos&&(t<<=this.pos,t|=this.dword>>>32-this.pos),t&(1<<e)-1))}async ignore(e){if(this.pos>0){const t=32-this.pos;this.dword=void 0,e-=t,this.pos=0}const t=e%32,r=(e-t)/32;return await this.tokenizer.ignore(4*r),this.read(t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(1),i=r(4),s=r(3),o=r(5),c=r(22),u=r(110),l=r(112),d=r(6),f=r(114),p=r(7),m=n("music-metadata:parser:ogg");class h{constructor(e){this.len=e.page_segments}static sum(e,t,r){let a=0;for(let n=t;n<t+r;++n)a+=e[n];return a}get(e,t){return{totalPageSize:h.sum(e,t,this.len)}}}t.SegmentTable=h;class g extends d.BasicParser{async parse(){m("pos=%s, parsePage()",this.tokenizer.position);try{let e;do{e=await this.tokenizer.readToken(g.Header),i.strictEqual(e.capturePattern,"OggS","Ogg capture pattern"),this.metadata.setFormat("container","Ogg"),this.header=e,this.pageNumber=e.pageSequenceNo,m("page#=%s, Ogg.id=%s",e.pageSequenceNo,e.capturePattern);const t=await this.tokenizer.readToken(new h(e));m("totalPageSize=%s",t.totalPageSize);const r=await this.tokenizer.readToken(new a.BufferType(t.totalPageSize));if(m("firstPage=%s, lastPage=%s, continued=%s",e.headerType.firstPage,e.headerType.lastPage,e.headerType.continued),e.headerType.firstPage){const e=new a.StringType(7,"ascii").get(r,0);switch(e){case"vorbis":m("Set page consumer to Ogg/Vorbis"),this.pageConsumer=new c.VorbisParser(this.metadata,this.options);break;case"OpusHea":m("Set page consumer to Ogg/Opus"),this.pageConsumer=new u.OpusParser(this.metadata,this.options,this.tokenizer);break;case"Speex  ":m("Set page consumer to Ogg/Speex"),this.pageConsumer=new l.SpeexParser(this.metadata,this.options,this.tokenizer);break;case"fishead":case"\0theora":m("Set page consumer to Ogg/Theora"),this.pageConsumer=new f.TheoraParser(this.metadata,this.options,this.tokenizer);break;default:throw new Error("gg audio-codec not recognized (id="+e+")")}}this.pageConsumer.parsePage(e,r)}while(!e.headerType.lastPage)}catch(e){if(e instanceof p.EndOfStreamError)return void m("End-of-stream");if(e.message.startsWith("FourCC")&&this.pageNumber>0)return this.metadata.addWarning("Invalid FourCC ID, maybe last OGG-page is not marked with last-page flag"),this.pageConsumer.flush();throw e}}}t.OggParser=g,g.Header={len:27,get:(e,t)=>({capturePattern:o.FourCcToken.get(e,t),version:e.readUInt8(t+4),headerType:{continued:s.default.strtokBITSET.get(e,t+5,0),firstPage:s.default.strtokBITSET.get(e,t+5,1),lastPage:s.default.strtokBITSET.get(e,t+5,2)},absoluteGranulePosition:e.readIntLE(t+6,6),streamSerialNumber:a.UINT32_LE.get(e,t+14),pageSequenceNo:a.UINT32_LE.get(e,t+18),pageChecksum:a.UINT32_LE.get(e,t+22),page_segments:e.readUInt8(t+26)})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(111),i=r(22);t.OpusParser=class extends i.VorbisParser{constructor(e,t,r){super(e,t),this.tokenizer=r,this.lastPos=-1}parseFirstPage(e,t){if(this.metadata.setFormat("codec","Opus"),this.idHeader=new n.IdHeader(t.length).get(t,0),"OpusHead"!==this.idHeader.magicSignature)throw new Error("Illegal ogg/Opus magic-signature");this.metadata.setFormat("sampleRate",this.idHeader.inputSampleRate),this.metadata.setFormat("numberOfChannels",this.idHeader.channelCount)}parseFullPage(e){switch(new a.StringType(8,"ascii").get(e,0)){case"OpusTags":this.parseUserCommentList(e,8),this.lastPos=this.tokenizer.position}}calculateDuration(e){if(this.metadata.format.sampleRate&&e.absoluteGranulePosition>=0&&(this.metadata.setFormat("numberOfSamples",e.absoluteGranulePosition-this.idHeader.preSkip),this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.idHeader.inputSampleRate),-1!==this.lastPos&&this.tokenizer.fileInfo.size&&this.metadata.format.duration)){const e=this.tokenizer.fileInfo.size-this.lastPos;this.metadata.setFormat("bitrate",8*e/this.metadata.format.duration)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);t.IdHeader=class{constructor(e){if(this.len=e,e<19)throw new Error("ID-header-page 0 should be at least 19 bytes long")}get(e,t){return{magicSignature:new a.StringType(8,"ascii").get(e,t+0),version:e.readUInt8(t+8),channelCount:e.readUInt8(t+9),preSkip:e.readInt16LE(t+10),inputSampleRate:e.readInt32LE(t+12),outputGain:e.readInt16LE(t+16),channelMapping:e.readUInt8(t+18)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(113),i=r(22),s=a("music-metadata:parser:ogg:speex");t.SpeexParser=class extends i.VorbisParser{constructor(e,t,r){super(e,t),this.tokenizer=r}parseFirstPage(e,t){s("First Ogg/Speex page");const r=n.Header.get(t,0);this.metadata.setFormat("codec",`Speex ${r.version}`),this.metadata.setFormat("numberOfChannels",r.nb_channels),this.metadata.setFormat("sampleRate",r.rate),-1!==r.bitrate&&this.metadata.setFormat("bitrate",r.bitrate)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(3);t.Header={len:80,get:(e,t)=>({speex:new a.StringType(8,"ascii").get(e,t+0),version:n.default.trimRightNull(new a.StringType(20,"ascii").get(e,t+8)),version_id:e.readInt32LE(t+28),header_size:e.readInt32LE(t+32),rate:e.readInt32LE(t+36),mode:e.readInt32LE(t+40),mode_bitstream_version:e.readInt32LE(t+44),nb_channels:e.readInt32LE(t+48),bitrate:e.readInt32LE(t+52),frame_size:e.readInt32LE(t+56),vbr:e.readInt32LE(t+60),frames_per_packet:e.readInt32LE(t+64),extra_headers:e.readInt32LE(t+68),reserved1:e.readInt32LE(t+72),reserved2:e.readInt32LE(t+76)})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(1),n=r(115),i=a("music-metadata:parser:ogg:theora");t.TheoraParser=class{constructor(e,t,r){this.metadata=e,this.tokenizer=r}parsePage(e,t){e.headerType.firstPage&&this.parseFirstPage(e,t)}flush(){i("flush")}parseFirstPage(e,t){i("First Ogg/Theora page"),this.metadata.setFormat("codec","Theora");const r=n.IdentificationHeader.get(t,0);this.metadata.setFormat("bitrate",r.nombr)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0);t.IdentificationHeader={len:42,get:(e,t)=>({id:new a.StringType(7,"ascii").get(e,t),vmaj:e.readUInt8(t+7),vmin:e.readUInt8(t+8),vrev:e.readUInt8(t+9),vmbw:e.readUInt16BE(t+10),vmbh:e.readUInt16BE(t+17),nombr:a.UINT24_BE.get(e,t+37),nqual:e.readUInt8(t+40)})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(7),n=r(0),i=r(1),s=r(117),o=r(118),c=r(14),u=r(3),l=r(5),d=r(6),f=r(25),p=i("music-metadata:parser:RIFF");t.WaveParser=class extends d.BasicParser{async parse(){const e=await this.tokenizer.readToken(s.Header);if(p(`pos=${this.tokenizer.position}, parse: chunkID=${e.chunkID}`),"RIFF"===e.chunkID)return this.parseRiffChunk(e.chunkSize).catch(e=>{if(!(e instanceof a.EndOfStreamError))throw e})}async parseRiffChunk(e){const t=await this.tokenizer.readToken(l.FourCcToken);switch(this.metadata.setFormat("container",t),t){case"WAVE":return this.readWaveChunk(e-l.FourCcToken.len);default:throw new Error(`Unsupported RIFF format: RIFF/${t}`)}}async readWaveChunk(e){do{const t=await this.tokenizer.readToken(s.Header);switch(e-=s.Header.len+t.chunkSize,this.header=t,p(`pos=${this.tokenizer.position}, readChunk: chunkID=RIFF/WAVE/${t.chunkID}`),t.chunkID){case"LIST":await this.parseListTag(t);break;case"fact":this.metadata.setFormat("lossless",!1),this.fact=await this.tokenizer.readToken(new o.FactChunk(t));break;case"fmt ":const r=await this.tokenizer.readToken(new o.Format(t));let i=o.WaveFormat[r.wFormatTag];i||(p("WAVE/non-PCM format="+r.wFormatTag),i="non-PCM ("+r.wFormatTag+")"),this.metadata.setFormat("codec",i),this.metadata.setFormat("bitsPerSample",r.wBitsPerSample),this.metadata.setFormat("sampleRate",r.nSamplesPerSec),this.metadata.setFormat("numberOfChannels",r.nChannels),this.metadata.setFormat("bitrate",r.nBlockAlign*r.nSamplesPerSec*8),this.blockAlign=r.nBlockAlign;break;case"id3 ":case"ID3 ":const u=await this.tokenizer.readToken(new n.BufferType(t.chunkSize)),l=new f.ID3Stream(u),d=a.fromStream(l);await(new c.ID3v2Parser).parse(this.metadata,d,this.options);break;case"data":!1!==this.metadata.format.lossless&&this.metadata.setFormat("lossless",!0);const m=this.fact?this.fact.dwSampleLength:t.chunkSize/this.blockAlign;this.metadata.setFormat("numberOfSamples",m),this.metadata.setFormat("duration",m/this.metadata.format.sampleRate),this.metadata.setFormat("bitrate",this.metadata.format.numberOfChannels*this.blockAlign*this.metadata.format.sampleRate),await this.tokenizer.ignore(t.chunkSize);break;default:p(`Ignore chunk: RIFF/${t.chunkID} of ${t.chunkSize} bytes`),this.metadata.addWarning("Ignore chunk: RIFF/"+t.chunkID),await this.tokenizer.ignore(t.chunkSize)}this.header.chunkSize%2==1&&(p("Read odd padding byte"),await this.tokenizer.ignore(1))}while(e>0)}async parseListTag(e){const t=await this.tokenizer.readToken(l.FourCcToken);switch(p("pos=%s, parseListTag: chunkID=RIFF/WAVE/LIST/%s",this.tokenizer.position,t),t){case"INFO":return this.parseRiffInfoTags(e.chunkSize-4);case"adtl":default:return this.metadata.addWarning("Ignore chunk: RIFF/WAVE/LIST/"+t),p("Ignoring chunkID=RIFF/WAVE/LIST/"+t),this.tokenizer.ignore(e.chunkSize-4).then()}}async parseRiffInfoTags(e){for(;e>=8;){const t=await this.tokenizer.readToken(s.Header),r=new s.ListInfoTagValue(t),a=await this.tokenizer.readToken(r);this.addTag(t.chunkID,u.default.stripNulls(a)),e-=8+r.len}if(0!==e)throw Error("Illegal remaining size: "+e)}addTag(e,t){this.metadata.addTag("exif",e,t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(5);t.Header={len:8,get:(e,t)=>({chunkID:n.FourCcToken.get(e,t),chunkSize:e.readUInt32LE(t+4)})};t.ListInfoTagValue=class{constructor(e){this.tagHeader=e,this.len=e.chunkSize,this.len+=1&this.len}get(e,t){return new a.StringType(this.tagHeader.chunkSize,"ascii").get(e,t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(4);!function(e){e[e.PCM=1]="PCM",e[e.ADPCM=2]="ADPCM",e[e.IEEE_FLOAT=3]="IEEE_FLOAT",e[e.MPEG_ADTS_AAC=5632]="MPEG_ADTS_AAC",e[e.MPEG_LOAS=5634]="MPEG_LOAS",e[e.RAW_AAC1=255]="RAW_AAC1",e[e.DOLBY_AC3_SPDIF=146]="DOLBY_AC3_SPDIF",e[e.DVM=8192]="DVM",e[e.RAW_SPORT=576]="RAW_SPORT",e[e.ESST_AC3=577]="ESST_AC3",e[e.DRM=9]="DRM",e[e.DTS2=8193]="DTS2",e[e.MPEG=80]="MPEG"}(t.WaveFormat||(t.WaveFormat={}));t.Format=class{constructor(e){a.ok(e.chunkSize>=16,"16 for PCM."),this.len=e.chunkSize}get(e,t){return{wFormatTag:e.readUInt16LE(t),nChannels:e.readUInt16LE(t+2),nSamplesPerSec:e.readUInt32LE(t+4),nAvgBytesPerSec:e.readUInt32LE(t+8),nBlockAlign:e.readUInt16LE(t+12),wBitsPerSample:e.readUInt16LE(t+14)}}};t.FactChunk=class{constructor(e){a.ok(e.chunkSize>=4,"minimum fact chunk size."),this.len=e.chunkSize}get(e,t){return{dwSampleLength:e.readUInt32LE(t)}}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(4),i=r(13),s=r(5),o=r(6),c=r(120),u=r(1)("music-metadata:parser:WavPack");t.WavPackParser=class extends o.BasicParser{async parse(){return this.audioDataSize=0,await this.parseWavPackBlocks(),i.APEv2Parser.tryParseApeHeader(this.metadata,this.tokenizer,this.options)}async parseWavPackBlocks(){do{if("wvpk"!==await this.tokenizer.peekToken(s.FourCcToken))break;const e=await this.tokenizer.readToken(c.WavPack.BlockHeaderToken);n.strictEqual(e.BlockID,"wvpk","WavPack Block-ID"),u(`WavPack header blockIndex=${e.blockIndex}, len=${c.WavPack.BlockHeaderToken.len}`),0!==e.blockIndex||this.metadata.format.container||(this.metadata.setFormat("container","WavPack"),this.metadata.setFormat("lossless",!e.flags.isHybrid),this.metadata.setFormat("bitsPerSample",e.flags.bitsPerSample),e.flags.isDSD||(this.metadata.setFormat("sampleRate",e.flags.samplingRate),this.metadata.setFormat("duration",e.totalSamples/e.flags.samplingRate)),this.metadata.setFormat("numberOfChannels",e.flags.isMono?1:2),this.metadata.setFormat("numberOfSamples",e.totalSamples),this.metadata.setFormat("codec",e.flags.isDSD?"DSD":"PCM"));const t=e.blockSize-(c.WavPack.BlockHeaderToken.len-8);0===e.blockIndex?await this.parseMetadataSubBlock(e,t):await this.tokenizer.ignore(t),e.blockSamples>0&&(this.audioDataSize+=e.blockSize)}while(!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=c.WavPack.BlockHeaderToken.len);this.metadata.setFormat("bitrate",8*this.audioDataSize/this.metadata.format.duration)}async parseMetadataSubBlock(t,r){for(;r>c.WavPack.MetadataIdToken.len;){const i=await this.tokenizer.readToken(c.WavPack.MetadataIdToken),s=await this.tokenizer.readNumber(i.largeBlock?a.UINT24_LE:a.UINT8),o=e.alloc(2*s-(i.isOddSize?1:0));switch(await this.tokenizer.readBuffer(o),u(`Metadata Sub-Blocks functionId=0x${i.functionId.toString(16)}, id.largeBlock=${i.largeBlock},data-size=${o.length}`),i.functionId){case 0:break;case 14:u("ID_DSD_BLOCK");const e=1<<o.readUInt8(0),r=t.flags.samplingRate*e*8;n.ok(t.flags.isDSD,"Only expect DSD block if DSD-flag is set"),this.metadata.setFormat("sampleRate",r),this.metadata.setFormat("duration",t.totalSamples/r);break;case 36:u("ID_ALT_TRAILER: trailer for non-wav files");break;case 38:this.metadata.setFormat("audioMD5",o);break;case 47:u(`ID_BLOCK_CHECKSUM: checksum=${o.toString("hex")}`);break;default:u(`Ignore unsupported meta-sub-block-id functionId=0x${i.functionId.toString(16)}`)}r-=c.WavPack.MetadataIdToken.len+(i.largeBlock?a.UINT24_LE.len:a.UINT8.len)+2*s,u(`remainingLength=${r}`),i.isOddSize&&this.tokenizer.ignore(1)}n.strictEqual(r,0,"metadata-sub-block should fit it remaining length")}}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(5),i=[6e3,8e3,9600,11025,12e3,16e3,22050,24e3,32e3,44100,48e3,64e3,88200,96e3,192e3,-1];class s{static isBitSet(e,t){return 1===s.getBitAllignedNumber(e,t,1)}static getBitAllignedNumber(e,t,r){return e>>>t&4294967295>>>32-r}}t.WavPack=s,s.BlockHeaderToken={len:32,get:(e,t)=>{const r=a.UINT32_LE.get(e,t+24),o={BlockID:n.FourCcToken.get(e,t),blockSize:a.UINT32_LE.get(e,t+4),version:a.UINT16_LE.get(e,t+8),totalSamples:a.UINT32_LE.get(e,t+12),blockIndex:a.UINT32_LE.get(e,t+16),blockSamples:a.UINT32_LE.get(e,t+20),flags:{bitsPerSample:8*(1+s.getBitAllignedNumber(r,0,2)),isMono:s.isBitSet(r,2),isHybrid:s.isBitSet(r,3),isJointStereo:s.isBitSet(r,4),crossChannel:s.isBitSet(r,5),hybridNoiseShaping:s.isBitSet(r,6),floatingPoint:s.isBitSet(r,7),samplingRate:i[s.getBitAllignedNumber(r,23,4)],isDSD:s.isBitSet(r,31)},crc:new a.BufferType(4).get(e,t+28)};return o.flags.isDSD&&(o.totalSamples*=8),o}},s.MetadataIdToken={len:1,get:(e,t)=>({functionId:s.getBitAllignedNumber(e[t],0,6),isOptional:s.isBitSet(e[t],5),isOddSize:s.isBitSet(e[t],6),largeBlock:s.isBitSet(e[t],7)})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(21),n=r(4),i=r(1),s=r(122),o=r(14),c=i("music-metadata:parser:DSF");t.DsfParser=class extends a.AbstractID3Parser{async _parse(){const e=this.tokenizer.position,t=await this.tokenizer.readToken(s.ChunkHeader);n.strictEqual(t.id,"DSD ","Invalid chunk signature"),this.metadata.setFormat("container","DSF"),this.metadata.setFormat("lossless",!0);const r=await this.tokenizer.readToken(s.DsdChunk);if(0!==r.metadataPointer)return c(`expect ID3v2 at offset=${r.metadataPointer}`),await this.parseChunks(r.fileSize-t.size),await this.tokenizer.ignore(r.metadataPointer-this.tokenizer.position-e),(new o.ID3v2Parser).parse(this.metadata,this.tokenizer,this.options);c("No ID3v2 tag present")}async parseChunks(e){for(;e>=s.ChunkHeader.len;){const t=await this.tokenizer.readToken(s.ChunkHeader);switch(c(`Parsing chunk name=${t.id} size=${t.size}`),t.id){case"fmt ":const e=await this.tokenizer.readToken(s.FormatChunk);this.metadata.setFormat("numberOfChannels",e.channelNum),this.metadata.setFormat("sampleRate",e.samplingFrequency),this.metadata.setFormat("bitsPerSample",e.bitsPerSample),this.metadata.setFormat("numberOfSamples",e.sampleCount),this.metadata.setFormat("duration",e.sampleCount/e.samplingFrequency);const r=e.bitsPerSample*e.samplingFrequency*e.channelNum;return void this.metadata.setFormat("bitrate",r);default:this.tokenizer.ignore(t.size-s.ChunkHeader.len)}e-=t.size}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(5);t.ChunkHeader={len:12,get:(e,t)=>({id:n.FourCcToken.get(e,t),size:a.UINT64_LE.get(e,t+4)})},t.DsdChunk={len:16,get:(e,t)=>({fileSize:a.INT64_LE.get(e,t),metadataPointer:a.INT64_LE.get(e,t+8)})},function(e){e[e.mono=1]="mono",e[e.stereo=2]="stereo",e[e.channels=3]="channels",e[e.quad=4]="quad",e[e["4 channels"]=5]="4 channels",e[e["5 channels"]=6]="5 channels",e[e["5.1 channels"]=7]="5.1 channels"}(t.ChannelType||(t.ChannelType={})),t.FormatChunk={len:40,get:(e,t)=>({formatVersion:a.INT32_LE.get(e,t),formatID:a.INT32_LE.get(e,t+4),channelType:a.INT32_LE.get(e,t+8),channelNum:a.INT32_LE.get(e,t+12),samplingFrequency:a.INT32_LE.get(e,t+16),bitsPerSample:a.INT32_LE.get(e,t+20),sampleCount:a.INT64_LE.get(e,t+24),blockSizePerChannel:a.INT32_LE.get(e,t+32)})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(4),n=r(0),i=r(1),s=r(5),o=r(6),c=r(25),u=r(124),l=r(7),d=r(14),f=i("music-metadata:parser:aiff");t.DsdiffParser=class extends o.BasicParser{async parse(){const e=await this.tokenizer.readToken(u.ChunkHeader);a.strictEqual(e.chunkID,"FRM8");const t=(await this.tokenizer.readToken(s.FourCcToken)).trim();switch(t){case"DSD":return this.metadata.setFormat("container",`DSDIFF/${t}`),this.metadata.setFormat("lossless",!0),this.readFmt8Chunks(e.chunkSize-s.FourCcToken.len);default:throw Error(`Unsupported DSDIFF type: ${t}`)}}async readFmt8Chunks(e){for(;e>=u.ChunkHeader.len;){const t=await this.tokenizer.readToken(u.ChunkHeader);f(`Chunk id=${t.chunkID}`),await this.readData(t),e-=u.ChunkHeader.len+t.chunkSize}}async readData(e){f(`Reading data of chunk[ID=${e.chunkID}, size=${e.chunkSize}]`);const t=this.tokenizer.position;switch(e.chunkID.trim()){case"FVER":const t=await this.tokenizer.readToken(n.UINT32_LE);f(`DSDIFF version=${t}`);break;case"PROP":const r=await this.tokenizer.readToken(s.FourCcToken);a.strictEqual(r,"SND "),await this.handleSoundPropertyChunks(e.chunkSize-s.FourCcToken.len);break;case"ID3":const i=await this.tokenizer.readToken(new n.BufferType(e.chunkSize)),o=new c.ID3Stream(i),u=l.fromStream(o);await(new d.ID3v2Parser).parse(this.metadata,u,this.options);break;default:f(`Ignore chunk[ID=${e.chunkID}, size=${e.chunkSize}]`);break;case"DSD":this.metadata.setFormat("numberOfSamples",8*e.chunkSize/this.metadata.format.numberOfChannels),this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate)}const r=e.chunkSize-(this.tokenizer.position-t);r>0&&(f(`After Parsing chunk, remaining ${r} bytes`),await this.tokenizer.ignore(r))}async handleSoundPropertyChunks(e){for(f(`Parsing sound-property-chunks, remainingSize=${e}`);e>0;){const t=await this.tokenizer.readToken(u.ChunkHeader);f(`Sound-property-chunk[ID=${t.chunkID}, size=${t.chunkSize}]`);const r=this.tokenizer.position;switch(t.chunkID.trim()){case"FS":const e=await this.tokenizer.readToken(n.UINT32_BE);this.metadata.setFormat("sampleRate",e);break;case"CHNL":const r=await this.tokenizer.readToken(n.UINT16_BE);this.metadata.setFormat("numberOfChannels",r),await this.handleChannelChunks(t.chunkSize-n.UINT16_BE.len);break;case"CMPR":const a=(await this.tokenizer.readToken(s.FourCcToken)).trim(),i=await this.tokenizer.readToken(n.UINT8),o=await this.tokenizer.readToken(new n.StringType(i,"ascii"));"DSD"===a&&(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("bitsPerSample",1)),this.metadata.setFormat("codec",`${a} (${o})`);break;case"ABSS":const c=await this.tokenizer.readToken(n.UINT16_BE),u=await this.tokenizer.readToken(n.UINT8),l=await this.tokenizer.readToken(n.UINT8),d=await this.tokenizer.readToken(n.UINT32_BE);f(`ABSS ${c}:${u}:${l}.${d}`);break;case"LSCO":const p=await this.tokenizer.readToken(n.UINT16_BE);f(`LSCO lsConfig=${p}`);break;case"COMT":default:f(`Unknown sound-property-chunk[ID=${t.chunkID}, size=${t.chunkSize}]`),await this.tokenizer.ignore(t.chunkSize)}const a=t.chunkSize-(this.tokenizer.position-r);a>0&&(f(`After Parsing sound-property-chunk ${t.chunkSize}, remaining ${a} bytes`),await this.tokenizer.ignore(a)),e-=u.ChunkHeader.len+t.chunkSize,f(`Parsing sound-property-chunks, remainingSize=${e}`)}if(this.metadata.format.lossless&&this.metadata.format.sampleRate&&this.metadata.format.numberOfChannels&&this.metadata.format.bitsPerSample){const e=this.metadata.format.sampleRate*this.metadata.format.numberOfChannels*this.metadata.format.bitsPerSample;this.metadata.setFormat("bitrate",e)}}async handleChannelChunks(e){f(`Parsing channel-chunks, remainingSize=${e}`);const t=[];for(;e>=s.FourCcToken.len;){const r=await this.tokenizer.readToken(s.FourCcToken);f(`Channel[ID=${r}]`),t.push(r),e-=s.FourCcToken.len}return f(`Channels: ${t.join(", ")}`),t}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(5);t.ChunkHeader={len:12,get:(e,t)=>({chunkID:n.FourCcToken.get(e,t),chunkSize:a.INT64_BE.get(e,t+4)})}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const a=r(0),n=r(1),i=r(6),s=r(44),o=r(126),c=n("music-metadata:parser:matroska");t.MatroskaParser=class extends i.BasicParser{constructor(){super(),this.padding=0,this.parserMap=new Map,this.parserMap.set(s.DataType.uint,e=>this.readUint(e)),this.parserMap.set(s.DataType.string,e=>this.readString(e)),this.parserMap.set(s.DataType.binary,e=>this.readBuffer(e)),this.parserMap.set(s.DataType.uid,async e=>1===await this.readUint(e)),this.parserMap.set(s.DataType.bool,e=>this.readFlag(e)),this.parserMap.set(s.DataType.float,e=>this.readFloat(e))}init(e,t,r){return super.init(e,t,r),this}async parse(){const e=await this.parseContainer(o.elements,this.tokenizer.fileInfo.size,[]);if(this.metadata.setFormat("container",`EBML/${e.ebml.docType}`),e.segment){const t=e.segment.info;if(t){const e=t.timecodeScale?t.timecodeScale:1e6,r=t.duration*e/1e9;this.addTag("segment:title",t.title),this.metadata.setFormat("duration",r)}const r=e.segment.tracks;if(r&&r.entries){r.entries.forEach(e=>{const t={codecName:e.codecID.replace("A_","").replace("V_",""),codecSettings:e.codecSettings,flagDefault:e.flagDefault,flagLacing:e.flagLacing,flagEnabled:e.flagEnabled,language:e.language,name:e.name,type:e.trackType,audio:e.audio,video:e.video};this.metadata.addStreamInfo(t)});const t=r.entries.filter(e=>e.trackType===s.TrackType.audio.valueOf()).reduce((e,t)=>e?!e.flagDefault&&t.flagDefault?t:t.trackNumber&&t.trackNumber<e.trackNumber?t:e:t,null);t&&(this.metadata.setFormat("codec",t.codecID.replace("A_","")),this.metadata.setFormat("sampleRate",t.audio.samplingFrequency),this.metadata.setFormat("numberOfChannels",t.audio.channels)),e.segment.tags&&e.segment.tags.tag.forEach(e=>{const t=e.target,r=t.targetTypeValue?s.TargetType[t.targetTypeValue]:t.targetType?t.targetType:s.TargetType.album;e.simpleTags.forEach(e=>{const t=e.string?e.string:e.binary;this.addTag(`${r}:${e.name}`,t)})}),e.segment.attachments&&e.segment.attachments.attachedFiles.filter(e=>e.mimeType.startsWith("image/")).map(e=>({data:e.data,format:e.mimeType,description:e.description,name:e.name})).forEach(e=>{this.addTag("picture",e)})}}}async parseContainer(e,t,r){const a={};for(;this.tokenizer.position<t;){const t=await this.readElement(),n=e[t.id];if(n)if(n.container){const e=await this.parseContainer(n.container,this.tokenizer.position+t.len,r.concat([n.name]));n.multiple?(a[n.name]||(a[n.name]=[]),a[n.name].push(e)):a[n.name]=e}else a[n.name]=await this.parserMap.get(n.value)(t);else switch(t.id){case 236:this.padding+=t.len,await this.tokenizer.ignore(t.len);break;default:c(`parseEbml: path=${r.join("/")}, unknown element: id=${t.id.toString(16)}`),this.padding+=t.len,await this.tokenizer.ignore(t.len)}}return a}async readVintData(){const t=await this.tokenizer.peekNumber(a.UINT8);let r=128,n=1;for(;0==(t&r);)++n,r>>=1;const i=e.alloc(n);return await this.tokenizer.readBuffer(i),i}async readElement(){const e=await this.readVintData(),t=await this.readVintData();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async readFloat(e){switch(e.len){case 0:return 0;case 4:return this.tokenizer.readNumber(a.Float32_BE);case 8:case 10:return this.tokenizer.readNumber(a.Float64_BE);default:throw new Error(`Invalid IEEE-754 float length: ${e.len}`)}}async readFlag(e){return 1===await this.readUint(e)}async readUint(e){const t=await this.readBuffer(e),r=Math.min(6,e.len);return t.readUIntBE(e.len-r,r)}async readString(e){return this.tokenizer.readToken(new a.StringType(e.len,"utf-8"))}async readBuffer(t){const r=e.alloc(t.len);return await this.tokenizer.readBuffer(r),r}addTag(e,t){this.metadata.addTag("matroska",e,t)}}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(44);t.elements={440786851:{name:"ebml",container:{17030:{name:"ebmlVersion",value:a.DataType.uint},17143:{name:"ebmlReadVersion",value:a.DataType.uint},17138:{name:"ebmlMaxIDWidth",value:a.DataType.uint},17139:{name:"ebmlMaxSizeWidth",value:a.DataType.uint},17026:{name:"docType",value:a.DataType.string},17031:{name:"docTypeVersion",value:a.DataType.uint},17029:{name:"docTypeReadVersion",value:a.DataType.uint}}},408125543:{name:"segment",container:{290298740:{name:"seekHead",container:{19899:{name:"seek",container:{21419:{name:"seekId",value:a.DataType.binary},21420:{name:"seekPosition",value:a.DataType.uint}}}}},357149030:{name:"info",container:{29604:{name:"uid",value:a.DataType.uid},29572:{name:"filename",value:a.DataType.string},3979555:{name:"prevUID",value:a.DataType.uid},3965867:{name:"prevFilename",value:a.DataType.string},4110627:{name:"nextUID",value:a.DataType.uid},4096955:{name:"nextFilename",value:a.DataType.string},2807729:{name:"timecodeScale",value:a.DataType.uint},17545:{name:"duration",value:a.DataType.float},17505:{name:"dateUTC",value:a.DataType.uint},31657:{name:"title",value:a.DataType.string},19840:{name:"muxingApp",value:a.DataType.string},22337:{name:"writingApp",value:a.DataType.string}}},524531317:{name:"cluster",multiple:!0,container:{231:{name:"timecode",value:a.DataType.uid},163:{name:"unknown",value:a.DataType.binary},167:{name:"position",value:a.DataType.uid},171:{name:"prevSize",value:a.DataType.uid}}},374648427:{name:"tracks",container:{174:{name:"entries",multiple:!0,container:{215:{name:"trackNumber",value:a.DataType.uint},29637:{name:"uid",value:a.DataType.uid},131:{name:"trackType",value:a.DataType.uint},185:{name:"flagEnabled",value:a.DataType.bool},136:{name:"flagDefault",value:a.DataType.bool},21930:{name:"flagForced",value:a.DataType.bool},156:{name:"flagLacing",value:a.DataType.bool},28135:{name:"minCache",value:a.DataType.uint},28136:{name:"maxCache",value:a.DataType.uint},2352003:{name:"defaultDuration",value:a.DataType.uint},2306383:{name:"timecodeScale",value:a.DataType.float},21358:{name:"name",value:a.DataType.string},2274716:{name:"language",value:a.DataType.string},134:{name:"codecID",value:a.DataType.string},25506:{name:"codecPrivate",value:a.DataType.binary},2459272:{name:"codecName",value:a.DataType.string},3839639:{name:"codecSettings",value:a.DataType.string},3883072:{name:"codecInfoUrl",value:a.DataType.string},2536e3:{name:"codecDownloadUrl",value:a.DataType.string},170:{name:"codecDecodeAll",value:a.DataType.bool},28587:{name:"trackOverlay",value:a.DataType.uint},224:{name:"video",container:{154:{name:"flagInterlaced",value:a.DataType.bool},21432:{name:"stereoMode",value:a.DataType.uint},176:{name:"pixelWidth",value:a.DataType.uint},186:{name:"pixelHeight",value:a.DataType.uint},21680:{name:"displayWidth",value:a.DataType.uint},21690:{name:"displayHeight",value:a.DataType.uint},21683:{name:"aspectRatioType",value:a.DataType.uint},3061028:{name:"colourSpace",value:a.DataType.uint},3126563:{name:"gammaValue",value:a.DataType.float}}},225:{name:"audio",container:{181:{name:"samplingFrequency",value:a.DataType.float},30901:{name:"outputSamplingFrequency",value:a.DataType.float},159:{name:"channels",value:a.DataType.uint},148:{name:"channels",value:a.DataType.uint},32123:{name:"channelPositions",value:a.DataType.binary},25188:{name:"bitDepth",value:a.DataType.uint}}},28032:{name:"contentEncodings",container:{25152:{name:"contentEncoding",container:{20529:{name:"order",value:a.DataType.uint},20530:{name:"scope",value:a.DataType.bool},20531:{name:"type",value:a.DataType.uint},20532:{name:"contentEncoding",container:{16980:{name:"contentCompAlgo",value:a.DataType.uint},16981:{name:"contentCompSettings",value:a.DataType.binary}}},20533:{name:"contentEncoding",container:{18401:{name:"contentEncAlgo",value:a.DataType.uint},18402:{name:"contentEncKeyID",value:a.DataType.binary},18403:{name:"contentSignature ",value:a.DataType.binary},18404:{name:"ContentSigKeyID  ",value:a.DataType.binary},18405:{name:"contentSigAlgo ",value:a.DataType.uint},18406:{name:"contentSigHashAlgo ",value:a.DataType.uint}}},25188:{name:"bitDepth",value:a.DataType.uint}}}}}}}}},475249515:{name:"cues",container:{187:{name:"cuePoint",container:{179:{name:"cueTime",value:a.DataType.uid},183:{name:"positions",container:{247:{name:"track",value:a.DataType.uint},241:{name:"clusterPosition",value:a.DataType.uint},21368:{name:"blockNumber",value:a.DataType.uint},234:{name:"codecState",value:a.DataType.uint},219:{name:"reference",container:{150:{name:"time",value:a.DataType.uint},151:{name:"cluster",value:a.DataType.uint},21343:{name:"number",value:a.DataType.uint},235:{name:"codecState",value:a.DataType.uint}}},240:{name:"relativePosition",value:a.DataType.uint}}}}}}},423732329:{name:"attachments",container:{24999:{name:"attachedFiles",multiple:!0,container:{18046:{name:"description",value:a.DataType.string},18030:{name:"name",value:a.DataType.string},18016:{name:"mimeType",value:a.DataType.string},18012:{name:"data",value:a.DataType.binary},18094:{name:"uid",value:a.DataType.uid}}}}},272869232:{name:"chapters",container:{17849:{name:"editionEntry",container:{182:{name:"chapterAtom",container:{29636:{name:"uid",value:a.DataType.uid},145:{name:"timeStart",value:a.DataType.uint},146:{name:"timeEnd",value:a.DataType.uid},152:{name:"hidden",value:a.DataType.bool},17816:{name:"enabled",value:a.DataType.uid},143:{name:"track",container:{137:{name:"trackNumber",value:a.DataType.uid},128:{name:"display",container:{133:{name:"string",value:a.DataType.string},17276:{name:"language ",value:a.DataType.string},17278:{name:"country ",value:a.DataType.string}}}}}}}}}}},307544935:{name:"tags",container:{29555:{name:"tag",multiple:!0,container:{25536:{name:"target",container:{25541:{name:"tagTrackUID",value:a.DataType.uid},25540:{name:"tagChapterUID",value:a.DataType.uint},25542:{name:"tagAttachmentUID",value:a.DataType.uid},25546:{name:"targetType",value:a.DataType.string},26826:{name:"targetTypeValue",value:a.DataType.uint},25545:{name:"tagEditionUID",value:a.DataType.uid}}},26568:{name:"simpleTags",multiple:!0,container:{17827:{name:"name",value:a.DataType.string},17543:{name:"string",value:a.DataType.string},17541:{name:"binary",value:a.DataType.binary},17530:{name:"language",value:a.DataType.string},17531:{name:"languageIETF",value:a.DataType.string},17540:{name:"default",value:a.DataType.bool}}}}}}}}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.RandomBufferReader=class{constructor(e){this.buf=e,this.fileSize=e.length}async randomRead(e,t,r,a){return this.buf.copy(e,t,a,a+r)}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.endTag2="LYRICS200",t.getLyricsHeaderLength=async function(r){if(r.fileSize>=143){const a=e.alloc(15);await r.randomRead(a,0,a.length,r.fileSize-143);const n=a.toString("binary");if(n.substr(6)===t.endTag2)return parseInt(n.substr(0,6),10)+15}return 0}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(34);t.ReadableWebToNodeStream=class extends a.Readable{constructor(e){super(),this.bytesRead=0,this.released=!1,this.reader=e.getReader()}async _read(){if(this.released)return void this.push(null);this.pendingRead=this.reader.read();const e=await this.pendingRead;delete this.pendingRead,e.done||this.released?this.push(null):(this.bytesRead+=e.value.length,this.push(e.value))}async waitForReadToComplete(){this.pendingRead&&await this.pendingRead}async close(){await this.syncAndRelease()}async syncAndRelease(){this.released=!0,await this.waitForReadToComplete(),await this.reader.releaseLock()}}},function(e,t,r){(function(t){var a=r(131).strict;e.exports=function(e){if(a(e)){var r=t.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(r=r.slice(e.byteOffset,e.byteOffset+e.byteLength)),r}return t.from(e)}}).call(this,r(2).Buffer)},function(e,t){e.exports=n,n.strict=i,n.loose=s;var r=Object.prototype.toString,a={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function n(e){return i(e)||s(e)}function i(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function s(e){return a[r.call(e)]}}]);