mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-30 04:39:00 +01:00
3 lines
264 KiB
JavaScript
3 lines
264 KiB
JavaScript
/*! For license information please see 8505.f588195fa145445de93b.js.LICENSE.txt */
|
||
(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[8505],{38505:module=>{var factory;self,factory=()=>(()=>{var __webpack_modules__={9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=c(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,n=c(e),s=n[0],o=n[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,o)),u=0,d=o>0?s-4:s;for(r=0;r<d;r+=4)t=a[e.charCodeAt(r)]<<18|a[e.charCodeAt(r+1)]<<12|a[e.charCodeAt(r+2)]<<6|a[e.charCodeAt(r+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===o&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,l[u++]=255&t),1===o&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},t.fromByteArray=function(e){for(var t,a=e.length,i=a%3,n=[],s=16383,o=0,c=a-i;o<c;o+=s)n.push(l(e,o,o+s>c?c:o+s));return 1===i?(t=e[a-1],n.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[a-2]<<8)+e[a-1],n.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),n.join("")};for(var r=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=n.length;s<o;++s)r[s]=n[s],a[n.charCodeAt(s)]=s;function c(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,a){for(var i,n,s=[],o=t;o<a;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(r[(n=i)>>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return s.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const a=r(9742),i=r(645),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|h(e,t);let a=o(r);const i=a.write(e,t);return i!==r&&(a=a.slice(0,i)),a}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return c.from(a,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|m(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Z(e.length)?o(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),o(e<0?0:0|m(e))}function f(e){const t=e.length<0?0:0|m(e.length),r=o(t);for(let a=0;a<t;a+=1)r[a]=255&e[a];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let a;return a=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(a,c.prototype),a}function m(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(i)return a?-1:X(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let 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 S(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function y(e,t,r){const a=e[t];e[t]=e[r],e[r]=a}function b(e,t,r,a,i){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,a)),c.isBuffer(t))return 0===t.length?-1:T(e,t,r,a,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):T(e,[t],r,a,i);throw new TypeError("val must be string, number or Buffer")}function T(e,t,r,a,i){let n,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 l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let a=-1;for(n=r;n<o;n++)if(l(e,n)===l(t,-1===a?0:n-a)){if(-1===a&&(a=n),n-a+1===c)return a*s}else-1!==a&&(n-=n-a),a=-1}else for(r+c>o&&(r=o-c),n=r;n>=0;n--){let r=!0;for(let a=0;a<c;a++)if(l(e,n+a)!==l(t,a)){r=!1;break}if(r)return n}return-1}function w(e,t,r,a){r=Number(r)||0;const i=e.length-r;a?(a=Number(a))>i&&(a=i):a=i;const n=t.length;let s;for(a>n/2&&(a=n/2),s=0;s<a;++s){const a=parseInt(t.substr(2*s,2),16);if(Z(a))return s;e[r+s]=a}return s}function v(e,t,r,a){return V(X(t,e.length-r),e,r,a)}function k(e,t,r,a){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,a)}function I(e,t,r,a){return V(q(t),e,r,a)}function _(e,t,r,a){return V(function(e,t){let r,a,i;const n=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),a=r>>8,i=r%256,n.push(i),n.push(a);return n}(t,e.length-r),e,r,a)}function E(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);const a=[];let i=t;for(;i<r;){const t=e[i];let n=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,a,o,c;switch(s){case 1:t<128&&(n=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(n=c));break;case 3:r=e[i+1],a=e[i+2],128==(192&r)&&128==(192&a)&&(c=(15&t)<<12|(63&r)<<6|63&a,c>2047&&(c<55296||c>57343)&&(n=c));break;case 4:r=e[i+1],a=e[i+2],o=e[i+3],128==(192&r)&&128==(192&a)&&128==(192&o)&&(c=(15&t)<<18|(63&r)<<12|(63&a)<<6|63&o,c>65535&&c<1114112&&(n=c))}}null===n?(n=65533,s=1):n>65535&&(n-=65536,a.push(n>>>10&1023|55296),n=56320|1023&n),a.push(n),i+=s}return function(e){const t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);let r="",a=0;for(;a<t;)r+=String.fromCharCode.apply(String,e.slice(a,a+=C));return r}(a)}t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,a=t.length;for(let i=0,n=Math.min(r,a);i<n;++i)if(e[i]!==t[i]){r=e[i],a=t[i];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(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const a=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,Uint8Array))i+t.length>a.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(a,i)):Uint8Array.prototype.set.call(a,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(a,i)}i+=t.length}return a},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,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(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},n&&(c.prototype[n]=c.prototype.inspect),c.prototype.compare=function(e,t,r,a,i){if(Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===i&&(i=this.length),t<0||r>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&t>=r)return 0;if(a>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let n=(i>>>=0)-(a>>>=0),s=(r>>>=0)-(t>>>=0);const o=Math.min(n,s),l=this.slice(a,i),u=e.slice(t,r);for(let e=0;e<o;++e)if(l[e]!==u[e]){n=l[e],s=u[e];break}return n<s?-1:s<n?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(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)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");let n=!1;for(;;)switch(a){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return k(this,e,t,r);case"base64":return I(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(n)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),n=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function A(e,t,r){let a="";r=Math.min(e.length,r);for(let i=t;i<r;++i)a+=String.fromCharCode(127&e[i]);return a}function B(e,t,r){let a="";r=Math.min(e.length,r);for(let i=t;i<r;++i)a+=String.fromCharCode(e[i]);return a}function x(e,t,r){const a=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>a)&&(r=a);let i="";for(let a=t;a<r;++a)i+=K[e[a]];return i}function P(e,t,r){const a=e.slice(t,r);let i="";for(let e=0;e<a.length-1;e+=2)i+=String.fromCharCode(a[e]+256*a[e+1]);return i}function D(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 M(e,t,r,a,i,n){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<n)throw new RangeError('"value" argument is out of bounds');if(r+a>e.length)throw new RangeError("Index out of range")}function O(e,t,r,a,i){H(t,a,i,e,r,7);let n=Number(t&BigInt(4294967295));e[r++]=n,n>>=8,e[r++]=n,n>>=8,e[r++]=n,n>>=8,e[r++]=n;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function R(e,t,r,a,i){H(t,a,i,e,r,7);let n=Number(t&BigInt(4294967295));e[r+7]=n,n>>=8,e[r+6]=n,n>>=8,e[r+5]=n,n>>=8,e[r+4]=n;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function F(e,t,r,a,i,n){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,a,n){return t=+t,r>>>=0,n||F(e,0,r,4),i.write(e,t,r,a,23,4),r+4}function N(e,t,r,a,n){return t=+t,r>>>=0,n||F(e,0,r,8),i.write(e,t,r,a,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const a=this.subarray(e,t);return Object.setPrototypeOf(a,c.prototype),a},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let a=this[e],i=1,n=0;for(;++n<t&&(i*=256);)a+=this[e+n]*i;return a},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let a=this[e+--t],i=1;for(;t>0&&(i*=256);)a+=this[e+--t]*i;return a},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const a=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(a)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=J((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const a=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(a)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let a=this[e],i=1,n=0;for(;++n<t&&(i*=256);)a+=this[e+n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let a=t,i=1,n=this[e+--a];for(;a>0&&(i*=256);)n+=this[e+--a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(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 e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const a=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(a)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=J((function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||$(e,this.length-8);const a=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(a)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,a){e=+e,t>>>=0,r>>>=0,a||M(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,n=0;for(this[t]=255&e;++n<r&&(i*=256);)this[t+n]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,a){e=+e,t>>>=0,r>>>=0,a||M(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,n=1;for(this[t+i]=255&e;--i>=0&&(n*=256);)this[t+i]=e/n&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return O(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=J((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t>>>=0,!a){const a=Math.pow(2,8*r-1);M(this,e,t,r,a-1,-a)}let i=0,n=1,s=0;for(this[t]=255&e;++i<r&&(n*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/n>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t>>>=0,!a){const a=Math.pow(2,8*r-1);M(this,e,t,r,a-1,-a)}let i=r-1,n=1,s=0;for(this[t+i]=255&e;--i>=0&&(n*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/n>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),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||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return O(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=J((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,a){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");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("Index out of range");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);const i=a-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,a):Uint8Array.prototype.set.call(e,this.subarray(r,a),t),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),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);if(1===e.length){const t=e.charCodeAt(0);("utf8"===a&&t<128||"latin1"===a)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let 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{const n=c.isBuffer(e)?e:c.from(e,a),s=n.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=n[i%s]}return this};const z={};function U(e,t,r){z[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function j(e){let t="",r=e.length;const a="-"===e[0]?1:0;for(;r>=a+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,a,i,n){if(e>r||e<t){const a="bigint"==typeof t?"n":"";let i;throw i=n>3?0===t||t===BigInt(0)?`>= 0${a} and < 2${a} ** ${8*(n+1)}${a}`:`>= -(2${a} ** ${8*(n+1)-1}${a}) and < 2 ** ${8*(n+1)-1}${a}`:`>= ${t}${a} and <= ${r}${a}`,new z.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||$(t,e.length-(r+1))}(a,i,n)}function W(e,t){if("number"!=typeof e)throw new z.ERR_INVALID_ARG_TYPE(t,"number",e)}function $(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new z.ERR_BUFFER_OUT_OF_BOUNDS;throw new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,t,r){let a=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=j(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),a+=` It must be ${t}. Received ${i}`,a}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function X(e,t){let r;t=t||1/0;const a=e.length;let i=null;const n=[];for(let s=0;s<a;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(s+1===a){(t-=3)>-1&&n.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&n.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.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;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function q(e){return a.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,a){let i;for(i=0;i<a&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const a=16*r;for(let i=0;i<16;++i)t[a+i]=e[r]+e[i]}return t}();function J(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},7811:(e,t)=>{"use strict";var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,a=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function c(e){var t=String(e);if(i.test(t))return t;if(t.length>0&&!a.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(s,"\\$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||!o.test(r))throw new TypeError("invalid type");var a=r;if(t&&"object"==typeof t)for(var n,s=Object.keys(t).sort(),l=0;l<s.length;l++){if(n=s[l],!i.test(n))throw new TypeError("invalid parameter name");a+="; "+n+"="+c(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;if("function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]),"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 a=t.indexOf(";"),i=-1!==a?t.substr(0,a).trim():t.trim();if(!o.test(i))throw new TypeError("invalid media type");var s=new l(i.toLowerCase());if(-1!==a){var c,u,d;for(r.lastIndex=a;u=r.exec(t);){if(u.index!==a)throw new TypeError("invalid parameter format");a+=u[0].length,c=u[1].toLowerCase(),'"'===(d=u[2])[0]&&(d=d.substr(1,d.length-2).replace(n,"$1")),s.parameters[c]=d}if(a!==t.length)throw new TypeError("invalid parameter format")}return s}},1227:(e,t,r)=>{var a=r(4155);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,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(a++,"%c"===e&&(i=a))})),t.splice(i,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){}return!e&&void 0!==a&&"env"in a&&(e=a.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),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"],t.log=console.debug||console.log||(()=>{}),e.exports=r(2447)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,n,s=null;function o(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];if(!o.enabled)return;const n=o,s=Number(new Date),c=s-(r||s);n.diff=c,n.prev=r,n.curr=s,r=s,a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");let l=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,((e,r)=>{if("%%"===e)return"%";l++;const i=t.formatters[r];if("function"==typeof i){const t=a[l];e=i.call(n,t),a.splice(l,1),l--}return e})),t.formatArgs.call(n,a);const u=n.log||t.log;u.apply(n,a)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=a,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,n=t.enabled(e)),n),set:e=>{s=e}}),"function"==typeof t.init&&t.init(o),o}function a(e,r){const a=t(this.namespace+(void 0===r?":":r)+e);return a.log=this.log,a}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const a=("string"==typeof e?e:"").split(/[\s,]+/),i=a.length;for(r=0;r<i;r++)a[r]&&("-"===(e=a[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,a;for(r=0,a=t.skips.length;r<a;r++)if(t.skips[r].test(e))return!1;for(r=0,a=t.names.length;r<a;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(7824),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},7187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,a=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function n(){n.init.call(this)}e.exports=n,e.exports.once=function(e,t){return new Promise((function(r,a){function i(r){e.removeListener(t,n),a(r)}function n(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}h(e,t,n,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&h(e,"error",t,{once:!0})}(e,i)}))},n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?n.defaultMaxListeners:e._maxListeners}function l(e,t,r,a){var i,n,s,l;if(o(r),void 0===(n=e._events)?(n=e._events=Object.create(null),e._eventsCount=0):(void 0!==n.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),n=e._events),s=n[t]),void 0===s)s=n[t]=r,++e._eventsCount;else if("function"==typeof s?s=n[t]=a?[r,s]:[s,r]:a?s.unshift(r):s.push(r),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(a);return i.listener=r,a.wrapFn=i,i}function f(e,t,r){var a=e._events;if(void 0===a)return[];var i=a[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]: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}(i):m(i,i.length)}function p(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 m(e,t){for(var r=new Array(t),a=0;a<t;++a)r[a]=e[a];return r}function h(e,t,r,a){if("function"==typeof e.on)a.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(n){a.once&&e.removeEventListener(t,i),r(n)}))}}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),n.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},n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(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},n.prototype.getMaxListeners=function(){return c(this)},n.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){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)a(c,this,t);else{var l=c.length,u=m(c,l);for(r=0;r<l;++r)a(u[r],this,t)}return!0},n.prototype.addListener=function(e,t){return l(this,e,t,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(e,t){return l(this,e,t,!0)},n.prototype.once=function(e,t){return o(t),this.on(e,d(this,e,t)),this},n.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,d(this,e,t)),this},n.prototype.removeListener=function(e,t){var r,a,i,n,s;if(o(t),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(i=-1,n=r.length-1;n>=0;n--)if(r[n]===t||r[n].listener===t){s=r[n].listener,i=n;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(a[e]=r[0]),void 0!==a.removeListener&&this.emit("removeListener",e,s||t)}return this},n.prototype.off=n.prototype.removeListener,n.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 i,n=Object.keys(r);for(a=0;a<n.length;++a)"removeListener"!==(i=n[a])&&this.removeAllListeners(i);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},n.prototype.listeners=function(e){return f(this,e,!0)},n.prototype.rawListeners=function(e){return f(this,e,!1)},n.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},n.prototype.listenerCount=p,n.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},1:(module,__unused_webpack_exports,__nested_webpack_require_79153__)=>{"use strict";var Buffer=__nested_webpack_require_79153__(8764).Buffer;const Token=__nested_webpack_require_79153__(3416),strtok3=__nested_webpack_require_79153__(5849),{stringToBytes,tarHeaderChecksumMatches,uint32SyncSafeToken}=__nested_webpack_require_79153__(6188),supported=__nested_webpack_require_79153__(9898),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,i]of t.entries())if(r.mask){if(i!==(r.mask[a]&e[a+r.offset]))return!1}else if(i!==e[a+r.offset])return!1;return!0}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 await e.peekBuffer(t,{length:24,mayBeLess:!0}),a("PS-Adobe-",{offset:2})&&a(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{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 i=await e.readToken(uint32SyncSafeToken);return e.position+i>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(i),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(a("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(r([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(t,{length:30});const n={compressedSize:t.readUInt32LE(18),uncompressedSize:t.readUInt32LE(22),filenameLength:t.readUInt16LE(26),extraFieldLength:t.readUInt16LE(28)};if(n.filename=await e.readToken(new Token.StringType(n.filenameLength,"utf-8")),await e.ignore(n.extraFieldLength),"META-INF/mozilla.rsa"===n.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(n.filename.endsWith(".rels")||n.filename.endsWith(".xml"))switch(n.filename.split("/")[0]){case"_rels":default: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(n.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(n.filename.startsWith("3D/")&&n.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===n.filename&&n.compressedSize===n.uncompressedSize)switch(await e.readToken(new Token.StringType(n.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"}}if(0===n.compressedSize){let s=-1;for(;s<0&&e.position<e.fileInfo.size;)await e.peekBuffer(t,{mayBeLess:!0}),s=t.indexOf("504B0304",0,"hex"),await e.ignore(s>=0?s:t.length)}else await e.ignore(n.compressedSize)}}catch(o){if(!(o instanceof strtok3.EndOfStreamError))throw o}return{ext:"zip",mime:"application/zip"}}if(a("OggS")){await e.ignore(28);const c=Buffer.alloc(8);return await e.readBuffer(c),_check(c,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(c,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(c,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(c,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(c,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(c,[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 l=t.toString("binary",8,12).replace("\0"," ").trim();switch(l){case"avif":return{ext:"avif",mime:"image/avif"};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 l.startsWith("3g")?l.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")){await e.ignore(1350);const u=10485760,d=Buffer.alloc(Math.min(u,e.fileInfo.size));return await e.readBuffer(d,{mayBeLess:!0}),d.includes(Buffer.from("AIPrivateData"))?{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})||r([31,0,11,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 f(){const t=await e.peekNumber(Token.UINT8);let r=128,a=0;for(;0==(t&r);)++a,r>>=1;const i=Buffer.alloc(a+1);return await e.readBuffer(i),i}async function p(){const e=await f(),t=await f();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 function m(t,r){for(;r>0;){const t=await p();if(17026===t.id)return e.readToken(new Token.StringType(t.len,"utf-8"));await e.ignore(t.len),--r}}const h=await p();switch(await m(0,h.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([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(r([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};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(a("-lh0-",{offset:2})||a("-lh1-",{offset:2})||a("-lh2-",{offset:2})||a("-lh3-",{offset:2})||a("-lh4-",{offset:2})||a("-lh5-",{offset:2})||a("-lh6-",{offset:2})||a("-lh7-",{offset:2})||a("-lzs-",{offset:2})||a("-lz4-",{offset:2})||a("-lz5-",{offset:2})||a("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};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(a("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};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(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("solid "))return{ext:"stl",mime:"model/stl"};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 g(){return{length:await e.readToken(Token.INT32_BE),type:await e.readToken(new Token.StringType(4,"binary"))}}await e.ignore(8);do{const y=await g();if(y.length<0)return;switch(y.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(y.length+4)}}while(e.position+8<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(a("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};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 b(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Token.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const T=await b();let w=T.size-24;if(_check(T.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const v=Buffer.alloc(16);if(w-=await e.readBuffer(v),_check(v,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(_check(v,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(w)}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([255,10])||r([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};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(r([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(t,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),a("BEGIN:")){if(a("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(a("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(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([4,0,0,0])&&t.length>=16){const k=t.readUInt32LE(12);if(k>12&&t.length>=k+16)try{const I=t.slice(16,k+16).toString();if(JSON.parse(I).files)return{ext:"asar",mime:"application/x-asar"}}catch(_){}}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(r([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(t,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(a("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(t.length>=2&&r([255,224],{offset:0,mask:[255,224]})){if(r([16],{offset:1,mask:[22]}))return r([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(r([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([6],{offset: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,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)}),module.exports=fileType},9898:e=>{"use strict";e.exports={extensions:["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","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","cfb","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","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","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","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-asf","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/eps","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-cfb","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/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","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","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd"]}},6188:(e,t)=>{"use strict";t.stringToBytes=e=>[...e].map((e=>e.charCodeAt(0))),t.tarHeaderChecksumMatches=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(r))return!1;let a=256;for(let r=t;r<t+148;r++)a+=e[r];for(let r=t+156;r<t+512;r++)a+=e[r];return r===a},t.uint32SyncSafeToken={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4}},645:(e,t)=>{t.read=function(e,t,r,a,i){var n,s,o=8*i-a-1,c=(1<<o)-1,l=c>>1,u=-7,d=r?i-1:0,f=r?-1:1,p=e[t+d];for(d+=f,n=p&(1<<-u)-1,p>>=-u,u+=o;u>0;n=256*n+e[t+d],d+=f,u-=8);for(s=n&(1<<-u)-1,n>>=-u,u+=a;u>0;s=256*s+e[t+d],d+=f,u-=8);if(0===n)n=1-l;else{if(n===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,a),n-=l}return(p?-1:1)*s*Math.pow(2,n-a)},t.write=function(e,t,r,a,i,n){var s,o,c,l=8*n-i-1,u=(1<<l)-1,d=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=a?0:n-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=u):(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>=u?(o=0,s=u):s+d>=1?(o=(t*c-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&o,p+=m,o/=256,i-=8);for(s=s<<i|o,l+=i;l>0;e[r+p]=255&s,p+=m,s/=256,l-=8);e[r+p-m]|=128*h}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},2577:(e,t)=>{"use strict";var r=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/,a=/^[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 n(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,i=e.suffix,n=e.type;if(!n||!a.test(n))throw new TypeError("invalid type");if(!t||!r.test(t))throw new TypeError("invalid subtype");var s=n+"/"+t;if(i){if(!a.test(i))throw new TypeError("invalid suffix");s+="+"+i}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],s=t[2],o=s.lastIndexOf("+");return-1!==o&&(r=s.substr(o+1),s=s.substr(0,o)),new n(a,s,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())}},7824:e=>{var t=1e3,r=60*t,a=60*r,i=24*a;function n(e,t,r,a){var i=t>=1.5*r;return Math.round(e/r)+" "+a+(i?"s":"")}e.exports=function(e,s){s=s||{};var o,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var n=/^(-?(?:\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(n){var s=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*a;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===l&&isFinite(e))return s.long?(o=e,(c=Math.abs(o))>=i?n(o,c,i,"day"):c>=a?n(o,c,a,"hour"):c>=r?n(o,c,r,"minute"):c>=t?n(o,c,t,"second"):o+" ms"):function(e){var n=Math.abs(e);return n>=i?Math.round(e/i)+"d":n>=a?Math.round(e/a)+"h":n>=r?Math.round(e/r)+"m":n>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},3275:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.ParserFactory=t.parseHttpContentType=void 0;const i=r(1),n=r(7811),s=r(2577),o=r(1227),c=r(7584),l=r(5410),u=r(6742),d=r(1004),f=r(498),p=r(8841),m=r(60),h=r(9606),g=r(1915),y=r(2682),b=r(5870),T=r(1533),w=r(6789),v=r(78),k=(0,o.default)("music-metadata:parser:factory");function I(e){const t=n.parse(e),r=s.parse(t.type);return{type:r.type,subtype:r.subtype,suffix:r.suffix,parameters:t.parameters}}t.parseHttpContentType=I;class _{static async parseOnContentType(e,t){const{mimeType:r,path:a,url:i}=await e.fileInfo,n=_.getParserIdForMimeType(r)||_.getParserIdForExtension(a)||_.getParserIdForExtension(i);return n||k("No parser found for MIME-type / extension: "+r),this.parse(e,n,t)}static async parse(e,t,r){if(!t){k("Guess parser on content...");const r=a.alloc(4100);if(await e.peekBuffer(r,{mayBeLess:!0}),e.fileInfo.path&&(t=this.getParserIdForExtension(e.fileInfo.path)),!t){const e=await i.fromBuffer(r);if(!e)throw new Error("Failed to determine audio format");if(k(`Guessed file type is mime=${e.mime}, extension=${e.ext}`),!(t=_.getParserIdForMimeType(e.mime)))throw new Error("Guessed MIME-type not supported: "+e.mime)}}return async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=await _.loadParser(t),i=new c.MetadataCollector(r);return await a.init(i,e,r).parse(),i.toCommonMetadata()}(e,t,r)}static getParserIdForExtension(e){if(e)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":case".bwf":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 l.AIFFParser;case"adts":case"mpeg":return new m.MpegParser;case"apev2":return new u.APEv2Parser;case"asf":return new d.AsfParser;case"dsf":return new T.DsfParser;case"dsdiff":return new w.DsdiffParser;case"flac":return new f.FlacParser;case"mp4":return new p.MP4Parser;case"musepack":return new h.default;case"ogg":return new g.OggParser;case"riff":return new y.WaveParser;case"wavpack":return new b.WavPackParser;case"matroska":return new v.MatroskaParser;default:throw new Error(`Unknown parser type: ${e}`)}}static getExtension(e){const t=e.lastIndexOf(".");return-1===t?"":e.slice(t)}static getParserIdForMimeType(e){let t;try{t=I(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"aac":case"aacp":return"adts";case"flac":return"flac";case"ape":case"monkeys-audio":return"apev2";case"mp4":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=_},5410:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AIFFParser=void 0;const a=r(3416),i=r(1227),n=r(5849),s=r(8928),o=r(8049),c=r(7805),l=r(1162),u=r(4633),d=(0,i.default)("music-metadata:parser:aiff");class f extends c.BasicParser{async parse(){if("FORM"!==(await this.tokenizer.readToken(u.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(;!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=u.Header.len;){d("Reading AIFF chunk at offset="+this.tokenizer.position);const e=await this.tokenizer.readToken(u.Header);d(`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 n.EndOfStreamError))throw e;d("End-of-stream")}}async readData(e){switch(e.chunkID){case"COMM":const t=await this.tokenizer.readToken(new l.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.Uint8ArrayType(e.chunkSize)),i=n.fromBuffer(r);return await(new s.ID3v2Parser).parse(this.metadata,i,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}}}t.AIFFParser=f},1162:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Common=void 0;const a=r(3416),i=r(8049);t.Common=class{constructor(e,t){this.isAifc=t;const r=t?22:18;if(e.chunkSize<r)throw new Error(`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}}},6742:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.APEv2Parser=void 0;const i=r(1227),n=r(5849),s=r(3416),o=r(3769),c=r(7805),l=r(876),u=(0,i.default)("music-metadata:parser:APEv2"),d="APEv2",f="APETAGEX";class p extends c.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,t/e.sampleRate}static async findApeFooterOffset(e,t){const r=a.alloc(l.TagFooter.len);await e.randomRead(r,0,l.TagFooter.len,t-l.TagFooter.len);const i=l.TagFooter.get(r,0);if("APETAGEX"===i.ID)return u(`APE footer header at offset=${t}`),{footer:i,offset:t-i.size}}static parseTagFooter(e,t,r){const a=l.TagFooter.get(t,t.length-l.TagFooter.len);if(a.ID!==f)throw new Error("Unexpected APEv2 Footer ID preamble value.");n.fromBuffer(t);const i=new p;return i.init(e,n.fromBuffer(t),r),i.parseTags(a)}async tryParseApeHeader(){if(this.tokenizer.fileInfo.size&&this.tokenizer.fileInfo.size-this.tokenizer.position<l.TagFooter.len)return void u("No APEv2 header found, end-of-file reached");const e=await this.tokenizer.peekToken(l.TagFooter);if(e.ID===f)return await this.tokenizer.ignore(l.TagFooter.len),this.parseTags(e);if(u(`APEv2 header not found at offset=${this.tokenizer.position}`),this.tokenizer.fileInfo.size){const e=this.tokenizer.fileInfo.size-this.tokenizer.position,t=a.alloc(e);return await this.tokenizer.readBuffer(t),p.parseTagFooter(this.metadata,t,this.options)}}async parse(){const e=await this.tokenizer.readToken(l.DescriptorParser);if("MAC "!==e.ID)throw new Error("Unexpected descriptor ID");this.ape.descriptor=e;const t=e.descriptorBytes-l.DescriptorParser.len,r=await(t>0?this.parseDescriptorExpansion(t):this.parseHeader());return await this.tokenizer.ignore(r.forwardBytes),this.tryParseApeHeader()}async parseTags(e){const t=a.alloc(256);let r=e.size-l.TagFooter.len;u(`Parse APE tags at offset=${this.tokenizer.position}, size=${r}`);for(let i=0;i<e.fields;i++){if(r<l.TagItemHeader.len){this.metadata.addWarning(`APEv2 Tag-header: ${e.fields-i} items remaining, but no more tag data to read.`);break}const n=await this.tokenizer.readToken(l.TagItemHeader);r-=l.TagItemHeader.len+n.size,await this.tokenizer.peekBuffer(t,{length:Math.min(t.length,r)});let c=o.findZero(t,0,t.length);const f=await this.tokenizer.readToken(new s.StringType(c,"ascii"));switch(await this.tokenizer.ignore(1),r-=f.length+1,n.flags.dataType){case l.DataType.text_utf8:{const e=(await this.tokenizer.readToken(new s.StringType(n.size,"utf8"))).split(/\x00/g);for(const t of e)this.metadata.addTag(d,f,t);break}case l.DataType.binary:if(this.options.skipCovers)await this.tokenizer.ignore(n.size);else{const e=a.alloc(n.size);await this.tokenizer.readBuffer(e),c=o.findZero(e,0,e.length);const t=e.toString("utf8",0,c),r=a.from(e.slice(c+1));this.metadata.addTag(d,f,{description:t,data:r})}break;case l.DataType.external_info:u(`Ignore external info ${f}`),await this.tokenizer.ignore(n.size);break;case l.DataType.reserved:u(`Ignore external info ${f}`),this.metadata.addWarning(`APEv2 header declares a reserved datatype for "${f}"`),await this.tokenizer.ignore(n.size)}}}async parseDescriptorExpansion(e){return await this.tokenizer.ignore(e),this.parseHeader()}async parseHeader(){const e=await this.tokenizer.readToken(l.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},8414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.APEv2TagMapper=void 0;const a=r(4132),i={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"};class n extends a.CaseInsensitiveTagMap{constructor(){super(["APEv2"],i)}}t.APEv2TagMapper=n},876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBitSet=t.parseTagFlags=t.TagField=t.TagItemHeader=t.TagFooter=t.Header=t.DescriptorParser=t.DataType=void 0;const a=r(3416),i=r(8049);function n(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)}var o;(o=t.DataType||(t.DataType={}))[o.text_utf8=0]="text_utf8",o[o.binary=1]="binary",o[o.external_info=2]="external_info",o[o.reserved=3]="reserved",t.DescriptorParser={len:52,get:(e,t)=>({ID:i.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.Uint8ArrayType(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:n(a.UINT32_LE.get(e,t+20))})},t.TagItemHeader={len:8,get:(e,t)=>({size:a.UINT32_LE.get(e,t),flags:n(a.UINT32_LE.get(e,t+4))})},t.TagField=e=>new a.Uint8ArrayType(e.size-t.TagFooter.len),t.parseTagFlags=n,t.isBitSet=s},5174:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WmPictureToken=t.MetadataLibraryObjectState=t.MetadataObjectState=t.ExtendedStreamPropertiesObjectState=t.ExtendedContentDescriptionObjectState=t.ContentDescriptionObjectState=t.readCodecEntries=t.HeaderExtensionObject=t.StreamPropertiesObject=t.FilePropertiesObject=t.IgnoreObjectState=t.State=t.HeaderObjectToken=t.TopLevelHeaderObjectToken=t.DataType=void 0;const i=r(3769),n=r(3416),s=r(8054),o=r(2252),c=r(8281);var l;(l=t.DataType||(t.DataType={}))[l.UnicodeString=0]="UnicodeString",l[l.ByteArray=1]="ByteArray",l[l.Bool=2]="Bool",l[l.DWord=3]="DWord",l[l.QWord=4]="QWord",l[l.Word=5]="Word",t.TopLevelHeaderObjectToken={len:30,get:(e,t)=>({objectId:s.default.fromBin(new n.BufferType(16).get(e,t)),objectSize:Number(n.UINT64_LE.get(e,t+16)),numberOfHeaderObjects:n.UINT32_LE.get(e,t+24)})},t.HeaderObjectToken={len:24,get:(e,t)=>({objectId:s.default.fromBin(new n.BufferType(16).get(e,t)),objectSize:Number(n.UINT64_LE.get(e,t+16))})};class u{constructor(e){this.len=Number(e.objectSize)-t.HeaderObjectToken.len}postProcessTag(e,t,r,a){if("WM/Picture"===t)e.push({id:t,value:I.fromBuffer(a)});else{const i=o.AsfUtil.getParserForAttr(r);if(!i)throw new Error("unexpected value headerType: "+r);e.push({id:t,value:i(a)})}}}t.State=u,t.IgnoreObjectState=class extends u{constructor(e){super(e)}get(e,t){return null}};class d extends u{constructor(e){super(e)}get(e,t){return{fileId:s.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:i.getBit(e,t+64,24),seekable:i.getBit(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=d,d.guid=s.default.FilePropertiesObject;class f extends u{constructor(e){super(e)}get(e,t){return{streamType:s.default.decodeMediaType(s.default.fromBin(e,t)),errorCorrectionType:s.default.fromBin(e,t+8)}}}t.StreamPropertiesObject=f,f.guid=s.default.StreamPropertiesObject;class p{constructor(){this.len=22}get(e,t){return{reserved1:s.default.fromBin(e,t),reserved2:e.readUInt16LE(t+16),extensionDataSize:e.readUInt32LE(t+18)}}}t.HeaderExtensionObject=p,p.guid=s.default.HeaderExtensionObject;const m={len:20,get:(e,t)=>({entryCount:e.readUInt16LE(t+16)})};async function h(e){const t=await e.readNumber(n.UINT16_LE);return(await e.readToken(new n.StringType(2*t,"utf16le"))).replace("\0","")}async function g(e){const t=await e.readNumber(n.UINT16_LE),r=a.alloc(t);return await e.readBuffer(r),r}async function y(e){const t=await e.readNumber(n.UINT16_LE);return{type:{videoCodec:1==(1&t),audioCodec:2==(2&t)},codecName:await h(e),description:await h(e),information:await g(e)}}t.readCodecEntries=async function(e){const t=await e.readToken(m),r=[];for(let a=0;a<t.entryCount;++a)r.push(await y(e));return r};class b extends u{constructor(e){super(e)}get(e,t){const r=[];let a=t+10;for(let i=0;i<b.contentDescTags.length;++i){const n=e.readUInt16LE(t+2*i);if(n>0){const t=b.contentDescTags[i],s=a+n;r.push({id:t,value:o.AsfUtil.parseUnicodeAttr(e.slice(a,s))}),a=s}}return r}}t.ContentDescriptionObjectState=b,b.guid=s.default.ContentDescriptionObject,b.contentDescTags=["Title","Author","Copyright","Description","Rating"];class T extends u{constructor(e){super(e)}get(e,t){const r=[],a=e.readUInt16LE(t);let i=t+2;for(let t=0;t<a;t+=1){const t=e.readUInt16LE(i);i+=2;const a=o.AsfUtil.parseUnicodeAttr(e.slice(i,i+t));i+=t;const n=e.readUInt16LE(i);i+=2;const s=e.readUInt16LE(i);i+=2;const c=e.slice(i,i+s);i+=s,this.postProcessTag(r,a,n,c)}return r}}t.ExtendedContentDescriptionObjectState=T,T.guid=s.default.ExtendedContentDescriptionObject;class w extends u{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:i.getBit(e,t+40,0),seekableFlag:i.getBit(e,t+40,1),resendLiveCleanpointsFlag:i.getBit(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=w,w.guid=s.default.ExtendedStreamPropertiesObject;class v extends u{constructor(e){super(e)}get(e,t){const r=[],i=a.from(e),n=i.readUInt16LE(t);let s=t+2;for(let e=0;e<n;e+=1){s+=4;const e=i.readUInt16LE(s);s+=2;const t=i.readUInt16LE(s);s+=2;const a=i.readUInt32LE(s);s+=4;const n=o.AsfUtil.parseUnicodeAttr(i.slice(s,s+e));s+=e;const c=i.slice(s,s+a);s+=a,this.postProcessTag(r,n,t,c)}return r}}t.MetadataObjectState=v,v.guid=s.default.MetadataObject;class k extends v{constructor(e){super(e)}}t.MetadataLibraryObjectState=k,k.guid=s.default.MetadataLibraryObject;class I{constructor(e){this.len=e}static fromBase64(e){return this.fromBuffer(a.from(e,"base64"))}static fromBuffer(e){return new I(e.length).get(e,0)}get(e,t){const r=e.readUInt8(t++),a=e.readInt32LE(t);let i=5;for(;0!==e.readUInt16BE(i);)i+=2;const n=e.slice(5,i).toString("utf16le");for(;0!==e.readUInt16BE(i);)i+=2;const s=e.slice(5,i).toString("utf16le");return{type:c.AttachedPictureType[r],format:n,description:s,size:a,data:e.slice(i+4)}}}t.WmPictureToken=I},1004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsfParser=void 0;const a=r(1227),i=r(6032),n=r(8054),s=r(5174),o=r(7805),c=(0,a.default)("music-metadata:parser:ASF");class l extends o.BasicParser{async parse(){const e=await this.tokenizer.readToken(s.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(s.HeaderObjectToken);switch(c("header GUID=%s",e.objectId.str),e.objectId.str){case s.FilePropertiesObject.guid.str:const r=await this.tokenizer.readToken(new s.FilePropertiesObject(e));this.metadata.setFormat("duration",Number(r.playDuration/BigInt(1e3))/1e4-Number(r.preroll)/1e3),this.metadata.setFormat("bitrate",r.maximumBitrate);break;case s.StreamPropertiesObject.guid.str:const a=await this.tokenizer.readToken(new s.StreamPropertiesObject(e));this.metadata.setFormat("container","ASF/"+a.streamType);break;case s.HeaderExtensionObject.guid.str:const o=await this.tokenizer.readToken(new s.HeaderExtensionObject);await this.parseExtensionObject(o.extensionDataSize);break;case s.ContentDescriptionObjectState.guid.str:t=await this.tokenizer.readToken(new s.ContentDescriptionObjectState(e)),this.addTags(t);break;case s.ExtendedContentDescriptionObjectState.guid.str:t=await this.tokenizer.readToken(new s.ExtendedContentDescriptionObjectState(e)),this.addTags(t);break;case n.default.CodecListObject.str:const l=await s.readCodecEntries(this.tokenizer);l.forEach((e=>{this.metadata.addStreamInfo({type:e.type.videoCodec?i.TrackType.video:i.TrackType.audio,codecName:e.codecName})}));const u=l.filter((e=>e.type.audioCodec)).map((e=>e.codecName)).join("/");this.metadata.setFormat("codec",u);break;case n.default.StreamBitratePropertiesObject.str:await this.tokenizer.ignore(e.objectSize-s.HeaderObjectToken.len);break;case n.default.PaddingObject.str:c("Padding: %s bytes",e.objectSize-s.HeaderObjectToken.len),await this.tokenizer.ignore(e.objectSize-s.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 s.IgnoreObjectState(e))}}while(--e)}addTags(e){e.forEach((e=>{this.metadata.addTag("asf",e.id,e.value)}))}async parseExtensionObject(e){do{const t=await this.tokenizer.readToken(s.HeaderObjectToken),r=t.objectSize-s.HeaderObjectToken.len;switch(t.objectId.str){case s.ExtendedStreamPropertiesObjectState.guid.str:await this.tokenizer.readToken(new s.ExtendedStreamPropertiesObjectState(t));break;case s.MetadataObjectState.guid.str:const e=await this.tokenizer.readToken(new s.MetadataObjectState(t));this.addTags(e);break;case s.MetadataLibraryObjectState.guid.str:const a=await this.tokenizer.readToken(new s.MetadataLibraryObjectState(t));this.addTags(a);break;case n.default.PaddingObject.str:await this.tokenizer.ignore(r);break;case n.default.CompatibilityObject.str:this.tokenizer.ignore(r);break;case n.default.ASF_Index_Placeholder_Object.str:await this.tokenizer.ignore(r);break;default:this.metadata.addWarning("Ignore ASF-Object-GUID: "+t.objectId.str),await this.tokenizer.readToken(new s.IgnoreObjectState(t))}e-=t.objectSize}while(e>0)}}t.AsfParser=l},9004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsfTagMapper=void 0;const a=r(9918),i={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 n extends a.CommonTagMapper{static toRating(e){return{rating:parseFloat(e+1)/5}}constructor(){super(["asf"],i)}postMap(e){if("WM/SharedUserRating"===e.id){const t=e.id.split(":");e.value=n.toRating(e.value),e.id=t[0]}}}t.AsfTagMapper=n},2252:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.AsfUtil=void 0;const i=r(3416),n=r(3769);class s{static getParserForAttr(e){return s.attributeParsers[e]}static parseUnicodeAttr(e){return n.stripNulls(n.decodeString(e,"utf16le"))}static parseByteArrayAttr(e){return a.from(e)}static parseBoolAttr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return 1===s.parseWordAttr(e,t)}static parseDWordAttr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.readUInt32LE(t)}static parseQWordAttr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i.UINT64_LE.get(e,t)}static parseWordAttr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.readUInt16LE(t)}}t.AsfUtil=s,s.attributeParsers=[s.parseUnicodeAttr,s.parseByteArrayAttr,s.parseBoolAttr,s.parseDWordAttr,s.parseQWordAttr,s.parseWordAttr,s.parseByteArrayAttr]},8054:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0});class i{constructor(e){this.str=e}static fromBin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new i(this.decode(e,t))}static decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]: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 i.AudioMedia.str:return"audio";case i.VideoMedia.str:return"video";case i.CommandMedia.str:return"command";case i.Degradable_JPEG_Media.str:return"degradable-jpeg";case i.FileTransferMedia.str:return"file-transfer";case i.BinaryMedia.str:return"binary"}}static encode(e){const t=a.alloc(16);return t.writeUInt32LE(parseInt(e.slice(0,8),16),0),t.writeUInt16LE(parseInt(e.slice(9,13),16),4),t.writeUInt16LE(parseInt(e.slice(14,18),16),6),a.from(e.slice(19,23),"hex").copy(t,8),a.from(e.slice(24),"hex").copy(t,10),t}equals(e){return this.str===e.str}toBin(){return i.encode(this.str)}}t.default=i,i.HeaderObject=new i("75B22630-668E-11CF-A6D9-00AA0062CE6C"),i.DataObject=new i("75B22636-668E-11CF-A6D9-00AA0062CE6C"),i.SimpleIndexObject=new i("33000890-E5B1-11CF-89F4-00A0C90349CB"),i.IndexObject=new i("D6E229D3-35DA-11D1-9034-00A0C90349BE"),i.MediaObjectIndexObject=new i("FEB103F8-12AD-4C64-840F-2A1D2F7AD48C"),i.TimecodeIndexObject=new i("3CB73FD0-0C4A-4803-953D-EDF7B6228F0C"),i.FilePropertiesObject=new i("8CABDCA1-A947-11CF-8EE4-00C00C205365"),i.StreamPropertiesObject=new i("B7DC0791-A9B7-11CF-8EE6-00C00C205365"),i.HeaderExtensionObject=new i("5FBF03B5-A92E-11CF-8EE3-00C00C205365"),i.CodecListObject=new i("86D15240-311D-11D0-A3A4-00A0C90348F6"),i.ScriptCommandObject=new i("1EFB1A30-0B62-11D0-A39B-00A0C90348F6"),i.MarkerObject=new i("F487CD01-A951-11CF-8EE6-00C00C205365"),i.BitrateMutualExclusionObject=new i("D6E229DC-35DA-11D1-9034-00A0C90349BE"),i.ErrorCorrectionObject=new i("75B22635-668E-11CF-A6D9-00AA0062CE6C"),i.ContentDescriptionObject=new i("75B22633-668E-11CF-A6D9-00AA0062CE6C"),i.ExtendedContentDescriptionObject=new i("D2D0A440-E307-11D2-97F0-00A0C95EA850"),i.ContentBrandingObject=new i("2211B3FA-BD23-11D2-B4B7-00A0C955FC6E"),i.StreamBitratePropertiesObject=new i("7BF875CE-468D-11D1-8D82-006097C9A2B2"),i.ContentEncryptionObject=new i("2211B3FB-BD23-11D2-B4B7-00A0C955FC6E"),i.ExtendedContentEncryptionObject=new i("298AE614-2622-4C17-B935-DAE07EE9289C"),i.DigitalSignatureObject=new i("2211B3FC-BD23-11D2-B4B7-00A0C955FC6E"),i.PaddingObject=new i("1806D474-CADF-4509-A4BA-9AABCB96AAE8"),i.ExtendedStreamPropertiesObject=new i("14E6A5CB-C672-4332-8399-A96952065B5A"),i.AdvancedMutualExclusionObject=new i("A08649CF-4775-4670-8A16-6E35357566CD"),i.GroupMutualExclusionObject=new i("D1465A40-5A79-4338-B71B-E36B8FD6C249"),i.StreamPrioritizationObject=new i("D4FED15B-88D3-454F-81F0-ED5C45999E24"),i.BandwidthSharingObject=new i("A69609E6-517B-11D2-B6AF-00C04FD908E9"),i.LanguageListObject=new i("7C4346A9-EFE0-4BFC-B229-393EDE415C85"),i.MetadataObject=new i("C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA"),i.MetadataLibraryObject=new i("44231C94-9498-49D1-A141-1D134E457054"),i.IndexParametersObject=new i("D6E229DF-35DA-11D1-9034-00A0C90349BE"),i.MediaObjectIndexParametersObject=new i("6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7"),i.TimecodeIndexParametersObject=new i("F55E496D-9797-4B5D-8C8B-604DFE9BFB24"),i.CompatibilityObject=new i("26F18B5D-4584-47EC-9F5F-0E651F0452C9"),i.AdvancedContentEncryptionObject=new i("43058533-6981-49E6-9B74-AD12CB86D58C"),i.AudioMedia=new i("F8699E40-5B4D-11CF-A8FD-00805F5C442B"),i.VideoMedia=new i("BC19EFC0-5B4D-11CF-A8FD-00805F5C442B"),i.CommandMedia=new i("59DACFC0-59E6-11D0-A3AC-00A0C90348F6"),i.JFIF_Media=new i("B61BE100-5B4E-11CF-A8FD-00805F5C442B"),i.Degradable_JPEG_Media=new i("35907DE0-E415-11CF-A917-00805F5C442B"),i.FileTransferMedia=new i("91BD222C-F21C-497A-8B6D-5AA86BFC0185"),i.BinaryMedia=new i("3AFB65E2-47EF-40F2-AC2C-70A90D71D343"),i.ASF_Index_Placeholder_Object=new i("D9AADE20-7C17-4F9C-BC28-8555DD98E2A2")},7805:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BasicParser=void 0,t.BasicParser=class{init(e,t,r){return this.metadata=e,this.tokenizer=t,this.options=r,this}}},4132:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CaseInsensitiveTagMap=void 0;const a=r(9918);class i 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()]}}t.CaseInsensitiveTagMap=i},6592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CombinedTagMapper=void 0;const a=r(2939),i=r(4005),n=r(9004),s=r(7183),o=r(8414),c=r(7852),l=r(9860),u=r(5756),d=r(5481);t.CombinedTagMapper=class{constructor(){this.tagMappers={},[new a.ID3v1TagMapper,new s.ID3v22TagMapper,new i.ID3v24TagMapper,new c.MP4TagMapper,new c.MP4TagMapper,new l.VorbisTagMapper,new o.APEv2TagMapper,new n.AsfTagMapper,new u.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}}},8049:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.FourCcToken=void 0;const i=r(3769),n=/^[\x21-\x7e©][\x20-\x7e\x00()]{3}/;t.FourCcToken={len:4,get:(e,r)=>{const a=e.toString("binary",r,r+t.FourCcToken.len);if(!a.match(n))throw new Error(`FourCC contains invalid characters: ${i.a2hex(a)} "${a}"`);return a},put:(e,t,r)=>{const i=a.from(r,"binary");if(4!==i.length)throw new Error("Invalid length");return i.copy(e,t)}}},9918:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommonTagMapper=void 0;class r{constructor(e,t){this.tagTypes=e,this.tagMap=t}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=r,r.maxRatingScore=1},103:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUnique=t.isSingleton=t.commonTags=void 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:!1,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:!0},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},longDescription:{multiple:!1},category:{multiple:!0},hdVideo:{multiple:!1},keywords:{multiple:!0},movement:{multiple:!1},movementIndex:{multiple:!1},movementTotal:{multiple:!1},podcastId:{multiple:!1},showMovement:{multiple:!1},stik:{multiple:!1}},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}},7584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.joinArtists=t.MetadataCollector=void 0;const a=r(6032),i=r(1227),n=r(103),s=r(6592),o=r(9918),c=r(3769),l=r(1),u=(0,i.default)("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},movementIndex:{}},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){u(`streamInfo: type=${a.TrackType[e.type]}, codec=${e.codecName}`),this.format.trackInfo.push(e)}setFormat(e,t){u(`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){u(`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"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"movementTotal":return void(this.common.movementIndex.of=o.CommonTagMapper.toIntOrNull(t.value));case"track":case"disk":case"movementIndex":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"bpm":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=(0,c.toRatio)(t.value);break;case"replaygain_track_minmax":t.value=t.value.split(",").map((e=>parseInt(e,10)));break;case"replaygain_undo":const i=t.value.split(",").map((e=>parseInt(e,10)));t.value={leftChannel:i[0],rightChannel:i[1]};break;case"gapless":case"compilation":case"podcast":case"showMovement":t.value="1"===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&&e.data.length>0){if(!e.format){const t=await l.fromBuffer(e.data);if(!t)return null;e.format=t.mime}return e.format=e.format.toLocaleLowerCase(),"image/jpg"===e.format&&(e.format="image/jpeg"),e}return this.addWarning("Empty picture tag found"),null}toCommon(e,t,r){const a={id:t,value:r},i=this.tagMapper.mapTag(e,a,this);i&&this.postMap(e,i)}setGenericTag(e,t){u(`common.${t.id} = ${t.value}`);const r=this.commonOrigin[t.id]||1e3,a=this.originPriority[e];if((0,n.isSingleton)(t.id)){if(!(a<=r))return u(`Ignore native tag (singleton): ${e}.${t.id} = ${t.value}`);this.common[t.id]=t.value,this.commonOrigin[t.id]=a}else if(a===r)(0,n.isUnique)(t.id)&&-1!==this.common[t.id].indexOf(t.value)?u(`Ignore duplicate value: ${e}.${t.id} = ${t.value}`):this.common[t.id].push(t.value);else{if(!(a<r))return u(`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},9461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RandomUint8ArrayReader=void 0,t.RandomUint8ArrayReader=class{constructor(e){this.uint8Array=e,this.fileSize=e.length}async randomRead(e,t,r,a){return e.set(this.uint8Array.subarray(a,a+r),t),r}}},3769:(e,t,r)=>{"use strict";var a=r(8764).Buffer;function i(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(e,t,r+o,c)),s}function n(e){return 10*Math.log10(e)}function s(e){return Math.pow(10,e/10)}Object.defineProperty(t,"__esModule",{value:!0}),t.toRatio=t.dbToRatio=t.ratioToDb=t.a2hex=t.isBitSet=t.getBitAllignedNumber=t.stripNulls=t.decodeString=t.trimRightNull=t.findZero=t.getBit=void 0,t.getBit=function(e,t,r){return 0!=(e[t]&1<<r)},t.findZero=function(e,t,r,a){let i=t;if("utf16le"===a){for(;0!==e[i]||0!==e[i+1];){if(i>=r)return r;i+=2}return i}for(;0!==e[i];){if(i>=r)return r;i++}return i},t.trimRightNull=function(e){const t=e.indexOf("\0");return-1===t?e:e.substr(0,t)},t.decodeString=function e(t,r){if(255===t[0]&&254===t[1])return e(t.subarray(2),r);if("utf16le"===r&&254===t[0]&&255===t[1]){if(0!=(1&t.length))throw new Error("Expected even number of octets for 16-bit unicode string");return e(function(e){const t=e.length;if(0!=(1&t))throw new Error("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}(t),r)}return a.from(t).toString(r)},t.stripNulls=function(e){return(e=e.replace(/^\x00+/g,"")).replace(/\x00+$/g,"")},t.getBitAllignedNumber=i,t.isBitSet=function(e,t,r){return 1===i(e,t,r,1)},t.a2hex=function(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(" ")},t.ratioToDb=n,t.dbToRatio=s,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:s(e)}:{dB:n(e),ratio:e}}}},523:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanAppendingHeaders=t.selectCover=t.ratingToStars=t.orderTags=t.parseFromTokenizer=t.parseBuffer=t.parseStream=void 0;const a=r(5849),i=r(3275),n=r(9461),s=r(6742),o=r(2282),c=r(9941);function l(e,t){return i.ParserFactory.parseOnContentType(e,t)}async function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.fileSize;await(0,o.hasID3v1Header)(e)&&(r-=128,r-=await(0,c.getLyricsHeaderLength)(e)),t.apeHeader=await s.APEv2Parser.findApeFooterOffset(e,r)}t.parseStream=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(a.fromStream(e,"string"==typeof t?{mimeType:t}:t),r)},t.parseBuffer=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=new n.RandomUint8ArrayReader(e);await u(i,r);const s=a.fromBuffer(e,"string"==typeof t?{mimeType:t}:t);return l(s,r)},t.parseFromTokenizer=l,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.selectCover=function(e){return e?e.reduce(((e,t)=>t.name&&t.name.toLowerCase()in["front","cover","cover (front)"]?t:e)):null},t.scanAppendingHeaders=u},6789:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DsdiffParser=void 0;const a=r(3416),i=r(1227),n=r(5849),s=r(8049),o=r(7805),c=r(8928),l=r(9187),u=(0,i.default)("music-metadata:parser:aiff");class d extends o.BasicParser{async parse(){const e=await this.tokenizer.readToken(l.ChunkHeader64);if("FRM8"!==e.chunkID)throw new Error("Unexpected chunk-ID");const t=(await this.tokenizer.readToken(s.FourCcToken)).trim();if("DSD"===t)return this.metadata.setFormat("container",`DSDIFF/${t}`),this.metadata.setFormat("lossless",!0),this.readFmt8Chunks(e.chunkSize-BigInt(s.FourCcToken.len));throw Error(`Unsupported DSDIFF type: ${t}`)}async readFmt8Chunks(e){for(;e>=l.ChunkHeader64.len;){const t=await this.tokenizer.readToken(l.ChunkHeader64);u(`Chunk id=${t.chunkID}`),await this.readData(t),e-=BigInt(l.ChunkHeader64.len)+t.chunkSize}}async readData(e){u(`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(a.UINT32_LE);u(`DSDIFF version=${t}`);break;case"PROP":if("SND "!==await this.tokenizer.readToken(s.FourCcToken))throw new Error("Unexpected PROP-chunk ID");await this.handleSoundPropertyChunks(e.chunkSize-BigInt(s.FourCcToken.len));break;case"ID3":const r=await this.tokenizer.readToken(new a.Uint8ArrayType(Number(e.chunkSize))),i=n.fromBuffer(r);await(new c.ID3v2Parser).parse(this.metadata,i,this.options);break;default:u(`Ignore chunk[ID=${e.chunkID}, size=${e.chunkSize}]`);break;case"DSD":this.metadata.setFormat("numberOfSamples",Number(e.chunkSize*BigInt(8)/BigInt(this.metadata.format.numberOfChannels))),this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate)}const r=e.chunkSize-BigInt(this.tokenizer.position-t);r>0&&(u(`After Parsing chunk, remaining ${r} bytes`),await this.tokenizer.ignore(Number(r)))}async handleSoundPropertyChunks(e){for(u(`Parsing sound-property-chunks, remainingSize=${e}`);e>0;){const t=await this.tokenizer.readToken(l.ChunkHeader64);u(`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(a.UINT32_BE);this.metadata.setFormat("sampleRate",e);break;case"CHNL":const r=await this.tokenizer.readToken(a.UINT16_BE);this.metadata.setFormat("numberOfChannels",r),await this.handleChannelChunks(t.chunkSize-BigInt(a.UINT16_BE.len));break;case"CMPR":const i=(await this.tokenizer.readToken(s.FourCcToken)).trim(),n=await this.tokenizer.readToken(a.UINT8),o=await this.tokenizer.readToken(new a.StringType(n,"ascii"));"DSD"===i&&(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("bitsPerSample",1)),this.metadata.setFormat("codec",`${i} (${o})`);break;case"ABSS":const c=await this.tokenizer.readToken(a.UINT16_BE),l=await this.tokenizer.readToken(a.UINT8),d=await this.tokenizer.readToken(a.UINT8),f=await this.tokenizer.readToken(a.UINT32_BE);u(`ABSS ${c}:${l}:${d}.${f}`);break;case"LSCO":const p=await this.tokenizer.readToken(a.UINT16_BE);u(`LSCO lsConfig=${p}`);break;default:u(`Unknown sound-property-chunk[ID=${t.chunkID}, size=${t.chunkSize}]`),await this.tokenizer.ignore(Number(t.chunkSize))}const i=t.chunkSize-BigInt(this.tokenizer.position-r);i>0&&(u(`After Parsing sound-property-chunk ${t.chunkSize}, remaining ${i} bytes`),await this.tokenizer.ignore(Number(i))),e-=BigInt(l.ChunkHeader64.len)+t.chunkSize,u(`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){u(`Parsing channel-chunks, remainingSize=${e}`);const t=[];for(;e>=s.FourCcToken.len;){const r=await this.tokenizer.readToken(s.FourCcToken);u(`Channel[ID=${r}]`),t.push(r),e-=BigInt(s.FourCcToken.len)}return u(`Channels: ${t.join(", ")}`),t}}t.DsdiffParser=d},9187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkHeader64=void 0;const a=r(3416),i=r(8049);t.ChunkHeader64={len:12,get:(e,t)=>({chunkID:i.FourCcToken.get(e,t),chunkSize:a.INT64_BE.get(e,t+4)})}},4101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormatChunk=t.ChannelType=t.DsdChunk=t.ChunkHeader=void 0;const a=r(3416),i=r(8049);var n;t.ChunkHeader={len:12,get:(e,t)=>({id:i.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)})},(n=t.ChannelType||(t.ChannelType={}))[n.mono=1]="mono",n[n.stereo=2]="stereo",n[n.channels=3]="channels",n[n.quad=4]="quad",n[n["4 channels"]=5]="4 channels",n[n["5 channels"]=6]="5 channels",n[n["5.1 channels"]=7]="5.1 channels",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)})}},1533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DsfParser=void 0;const a=r(1227),i=r(5159),n=r(4101),s=r(8928),o=(0,a.default)("music-metadata:parser:DSF");class c extends i.AbstractID3Parser{async postId3v2Parse(){const e=this.tokenizer.position,t=await this.tokenizer.readToken(n.ChunkHeader);if("DSD "!==t.id)throw new Error("Invalid chunk signature");this.metadata.setFormat("container","DSF"),this.metadata.setFormat("lossless",!0);const r=await this.tokenizer.readToken(n.DsdChunk);if(r.metadataPointer!==BigInt(0))return o(`expect ID3v2 at offset=${r.metadataPointer}`),await this.parseChunks(r.fileSize-t.size),await this.tokenizer.ignore(Number(r.metadataPointer)-this.tokenizer.position-e),(new s.ID3v2Parser).parse(this.metadata,this.tokenizer,this.options);o("No ID3v2 tag present")}async parseChunks(e){for(;e>=n.ChunkHeader.len;){const t=await this.tokenizer.readToken(n.ChunkHeader);if(o(`Parsing chunk name=${t.id} size=${t.size}`),"fmt "===t.id){const e=await this.tokenizer.readToken(n.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",Number(e.sampleCount)/e.samplingFrequency);const t=e.bitsPerSample*e.samplingFrequency*e.channelNum;return void this.metadata.setFormat("bitrate",t)}this.tokenizer.ignore(Number(t.size)-n.ChunkHeader.len),e-=t.size}}}t.DsfParser=c},498:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlacParser=void 0;const a=r(3416),i=r(1227),n=r(3769),s=r(2127),o=r(5159),c=r(8049),l=r(4210),u=r(441),d=(0,i.default)("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={}));class p extends o.AbstractID3Parser{constructor(){super(...arguments),this.padding=0}init(e,t,r){return super.init(e,t,r),this.vorbisParser=new l.VorbisParser(e,r),this}async postId3v2Parse(){if("fLaC"!==(await this.tokenizer.readToken(c.FourCcToken)).toString())throw new Error("Invalid FLAC preamble");let e;do{e=await this.tokenizer.readToken(m.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!==m.BlockStreamInfo.len)throw new Error("Unexpected block-stream-info length");const t=await this.tokenizer.readToken(m.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),t.totalSamples>0&&this.metadata.setFormat("duration",t.totalSamples/t.sampleRate)}async parseComment(e){const t=await this.tokenizer.readToken(new a.Uint8ArrayType(e)),r=new u.VorbisDecoder(t,0);r.readStringUtf8();const i=r.readInt32();for(let e=0;e<i;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 s.VorbisPictureToken(e));this.vorbisParser.addTag("METADATA_BLOCK_PICTURE",t)}}}t.FlacParser=p;class m{}m.BlockHeader={len:4,get:(e,t)=>({lastBlock:n.getBit(e,t,7),type:n.getBitAllignedNumber(e,t,1,7),length:a.UINT24_BE.get(e,t+1)})},m.BlockStreamInfo={len:34,get:(e,t)=>({minimumBlockSize:a.UINT16_BE.get(e,t),maximumBlockSize:a.UINT16_BE.get(e,t+2)/1e3,minimumFrameSize:a.UINT24_BE.get(e,t+4),maximumFrameSize:a.UINT24_BE.get(e,t+7),sampleRate:a.UINT24_BE.get(e,t+10)>>4,channels:n.getBitAllignedNumber(e,t+12,4,3)+1,bitsPerSample:n.getBitAllignedNumber(e,t+12,7,5)+1,totalSamples:n.getBitAllignedNumber(e,t+13,4,36),fileMD5:new a.Uint8ArrayType(16).get(e,t+18)})}},2282:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hasID3v1Header=t.ID3v1Parser=t.Genres=void 0;const i=r(1227),n=r(3416),s=r(3769),o=r(7805),c=r(6742),l=(0,i.default)("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 d(3).get(e,t);return"TAG"===r?{header:r,title:new d(30).get(e,t+3),artist:new d(30).get(e,t+33),album:new d(30).get(e,t+63),year:new d(4).get(e,t+93),comment:new d(28).get(e,t+97),zeroByte:n.UINT8.get(e,t+127),track:n.UINT8.get(e,t+126),genre:n.UINT8.get(e,t+127)}:null}};class d extends n.StringType{constructor(e){super(e,"binary")}get(e,t){let r=super.get(e,t);return r=s.trimRightNull(r),r=r.trim(),r.length>0?r:void 0}}class f extends o.BasicParser{static getGenre(e){if(e<t.Genres.length)return t.Genres[e]}async parse(){if(!this.tokenizer.fileInfo.size)return void l("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 c.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 l("Already consumed the last 128 bytes");const t=await this.tokenizer.readToken(u,e);if(t){l("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=f.getGenre(t.genre);e&&this.addTag("genre",e)}else l("ID3v1 header not found at: pos=%s",this.tokenizer.fileInfo.size-u.len)}addTag(e,t){this.metadata.addTag("ID3v1",e,t)}}t.ID3v1Parser=f,t.hasID3v1Header=async function(e){if(e.fileSize>=128){const t=a.alloc(3);return await e.randomRead(t,0,t.length,e.fileSize-128),"TAG"===t.toString("binary")}return!1}},2939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ID3v1TagMapper=void 0;const a=r(9918),i={title:"title",artist:"artist",album:"album",year:"year",comment:"comment",track:"track",genre:"genre"};class n extends a.CommonTagMapper{constructor(){super(["ID3v1"],i)}}t.ID3v1TagMapper=n},5159:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractID3Parser=void 0;const a=r(5849),i=r(1227),n=r(8281),s=r(8928),o=r(2282),c=r(7805),l=(0,i.default)("music-metadata:parser:ID3");class u extends c.BasicParser{constructor(){super(...arguments),this.id3parser=new s.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;l("End-of-stream")}}finalize(){}async parseID3v2(){if(await this.tryReadId3v2Headers(),l("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),await this.postId3v2Parse(),this.options.skipPostHeaders&&this.metadata.hasAny())this.finalize();else{const e=new o.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 l("Found ID3v2 header, pos=%s",this.tokenizer.position),await this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}}t.AbstractID3Parser=u},907:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.FrameParser=t.parseGenre=void 0;const i=r(1227),n=r(3416),s=r(3769),o=r(8281),c=r(2282),l=(0,i.default)("music-metadata:id3v2:frame-parser"),u="latin1";function d(e){const t=[];let r,a="";for(const i of e)if("string"==typeof r)if("("===i&&""===r)a+="(",r=void 0;else if(")"===i){""!==a&&(t.push(a),a="");const e=f(r);e&&t.push(e),r=void 0}else r+=i;else"("===i?r="":a+=i;return a&&(0===t.length&&a.match(/^\d*$/)&&(a=c.Genres[a]),t.push(a)),t}function f(e){return"RX"===e?"Remix":"CR"===e?"Cover":e.match(/^\d*$/)?c.Genres[e]:void 0}t.parseGenre=d;class p{constructor(e,t){this.major=e,this.warningCollector=t}readData(e,t,r){if(0===e.length)return void this.warningCollector.addWarning(`id3v2.${this.major} header has empty tag type=${t}`);const{encoding:i,bom:c}=o.TextEncodingToken.get(e,0),f=e.length;let m=0,h=[];const g=p.getNullTerminatorLength(i);let y;const b={};switch(l(`Parsing tag type=${t}, encoding=${i}, bom=${c}`),"TXXX"!==t&&"T"===t[0]?"T*":t){case"T*":case"IPLS":case"MVIN":case"MVNM":case"PCS":case"PCST":let c;try{c=s.decodeString(e.slice(1),i).replace(/\x00+$/,"")}catch(e){this.warningCollector.addWarning(`id3v2.${this.major} type=${t} header has invalid string value: ${e.message}`)}switch(t){case"TMCL":case"TIPL":case"IPLS":h=this.splitValue(t,c),h=p.functionList(h);break;case"TRK":case"TRCK":case"TPOS":h=c;break;case"TCOM":case"TEXT":case"TOLY":case"TOPE":case"TPE1":case"TSRC":h=this.splitValue(t,c);break;case"TCO":case"TCON":h=this.splitValue(t,c).map((e=>d(e))).reduce(((e,t)=>e.concat(t)),[]);break;case"PCS":case"PCST":h=this.major>=4?this.splitValue(t,c):[c],h=Array.isArray(h)&&""===h[0]?1:0;break;default:h=this.major>=4?this.splitValue(t,c):[c]}break;case"TXXX":h=p.readIdentifierAndData(e,m+1,f,i),h={description:h.id,text:this.splitValue(t,s.decodeString(h.data,i).replace(/\x00+$/,""))};break;case"PIC":case"APIC":if(r){const t={};switch(m+=1,this.major){case 2:t.format=s.decodeString(e.slice(m,m+3),"latin1"),m+=3;break;case 3:case 4:y=s.findZero(e,m,f,u),t.format=s.decodeString(e.slice(m,y),u),m=y+1;break;default:throw new Error("Warning: unexpected major versionIndex: "+this.major)}t.format=p.fixPictureMimeType(t.format),t.type=o.AttachedPictureType[e[m]],m+=1,y=s.findZero(e,m,f,i),t.description=s.decodeString(e.slice(m,y),i),m=y+g,t.data=a.from(e.slice(m,f)),h=t}break;case"CNT":case"PCNT":h=n.UINT32_BE.get(e,0);break;case"SYLT":for(m+=7,h=[];m<f;){const t=e.slice(m,m=s.findZero(e,m,f,i));m+=5,h.push(s.decodeString(t,i))}break;case"ULT":case"USLT":case"COM":case"COMM":m+=1,b.language=s.decodeString(e.slice(m,m+3),u),m+=3,y=s.findZero(e,m,f,i),b.description=s.decodeString(e.slice(m,y),i),m=y+g,b.text=s.decodeString(e.slice(m,f),i).replace(/\x00+$/,""),h=[b];break;case"UFID":h=p.readIdentifierAndData(e,m,f,u),h={owner_identifier:h.id,identifier:h.data};break;case"PRIV":h=p.readIdentifierAndData(e,m,f,u),h={owner_identifier:h.id,data:h.data};break;case"POPM":y=s.findZero(e,m,f,u);const T=s.decodeString(e.slice(m,y),u);m=y+1;const w=f-m;h={email:T,rating:n.UINT8.get(e,m),counter:w>=5?n.UINT32_BE.get(e,m+1):void 0};break;case"GEOB":{y=s.findZero(e,m+1,f,i);const t=s.decodeString(e.slice(m+1,y),u);m=y+1,y=s.findZero(e,m,f-m,i);const r=s.decodeString(e.slice(m,y),u);m=y+1,y=s.findZero(e,m,f-m,i),h={type:t,filename:r,description:s.decodeString(e.slice(m,y),u),data:e.slice(m+1,f)};break}case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":h=s.decodeString(e.slice(m,y),u);break;case"WXXX":{y=s.findZero(e,m+1,f,i);const t=s.decodeString(e.slice(m+1,y),i);m=y+("utf16le"===i?2:1),h={description:t,url:s.decodeString(e.slice(m,f),u)};break}case"WFD":case"WFED":h=s.decodeString(e.slice(m+1,s.findZero(e,m+1,f,i)),i);break;case"MCDI":h=e.slice(0,f);break;default:l("Warning: unsupported id3v2-tag-type: "+t)}return h}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),r.length>1?this.warningCollector.addWarning(`ID3v2.${this.major} ${e} uses non standard null-separator.`):r=t.split(/\//g)):r=t.split(/\x00/g),p.trimArray(r)}static trimArray(e){return e.map((e=>e.replace(/\x00+$/,"").trim()))}static readIdentifierAndData(e,t,r,a){const i=s.findZero(e,t,r,a),n=s.decodeString(e.slice(t,i),a);return t=i+p.getNullTerminatorLength(a),{id:n,data:e.slice(t,r)}}static getNullTerminatorLength(e){return"utf16le"===e?2:1}}t.FrameParser=p},7183:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ID3v22TagMapper=t.id3v22TagMap=void 0;const a=r(4132);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:"originalalbum",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",PCS:"podcast",TCP:"compilation",TDR:"date",TS2:"albumartistsort",TSA:"albumsort",TSC:"composersort",TSP:"artistsort",TST:"titlesort",WFD:"podcasturl",TBP:"bpm"};class i extends a.CaseInsensitiveTagMap{constructor(){super(["ID3v2.2"],t.id3v22TagMap)}}t.ID3v22TagMapper=i},4005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ID3v24TagMapper=void 0;const a=r(9918),i=r(4132),n=r(3769),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","TXXX:ISRC":"isrc",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",MVNM:"movement",MVIN:"movementIndex",PCST:"podcast",TCAT:"category",TDES:"description",TDRL:"date",TGID:"podcastId",TKWD:"keywords",WFED:"podcasturl"};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.decodeString(e.value.identifier,"latin1"));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},8928:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.ID3v2Parser=void 0;const i=r(3416),n=r(3769),s=r(907),o=r(8281);class c{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 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.getBit(e,0,6),file_alter_preservation:n.getBit(e,0,5),read_only:n.getBit(e,0,4)},format:{grouping_identity:n.getBit(e,1,7),compression:n.getBit(e,1,3),encryption:n.getBit(e,1,2),unsynchronisation:n.getBit(e,1,1),data_length_indicator:n.getBit(e,1,0)}}}static readFrameData(e,t,r,a,i){const n=new s.FrameParser(r,i);switch(r){case 2:return n.readData(e,t.id,a);case 3:case 4:return t.flags.format.unsynchronisation&&(e=c.removeUnsyncBytes(e)),t.flags.format.data_length_indicator&&(e=e.slice(4,e.length)),n.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(o.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(o.ExtendedHeader),t=e.size-o.ExtendedHeader.len;return t>0?this.parseExtendedHeaderData(t,e.size):this.parseId3Data(this.id3Header.size-e.size)}async parseExtendedHeaderData(e,t){return await this.tokenizer.ignore(e),this.parseId3Data(this.id3Header.size-t)}async parseId3Data(e){const t=await this.tokenizer.readToken(new i.Uint8ArrayType(e));for(const e of this.parseMetadata(t))if("TXXX"===e.id){if(e.value)for(const t of e.value.text)this.addTag(c.makeDescriptionTagName(e.id,e.value.description),t)}else if("COM"===e.id)for(const t of e.value)this.addTag(c.makeDescriptionTagName(e.id,t.description),t.text);else if("COMM"===e.id)for(const t of e.value)this.addTag(c.makeDescriptionTagName(e.id,t.description),t);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=c.getFrameHeaderLength(this.id3Header.version.major);if(t+a>e.length){this.metadata.addWarning("Illegal ID3v2 tag length");break}const i=e.slice(t,t+=a),n=this.readFrameHeader(i,this.id3Header.version.major),s=e.slice(t,t+=n.length),o=c.readFrameData(s,n,this.id3Header.version.major,!this.options.skipCovers,this.metadata);o&&r.push({id:n.id,value:o})}return r}readFrameHeader(e,t){let r;switch(t){case 2:r={id:a.from(e.slice(0,3)).toString("ascii"),length:i.UINT24_BE.get(e,3)},r.id.match(/[A-Z0-9]{3}/g)||this.metadata.addWarning(`Invalid ID3v2.${this.id3Header.version.major} frame-header-ID: ${r.id}`);break;case 3:case 4:r={id:a.from(e.slice(0,4)).toString("ascii"),length:(4===t?o.UINT32SYNCSAFE:i.UINT32_BE).get(e,4),flags:c.readFrameFlags(e.slice(8,10))},r.id.match(/[A-Z0-9]{4}/g)||this.metadata.addWarning(`Invalid ID3v2.${this.id3Header.version.major} frame-header-ID: ${r.id}`);break;default:throw new Error("Unexpected majorVer: "+t)}return r}}t.ID3v2Parser=c},8281:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextEncodingToken=t.ExtendedHeader=t.ID3v2Header=t.UINT32SYNCSAFE=t.AttachedPictureType=void 0;const a=r(3416),i=r(3769);var n;(n=t.AttachedPictureType||(t.AttachedPictureType={}))[n.Other=0]="Other",n[n["32x32 pixels 'file icon' (PNG only)"]=1]="32x32 pixels 'file icon' (PNG only)",n[n["Other file icon"]=2]="Other file icon",n[n["Cover (front)"]=3]="Cover (front)",n[n["Cover (back)"]=4]="Cover (back)",n[n["Leaflet page"]=5]="Leaflet page",n[n["Media (e.g. label side of CD)"]=6]="Media (e.g. label side of CD)",n[n["Lead artist/lead performer/soloist"]=7]="Lead artist/lead performer/soloist",n[n["Artist/performer"]=8]="Artist/performer",n[n.Conductor=9]="Conductor",n[n["Band/Orchestra"]=10]="Band/Orchestra",n[n.Composer=11]="Composer",n[n["Lyricist/text writer"]=12]="Lyricist/text writer",n[n["Recording Location"]=13]="Recording Location",n[n["During recording"]=14]="During recording",n[n["During performance"]=15]="During performance",n[n["Movie/video screen capture"]=16]="Movie/video screen capture",n[n["A bright coloured fish"]=17]="A bright coloured fish",n[n.Illustration=18]="Illustration",n[n["Band/artist logotype"]=19]="Band/artist logotype",n[n["Publisher/Studio logotype"]=20]="Publisher/Studio logotype",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:{unsynchronisation:i.getBit(e,r+5,7),isExtendedHeader:i.getBit(e,r+5,6),expIndicator:i.getBit(e,r+5,5),footer:i.getBit(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:i.getBit(e,t+4,31)})},t.TextEncodingToken={len:1,get:(e,t)=>{switch(e[t]){case 0:return{encoding:"latin1"};case 1:return{encoding:"utf16le",bom:!0};case 2:return{encoding:"utf16le",bom:!1};default:return{encoding:"utf8",bom:!1}}}}},4633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Header=void 0;const a=r(3416),i=r(8049);t.Header={len:8,get:(e,t)=>({chunkID:i.FourCcToken.get(e,t),chunkSize:Number(BigInt(a.UINT32_BE.get(e,t+4)))})}},9941:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.getLyricsHeaderLength=t.endTag2=void 0,t.endTag2="LYRICS200",t.getLyricsHeaderLength=async function(e){if(e.fileSize>=143){const r=a.alloc(15);await e.randomRead(r,0,r.length,e.fileSize-143);const i=r.toString("binary");if(i.substr(6)===t.endTag2)return parseInt(i.substr(0,6),10)+15}return 0}},3121:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elements=void 0;const a=r(8591);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}}}}}}}}}}},78:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.MatroskaParser=void 0;const i=r(3416),n=r(1227),s=r(7805),o=r(8591),c=r(3121),l=(0,n.default)("music-metadata:parser:matroska");class u extends s.BasicParser{constructor(){super(),this.padding=0,this.parserMap=new Map,this.ebmlMaxIDLength=4,this.ebmlMaxSizeLength=8,this.parserMap.set(o.DataType.uint,(e=>this.readUint(e))),this.parserMap.set(o.DataType.string,(e=>this.readString(e))),this.parserMap.set(o.DataType.binary,(e=>this.readBuffer(e))),this.parserMap.set(o.DataType.uid,(async e=>1===await this.readUint(e))),this.parserMap.set(o.DataType.bool,(e=>this.readFlag(e))),this.parserMap.set(o.DataType.float,(e=>this.readFloat(e)))}init(e,t,r){return super.init(e,t,r),this}async parse(){const e=await this.parseContainer(c.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===o.TrackType.audio.valueOf())).reduce(((e,t)=>e?!e.flagDefault&&t.flagDefault||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=(null==t?void 0:t.targetTypeValue)?o.TargetType[t.targetTypeValue]:(null==t?void 0:t.targetType)?t.targetType:"track";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;){let t;try{t=await this.readElement()}catch(e){if("End-Of-Stream"===e.message)break;throw e}const i=e[t.id];if(i)if(l(`Element: name=${i.name}, container=${!!i.container}`),i.container){const e=await this.parseContainer(i.container,t.len>=0?this.tokenizer.position+t.len:-1,r.concat([i.name]));i.multiple?(a[i.name]||(a[i.name]=[]),a[i.name].push(e)):a[i.name]=e}else a[i.name]=await this.parserMap.get(i.value)(t);else 236===t.id?(this.padding+=t.len,await this.tokenizer.ignore(t.len)):(l(`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(e){const t=await this.tokenizer.peekNumber(i.UINT8);let r=128,n=1;for(;0==(t&r);){if(n>e)throw new Error("VINT value exceeding maximum size");++n,r>>=1}const s=a.alloc(n);return await this.tokenizer.readBuffer(s),s}async readElement(){const e=await this.readVintData(this.ebmlMaxIDLength),t=await this.readVintData(this.ebmlMaxSizeLength);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)}}isMaxValue(e){if(e.length===this.ebmlMaxSizeLength){for(let t=1;t<this.ebmlMaxSizeLength;++t)if(255!==e[t])return!1;return!0}return!1}async readFloat(e){switch(e.len){case 0:return 0;case 4:return this.tokenizer.readNumber(i.Float32_BE);case 8:case 10:return this.tokenizer.readNumber(i.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(await this.tokenizer.readToken(new i.StringType(e.len,"utf-8"))).replace(/\00.*$/g,"")}async readBuffer(e){const t=a.alloc(e.len);return await this.tokenizer.readBuffer(t),t}addTag(e,t){this.metadata.addTag("matroska",e,t)}}t.MatroskaParser=u},5481:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MatroskaTagMapper=void 0;const a=r(4132),i={"segment:title":"title","album:ARTIST":"albumartist","album:ARTISTSORT":"albumartistsort","album:TITLE":"album","album:DATE_RECORDED":"originaldate","album:PART_NUMBER":"disk","album:TOTAL_PARTS":"totaltracks","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","track:GENRE":"genre","track:ENCODER":"encodedby","track:ENCODER_OPTIONS":"encodersettings","edition:TOTAL_PARTS":"totaldiscs",picture:"picture"};class n extends a.CaseInsensitiveTagMap{constructor(){super(["matroska"],i)}}t.MatroskaTagMapper=n},8591:(e,t)=>{"use strict";var r,a,i;Object.defineProperty(t,"__esModule",{value:!0}),t.TrackType=t.TargetType=t.DataType=void 0,(i=t.DataType||(t.DataType={}))[i.string=0]="string",i[i.uint=1]="uint",i[i.uid=2]="uid",i[i.bool=3]="bool",i[i.binary=4]="binary",i[i.float=5]="float",(a=t.TargetType||(t.TargetType={}))[a.shot=10]="shot",a[a.scene=20]="scene",a[a.track=30]="track",a[a.part=40]="part",a[a.album=50]="album",a[a.edition=60]="edition",a[a.collection=70]="collection",(r=t.TrackType||(t.TrackType={}))[r.video=1]="video",r[r.audio=2]="audio",r[r.complex=3]="complex",r[r.logo=4]="logo",r[r.subtitle=17]="subtitle",r[r.button=18]="button",r[r.control=32]="control"},9134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Atom=void 0;const a=r(1227),i=r(1060),n=(0,a.default)("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,a){const o=e.position,c=await e.readToken(i.Header);c.length===BigInt(1)&&(c.length=await e.readToken(i.ExtendedSize));const l=new s(c,c.length===BigInt(1),r),u=l.getPayloadLength(a);return n(`parse atom name=${l.atomPath}, extended=${l.extended}, offset=${o}, len=${l.header.length}`),await l.readData(e,t,u),l}getHeaderLength(){return this.extended?16:8}getPayloadLength(e){return(this.header.length===BigInt(0)?e:Number(this.header.length))-this.getHeaderLength()}async readAtoms(e,t,r){for(;r>0;){const a=await s.readAtom(e,t,this,r);this.children.push(a),r-=a.header.length===BigInt(0)?r:Number(a.header.length)}}async readData(e,t,r){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(r));case"meta":return await e.ignore(4),this.readAtoms(e,t,this.getPayloadLength(r)-4);default:return t(this,r)}}}t.Atom=s},1060:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.ChapterText=t.StcoAtom=t.StszAtom=t.StscAtom=t.SampleToChunkToken=t.SttsAtom=t.TimeToSampleToken=t.SoundSampleDescriptionV0=t.SoundSampleDescriptionVersion=t.StsdAtom=t.TrackHeaderAtom=t.NameAtom=t.DataAtom=t.MvhdAtom=t.MdhdAtom=t.FixedLengthAtom=t.mhdr=t.tkhd=t.ftyp=t.ExtendedSize=t.Header=void 0;const i=r(3416),n=r(1227),s=r(8049),o=(0,n.default)("music-metadata:parser:MP4:atom");t.Header={len:8,get:(e,t)=>{const r=i.UINT32_BE.get(e,t);if(r<0)throw new Error("Invalid atom header length");return{length:BigInt(r),name:new i.StringType(4,"binary").get(e,t+4)}},put:(e,t,r)=>(i.UINT32_BE.put(e,t,Number(r.length)),s.FourCcToken.put(e,t+4,r.name))},t.ExtendedSize=i.UINT64_BE,t.ftyp={len:4,get:(e,t)=>({type:new i.StringType(4,"ascii").get(e,t)})},t.tkhd={len:4,get:(e,t)=>({type:new i.StringType(4,"ascii").get(e,t)})},t.mhdr={len:8,get:(e,t)=>({version:i.UINT8.get(e,t),flags:i.UINT24_BE.get(e,t+1),nextItemID:i.UINT32_BE.get(e,t+4)})};class c{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&&o(`Warning: atom ${r} expected to be ${t}, but was actually ${e} bytes long.`)}}t.FixedLengthAtom=c;const l=(e,t)=>{const r=i.UINT32_BE.get(e,t)-2082844800;return new Date(1e3*r)};t.MdhdAtom=class extends c{constructor(e){super(e,24,"mdhd"),this.len=e}get(e,t){return{version:i.UINT8.get(e,t+0),flags:i.UINT24_BE.get(e,t+1),creationTime:l(e,t+4),modificationTime:l(e,t+8),timeScale:i.UINT32_BE.get(e,t+12),duration:i.UINT32_BE.get(e,t+16),language:i.UINT16_BE.get(e,t+20),quality:i.UINT16_BE.get(e,t+22)}}},t.MvhdAtom=class extends c{constructor(e){super(e,100,"mvhd"),this.len=e}get(e,t){return{version:i.UINT8.get(e,t),flags:i.UINT24_BE.get(e,t+1),creationTime:l(e,t+4),modificationTime:l(e,t+8),timeScale:i.UINT32_BE.get(e,t+12),duration:i.UINT32_BE.get(e,t+16),preferredRate:i.UINT32_BE.get(e,t+20),preferredVolume:i.UINT16_BE.get(e,t+24),previewTime:i.UINT32_BE.get(e,t+72),previewDuration:i.UINT32_BE.get(e,t+76),posterTime:i.UINT32_BE.get(e,t+80),selectionTime:i.UINT32_BE.get(e,t+84),selectionDuration:i.UINT32_BE.get(e,t+88),currentTime:i.UINT32_BE.get(e,t+92),nextTrackID:i.UINT32_BE.get(e,t+96)}}},t.DataAtom=class{constructor(e){this.len=e}get(e,t){return{type:{set:i.UINT8.get(e,t+0),type:i.UINT24_BE.get(e,t+1)},locale:i.UINT24_BE.get(e,t+4),value:a.from(new i.Uint8ArrayType(this.len-8).get(e,t+8))}}},t.NameAtom=class{constructor(e){this.len=e}get(e,t){return{version:i.UINT8.get(e,t),flags:i.UINT24_BE.get(e,t+1),name:new i.StringType(this.len-4,"utf-8").get(e,t+4)}}},t.TrackHeaderAtom=class{constructor(e){this.len=e}get(e,t){return{version:i.UINT8.get(e,t),flags:i.UINT24_BE.get(e,t+1),creationTime:l(e,t+4),modificationTime:l(e,t+8),trackId:i.UINT32_BE.get(e,t+12),duration:i.UINT32_BE.get(e,t+20),layer:i.UINT16_BE.get(e,t+24),alternateGroup:i.UINT16_BE.get(e,t+26),volume:i.UINT16_BE.get(e,t+28)}}};class u{constructor(e){this.len=e}get(e,t){return{dataFormat:s.FourCcToken.get(e,t),dataReferenceIndex:i.UINT16_BE.get(e,t+10),description:new i.Uint8ArrayType(this.len-12).get(e,t+12)}}}t.StsdAtom=class{constructor(e){this.len=e}get(e,t){const r=((e,t)=>({version:i.UINT8.get(e,t),flags:i.UINT24_BE.get(e,t+1),numberOfEntries:i.UINT32_BE.get(e,t+4)}))(e,t);t+=8;const a=[];for(let n=0;n<r.numberOfEntries;++n){const r=i.UINT32_BE.get(e,t);t+=i.UINT32_BE.len,a.push(new u(r).get(e,t)),t+=r}return{header:r,table:a}}},t.SoundSampleDescriptionVersion={len:8,get:(e,t)=>({version:i.INT16_BE.get(e,t),revision:i.INT16_BE.get(e,t+2),vendor:i.INT32_BE.get(e,t+4)})},t.SoundSampleDescriptionV0={len:12,get:(e,t)=>({numAudioChannels:i.INT16_BE.get(e,t+0),sampleSize:i.INT16_BE.get(e,t+2),compressionId:i.INT16_BE.get(e,t+4),packetSize:i.INT16_BE.get(e,t+6),sampleRate:i.UINT16_BE.get(e,t+8)+i.UINT16_BE.get(e,t+10)/1e4})};class d{constructor(e,t){this.len=e,this.token=t}get(e,t){const r=i.INT32_BE.get(e,t+4);return{version:i.INT8.get(e,t+0),flags:i.INT24_BE.get(e,t+1),numberOfEntries:r,entries:f(e,this.token,t+8,this.len-8,r)}}}function f(e,t,r,a,i){if(o(`remainingLen=${a}, numberOfEntries=${i} * token-len=${t.len}`),0===a)return[];if(a!==i*t.len)throw new Error("mismatch number-of-entries with remaining atom-length");const n=[];for(let a=0;a<i;++a)n.push(t.get(e,r)),r+=t.len;return n}t.TimeToSampleToken={len:8,get:(e,t)=>({count:i.INT32_BE.get(e,t+0),duration:i.INT32_BE.get(e,t+4)})},t.SttsAtom=class extends d{constructor(e){super(e,t.TimeToSampleToken),this.len=e}},t.SampleToChunkToken={len:12,get:(e,t)=>({firstChunk:i.INT32_BE.get(e,t),samplesPerChunk:i.INT32_BE.get(e,t+4),sampleDescriptionId:i.INT32_BE.get(e,t+8)})},t.StscAtom=class extends d{constructor(e){super(e,t.SampleToChunkToken),this.len=e}},t.StszAtom=class{constructor(e){this.len=e}get(e,t){const r=i.INT32_BE.get(e,t+8);return{version:i.INT8.get(e,t),flags:i.INT24_BE.get(e,t+1),sampleSize:i.INT32_BE.get(e,t+4),numberOfEntries:r,entries:f(e,i.INT32_BE,t+12,this.len-12,r)}}},t.StcoAtom=class extends d{constructor(e){super(e,i.INT32_BE),this.len=e}},t.ChapterText=class{constructor(e){this.len=e}get(e,t){const r=i.INT16_BE.get(e,t+0);return new i.StringType(r,"utf-8").get(e,t+2)}}},8841:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.MP4Parser=void 0;const i=r(1227),n=r(3416),s=r(7805),o=r(2282),c=r(6032),l=r(9134),u=r(1060),d=(0,i.default)("music-metadata:parser:MP4"),f={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 p(e,t,r){return r.indexOf(e)===t}class m extends s.BasicParser{constructor(){super(...arguments),this.atomParsers={mvhd:async e=>{const t=await this.tokenizer.readToken(new u.MvhdAtom(e));this.metadata.setFormat("creationTime",t.creationTime),this.metadata.setFormat("modificationTime",t.modificationTime)},mdhd:async e=>{const t=await this.tokenizer.readToken(new u.MdhdAtom(e)),r=this.getTrackDescription();r.creationTime=t.creationTime,r.modificationTime=t.modificationTime,r.timeScale=t.timeScale,r.duration=t.duration},chap:async e=>{const t=this.getTrackDescription(),r=[];for(;e>=n.UINT32_BE.len;)r.push(await this.tokenizer.readNumber(n.UINT32_BE)),e-=n.UINT32_BE.len;t.chapterList=r},tkhd:async e=>{const t=await this.tokenizer.readToken(new u.TrackHeaderAtom(e));this.tracks.push(t)},mdat:async e=>{if(this.audioLengthInBytes=e,this.calculateBitRate(),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)},ftyp:async e=>{const t=[];for(;e>0;){const r=await this.tokenizer.readToken(u.ftyp);e-=u.ftyp.len;const a=r.type.replace(/\W/g,"");a.length>0&&t.push(a)}d(`ftyp: ${t.join("/")}`);const r=t.filter(p).join("/");this.metadata.setFormat("container",r)},stsd:async e=>{const t=await this.tokenizer.readToken(new u.StsdAtom(e));this.getTrackDescription().soundSampleDescription=t.table.map((e=>this.parseSoundSampleDescription(e)))},stsc:async e=>{const t=await this.tokenizer.readToken(new u.StscAtom(e));this.getTrackDescription().sampleToChunkTable=t.entries},stts:async e=>{const t=await this.tokenizer.readToken(new u.SttsAtom(e));this.getTrackDescription().timeToSampleTable=t.entries},stsz:async e=>{const t=await this.tokenizer.readToken(new u.StszAtom(e)),r=this.getTrackDescription();r.sampleSize=t.sampleSize,r.sampleSizeTable=t.entries},stco:async e=>{const t=await this.tokenizer.readToken(new u.StcoAtom(e));this.getTrackDescription().chunkOffsetTable=t.entries},date:async e=>{const t=await this.tokenizer.readToken(new n.StringType(e,"utf-8"));this.addTag("date",t)}}}static read_BE_Integer(e,t){const r=(t?"INT":"UINT")+8*e.length+(e.length>1?"_BE":""),a=n[r];if(!a)throw new Error('Token for integer type not found: "'+r+'"');return Number(a.get(e,0))}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(u.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}const t=await l.Atom.readAtom(this.tokenizer,((e,t)=>this.handleAtom(e,t)),null,e);e-=t.header.length===BigInt(0)?e:Number(t.header.length)}const t=[];this.tracks.forEach((e=>{const r=[];e.soundSampleDescription.forEach((e=>{const t={},a=f[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=c.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(p).join("+"));const r=this.tracks.filter((e=>e.soundSampleDescription.length>=1&&e.soundSampleDescription[0].description&&e.soundSampleDescription[0].description.numAudioChannels>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 i=f[a.dataFormat];i&&this.metadata.setFormat("lossless",!i.lossy),this.calculateBitRate()}}async handleAtom(e,t){if(e.parent)switch(e.parent.header.name){case"ilst":case"<id>":return this.parseMetadataItemData(e)}if(this.atomParsers[e.header.name])return this.atomParsers[e.header.name](t);d(`No parser for atom path=${e.atomPath}, payload-len=${t}, ignoring atom`),await this.tokenizer.ignore(t)}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("iTunes",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,r)=>{const a=e.getPayloadLength(r);switch(e.header.name){case"data":return this.parseValueAtom(t,e);case"name":const r=await this.tokenizer.readToken(new u.NameAtom(a));t+=":"+r.name;break;case"mean":const i=await this.tokenizer.readToken(new u.NameAtom(a));t+=":"+i.name;break;default:const s=await this.tokenizer.readToken(new n.BufferType(a));this.addWarning("Unsupported meta-item: "+t+"["+e.header.name+"] => value="+s.toString("hex")+" ascii="+s.toString("ascii"))}}),e.getPayloadLength(0))}async parseValueAtom(e,t){const r=await this.tokenizer.readToken(new u.DataAtom(Number(t.header.length)-u.Header.len));if(0!==r.type.set)throw new Error("Unsupported type-set != 0: "+r.type.set);switch(r.type.type){case 0:switch(e){case"trkn":case"disk":const t=n.UINT8.get(r.value,3),a=n.UINT8.get(r.value,5);this.addTag(e,t+"/"+a);break;case"gnre":const i=n.UINT8.get(r.value,1),s=o.Genres[i-1];this.addTag(e,s)}break;case 1:case 18:this.addTag(e,r.value.toString("utf-8"));break;case 13:if(this.options.skipCovers)break;this.addTag(e,{format:"image/jpeg",data:a.from(r.value)});break;case 14:if(this.options.skipCovers)break;this.addTag(e,{format:"image/png",data:a.from(r.value)});break;case 21:this.addTag(e,m.read_BE_Integer(r.value,!0));break;case 22:this.addTag(e,m.read_BE_Integer(r.value,!1));break;case 65:this.addTag(e,r.value.readInt8(0));break;case 66:this.addTag(e,r.value.readInt16BE(0));break;case 67:this.addTag(e,r.value.readInt32BE(0));break;default:this.addWarning(`atom key=${e}, has unknown well-known-type (data-type): ${r.type.type}`)}}parseSoundSampleDescription(e){const t={dataFormat:e.dataFormat,dataReferenceIndex:e.dataReferenceIndex};let r=0;const a=u.SoundSampleDescriptionVersion.get(e.description,r);return r+=u.SoundSampleDescriptionVersion.len,0===a.version||1===a.version?t.description=u.SoundSampleDescriptionV0.get(e.description,r):d(`Warning: sound-sample-description ${a} not implemented`),t}async parseChapterTrack(e,t,r){if(!e.sampleSize&&e.chunkOffsetTable.length!==e.sampleSizeTable.length)throw new Error("Expected equal chunk-offset-table & sample-size-table length.");const a=[];for(let i=0;i<e.chunkOffsetTable.length&&r>0;++i){const n=e.chunkOffsetTable[i]-this.tokenizer.position,s=e.sampleSize>0?e.sampleSize:e.sampleSizeTable[i];if((r-=n+s)<0)throw new Error("Chapter chunk exceeding token length");await this.tokenizer.ignore(n);const o=await this.tokenizer.readToken(new u.ChapterText(s));d(`Chapter ${i+1}: ${o}`);const c={title:o,sampleOffset:this.findSampleOffset(t,this.tokenizer.position)};d(`Chapter title=${c.title}, offset=${c.sampleOffset}/${this.tracks[0].duration}`),a.push(c)}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,i=t.timeToSampleTable[r].duration,n=1,s=this.getSamplesPerChunk(n,t.sampleToChunkTable),o=0;for(;n<e;){const e=Math.min(a,s);o+=e*i,a-=e,s-=e,0===s?(++n,s=this.getSamplesPerChunk(n,t.sampleToChunkTable)):(++r,a=t.timeToSampleTable[r].count,i=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=m},7852:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MP4TagMapper=t.tagType=void 0;const a=r(4132),i={"©nam":"title","©ART":"artist",aART:"albumartist","----:com.apple.iTunes:Band":"albumartist","©alb":"album","©day":"date","©cmt":"comment","©com":"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","©cpy":"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:"longDescription","©mvn":"movement","©mvi":"movementIndex","©mvc":"movementTotal","©wrk":"work",catg:"category",egid:"podcastId",hdvd:"hdVideo",keyw:"keywords",shwm:"showMovement",stik:"stik"};t.tagType="iTunes";class n extends a.CaseInsensitiveTagMap{constructor(){super([t.tagType],i)}}t.MP4TagMapper=n},5261:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedLameHeader=void 0;const a=r(3416),i=r(3769),n=r(6118);t.ExtendedLameHeader={len:27,get:(e,t)=>{const r=a.UINT32_BE.get(e,t+2);return{revision:i.getBitAllignedNumber(e,t,0,4),vbr_method:i.getBitAllignedNumber(e,t,4,4),lowpass_filter:100*a.UINT8.get(e,t+1),track_peak:0===r?void 0:r/Math.pow(2,23),track_gain:n.ReplayGain.get(e,6),album_gain:n.ReplayGain.get(e,8),music_length:a.UINT32_BE.get(e,t+20),music_crc:a.UINT8.get(e,t+24),header_crc:a.UINT16_BE.get(e,t+24)}}}},60:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.MpegParser=void 0;const i=r(3416),n=r(5849),s=r(1227),o=r(3769),c=r(5159),l=r(3566),u=(0,s.default)("music-metadata:parser:mpeg"),d={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]},f=[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 p{constructor(e,t){this.versionIndex=o.getBitAllignedNumber(e,t+1,3,2),this.layer=p.LayerDescription[o.getBitAllignedNumber(e,t+1,5,2)],this.versionIndex>1&&0===this.layer?this.parseAdtsHeader(e,t):this.parseMpegHeader(e,t),this.isProtectedByCRC=!o.isBitSet(e,t+1,7)}calcDuration(e){return e*this.calcSamplesPerFrame()/this.samplingRate}calcSamplesPerFrame(){return p.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.getBitAllignedNumber(e,t+2,0,4),this.sampRateFreqIndex=o.getBitAllignedNumber(e,t+2,4,2),this.padding=o.isBitSet(e,t+2,6),this.privateBit=o.isBitSet(e,t+2,7),this.channelModeIndex=o.getBitAllignedNumber(e,t+3,0,2),this.modeExtension=o.getBitAllignedNumber(e,t+3,2,2),this.isCopyrighted=o.isBitSet(e,t+3,4),this.isOriginalMedia=o.isBitSet(e,t+3,5),this.emphasis=o.getBitAllignedNumber(e,t+3,7,2),this.version=p.VersionID[this.versionIndex],this.channelMode=p.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){u("layer=0 => ADTS"),this.version=2===this.versionIndex?4:2,this.container="ADTS/MPEG-"+this.version;const r=o.getBitAllignedNumber(e,t+2,0,2);this.codec="AAC",this.codecProfile=d.AudioObjectTypes[r],u(`MPEG-4 audio-codec=${this.codec}`);const a=o.getBitAllignedNumber(e,t+2,2,4);this.samplingRate=d.SamplingFrequencies[a],u(`sampling-rate=${this.samplingRate}`);const i=o.getBitAllignedNumber(e,t+2,7,3);this.mp4ChannelConfig=f[i],u(`channel-config=${this.mp4ChannelConfig.join("+")}`),this.frameLength=o.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 p.bitrate_index[this.bitrateIndex][e]}calcSamplingRate(){return 3===this.sampRateFreqIndex?null:p.sampling_rate_freq_index[this.version][this.sampRateFreqIndex]}}p.SyncByte1=255,p.SyncByte2=224,p.VersionID=[2.5,null,2,1],p.LayerDescription=[0,3,2,1],p.ChannelMode=["stereo","joint_stereo","dual_channel","mono"],p.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}},p.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}},p.samplesInFrameTable=[[0,384,1152,1152],[0,384,1152,576]];class m 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=a.alloc(4),this.syncPeek={buf:a.alloc(1024),len:0}}async postId3v2Parse(){this.metadata.setFormat("lossless",!1);try{let e=!1;for(;!e;)await this.sync(),e=await this.parseCommonMpegHeader()}catch(e){if(!(e instanceof n.EndOfStreamError))throw e;if(u("End-of-stream"),this.calculateEofDuration){const e=this.frameCount*this.samplesPerFrame;this.metadata.setFormat("numberOfSamples",e);const t=e/this.metadata.format.sampleRate;u(`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 i=a/e.sampleRate;u("Calculate CBR duration based on file size: %s",i),this.metadata.setFormat("duration",i)}}async sync(){let e=!1;for(;;){let t=0;if(this.syncPeek.len=await this.tokenizer.peekBuffer(this.syncPeek.buf,{length:1024,mayBeLess:!0}),this.syncPeek.len<=163)throw new n.EndOfStreamError;for(;;){if(e&&224==(224&this.syncPeek.buf[t]))return this.buf_frame_header[0]=p.SyncByte1,this.buf_frame_header[1]=this.syncPeek.buf[t],await this.tokenizer.ignore(t),u(`Sync at offset=${this.tokenizer.position-1}, frameCount=${this.frameCount}`),this.syncFrameCount===this.frameCount&&(u(`Re-synced MPEG stream, frameCount=${this.frameCount}`),this.frameCount=0,this.frame_size=0),void(this.syncFrameCount=this.frameCount);if(e=!1,t=this.syncPeek.buf.indexOf(p.SyncByte1,t),-1===t){if(this.syncPeek.len<this.syncPeek.buf.length)throw new n.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{t=this.buf_frame_header,e=new p(t,0)}catch(e){return await this.tokenizer.ignore(1),this.metadata.addWarning("Parse error: "+e.message),!1}var t;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&&u("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();u(`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=4,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(e){const t=a.alloc(3);await this.tokenizer.readBuffer(t),e.frameLength+=o.getBitAllignedNumber(t,0,0,11),this.totalDataLength+=e.frameLength,this.samplesPerFrame=1024;const r=e.samplingRate/this.samplesPerFrame,i=8*(0===this.frameCount?0:this.totalDataLength/this.frameCount)*r+.5;if(this.metadata.setFormat("bitrate",i),u(`frame-count=${this.frameCount}, size=${e.frameLength} bytes, bit-rate=${i}`),await this.tokenizer.ignore(e.frameLength>7?e.frameLength-7:1),3===this.frameCount){if(this.metadata.setFormat("codecProfile",e.codecProfile),e.mp4ChannelConfig&&this.metadata.setFormat("numberOfChannels",e.mp4ChannelConfig.length),!this.options.duration)return!0;this.calculateEofDuration=!0}return!1}async parseCrc(){return this.crc=await this.tokenizer.readNumber(i.INT16_BE),this.offset+=2,this.skipSideInformation()}async skipSideInformation(){const e=this.audioFrameHeader.calculateSideInfoLength();await this.tokenizer.readToken(new i.Uint8ArrayType(e)),this.offset+=e,await this.readXtraInfoHeader()}async readXtraInfoHeader(){const e=await this.tokenizer.readToken(l.InfoTagHeaderTag);switch(this.offset+=l.InfoTagHeaderTag.len,e){case"Info":return this.metadata.setFormat("codecProfile","CBR"),this.readXingInfoHeader();case"Xing":const e=(t=(await this.readXingInfoHeader()).vbrScale,"V"+Math.floor((100-t)/10));return this.metadata.setFormat("codecProfile",e),null;case"Xtra":break;case"LAME":const r=await this.tokenizer.readToken(l.LameEncoderVersion);if(this.frame_size>=this.offset+l.LameEncoderVersion.len)return this.offset+=l.LameEncoderVersion.len,this.metadata.setFormat("tool","LAME "+r),await this.skipFrameData(this.frame_size-this.offset),null;this.metadata.addWarning("Corrupt LAME header")}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=this.tokenizer.position,t=await(0,l.readXingHeader)(this.tokenizer);if(this.offset+=this.tokenizer.position-e,t.lame&&(this.metadata.setFormat("tool","LAME "+o.stripNulls(t.lame.version)),t.lame.extended&&(this.metadata.setFormat("trackPeakLevel",t.lame.extended.track_peak),t.lame.extended.track_gain&&this.metadata.setFormat("trackGain",t.lame.extended.track_gain.adjustment),t.lame.extended.album_gain&&this.metadata.setFormat("albumGain",t.lame.extended.album_gain.adjustment),this.metadata.setFormat("duration",t.lame.extended.music_length/1e3))),t.streamSize){const e=this.audioFrameHeader.calcDuration(t.numFrames);return this.metadata.setFormat("duration",e),u("Get duration from Xing header: %s",this.metadata.format.duration),t}const r=this.frame_size-this.offset;return await this.skipFrameData(r),t}async skipFrameData(e){if(e<0)throw new Error("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))}}t.MpegParser=m},6118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReplayGain=void 0;const a=r(3769);var i,n;!function(e){e[e.not_set=0]="not_set",e[e.radio=1]="radio",e[e.audiophile=2]="audiophile"}(i||(i={})),function(e){e[e.unspecified=0]="unspecified",e[e.engineer=1]="engineer",e[e.user=2]="user",e[e.automatic=3]="automatic",e[e.rms_average=4]="rms_average"}(n||(n={})),t.ReplayGain={len:2,get:(e,t)=>{const r=a.getBitAllignedNumber(e,t,0,3),i=a.getBitAllignedNumber(e,t,6,1),n=a.getBitAllignedNumber(e,t,7,9)/10;if(r>0)return{type:a.getBitAllignedNumber(e,t,0,3),origin:a.getBitAllignedNumber(e,t,3,3),adjustment:i?-n:n}}}},3566:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.readXingHeader=t.XingHeaderFlags=t.LameEncoderVersion=t.InfoTagHeaderTag=void 0;const i=r(3416),n=r(3769),s=r(5261);t.InfoTagHeaderTag=new i.StringType(4,"ascii"),t.LameEncoderVersion=new i.StringType(6,"ascii"),t.XingHeaderFlags={len:4,get:(e,t)=>({frames:n.isBitSet(e,t,31),bytes:n.isBitSet(e,t,30),toc:n.isBitSet(e,t,29),vbrScale:n.isBitSet(e,t,28)})},t.readXingHeader=async function(e){const r=await e.readToken(t.XingHeaderFlags),n={};if(r.frames&&(n.numFrames=await e.readToken(i.UINT32_BE)),r.bytes&&(n.streamSize=await e.readToken(i.UINT32_BE)),r.toc&&(n.toc=a.alloc(100),await e.readBuffer(n.toc)),r.vbrScale&&(n.vbrScale=await e.readToken(i.UINT32_BE)),"LAME"===await e.peekToken(new i.StringType(4,"ascii"))&&(await e.ignore(4),n.lame={version:await e.readToken(new i.StringType(5,"ascii"))},n.lame.version.match(/\d+.\d+/g))){const t=n.lame.version.match(/\d+.\d+/g)[0].split(".").map((e=>parseInt(e,10)));t[0]>=3&&t[1]>=90&&(n.lame.extended=await e.readToken(s.ExtendedLameHeader))}return n}},9606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=r(1227),i=r(3416),n=r(5159),s=r(5170),o=r(3928),c=(0,a.default)("music-metadata:parser:musepack");class l extends n.AbstractID3Parser{async postId3v2Parse(){let e;switch(await this.tokenizer.peekToken(new i.StringType(3,"binary"))){case"MP+":c("Musepack stream-version 7"),e=new o.MpcSv7Parser;break;case"MPC":c("Musepack stream-version 8"),e=new s.MpcSv8Parser;break;default:throw new Error("Invalid Musepack signature prefix")}return e.init(this.metadata,this.tokenizer,this.options),e.parse()}}t.default=l},2812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BitReader=void 0;const a=r(3416);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,t&(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)}}},3928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MpcSv7Parser=void 0;const a=r(1227),i=r(7805),n=r(6742),s=r(2812),o=r(8153),c=(0,a.default)("music-metadata:parser:musepack");class l extends i.BasicParser{constructor(){super(...arguments),this.audioLength=0}async parse(){const e=await this.tokenizer.readToken(o.Header);if("MP+"!==e.signature)throw new Error("Unexpected magic number");c(`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 s.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),c(`End of audio stream, switching to APEv2, offset=${this.tokenizer.position}`),n.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)}}t.MpcSv7Parser=l},8153:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Header=void 0;const i=r(3416),n=r(3769);t.Header={len:24,get:(e,t)=>{const r={signature:a.from(e).toString("latin1",t,t+3),streamMinorVersion:n.getBitAllignedNumber(e,t+3,0,4),streamMajorVersion:n.getBitAllignedNumber(e,t+3,4,4),frameCount:i.UINT32_LE.get(e,t+4),maxLevel:i.UINT16_LE.get(e,t+8),sampleFrequency:[44100,48e3,37800,32e3][n.getBitAllignedNumber(e,t+10,0,2)],link:n.getBitAllignedNumber(e,t+10,2,2),profile:n.getBitAllignedNumber(e,t+10,4,4),maxBand:n.getBitAllignedNumber(e,t+11,0,6),intensityStereo:n.isBitSet(e,t+11,6),midSideStereo:n.isBitSet(e,t+11,7),titlePeak:i.UINT16_LE.get(e,t+12),titleGain:i.UINT16_LE.get(e,t+14),albumPeak:i.UINT16_LE.get(e,t+16),albumGain:i.UINT16_LE.get(e,t+18),lastFrameLength:i.UINT32_LE.get(e,t+20)>>>20&2047,trueGapless:n.isBitSet(e,t+23,0)};return r.lastFrameLength=r.trueGapless?i.UINT32_LE.get(e,20)>>>20&2047:0,r}}},5170:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MpcSv8Parser=void 0;const a=r(1227),i=r(7805),n=r(6742),s=r(8049),o=r(8850),c=(0,a.default)("music-metadata:parser:musepack");class l extends i.BasicParser{constructor(){super(...arguments),this.audioLength=0}async parse(){if("MPCK"!==await this.tokenizer.readToken(s.FourCcToken))throw new Error("Invalid Magic number");return this.metadata.setFormat("container","Musepack, SV8"),this.parsePacket()}async parsePacket(){const e=new o.StreamReader(this.tokenizer);for(;;){const t=await e.readPacketHeader();switch(c(`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),n.APEv2Parser.tryParseApeHeader(this.metadata,this.tokenizer,this.options);default:throw new Error(`Unexpected header: ${t.key}`)}}}}t.MpcSv8Parser=l},8850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=void 0;const a=r(3416),i=r(1227),n=r(3769),s=(0,i.default)("music-metadata:parser:musepack:sv8"),o=new a.StringType(2,"binary"),c={len:5,get:(e,t)=>({crc:a.UINT32_LE.get(e,t),streamVersion:a.UINT8.get(e,t+4)})},l={len:2,get:(e,t)=>({sampleFrequency:[44100,48e3,37800,32e3][n.getBitAllignedNumber(e,t,0,3)],maxUsedBands:n.getBitAllignedNumber(e,t,3,5),channelCount:n.getBitAllignedNumber(e,t+1,0,4)+1,msUsed:n.isBitSet(e,t+1,4),audioBlockFrames:n.getBitAllignedNumber(e,t+1,5,3)})};t.StreamReader=class{constructor(e){this.tokenizer=e}async readPacketHeader(){const e=await this.tokenizer.readToken(o),t=await this.readVariableSizeField();return{key:e,payloadLength:t.value-2-t.len}}async readStreamHeader(e){const t={};s(`Reading SH at offset=${this.tokenizer.position}`);const r=await this.tokenizer.readToken(c);e-=c.len,Object.assign(t,r),s(`SH.streamVersion = ${r.streamVersion}`);const a=await this.readVariableSizeField();e-=a.len,t.sampleCount=a.value;const i=await this.readVariableSizeField();e-=i.len,t.beginningOfSilence=i.value;const n=await this.tokenizer.readToken(l);return e-=l.len,Object.assign(t,n),await this.tokenizer.ignore(e),t}async readVariableSizeField(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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))}}},1915:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.OggParser=t.SegmentTable=void 0;const i=r(3416),n=r(5849),s=r(1227),o=r(3769),c=r(8049),l=r(7805),u=r(4210),d=r(1272),f=r(573),p=r(2630),m=(0,s.default)("music-metadata:parser:ogg");class h{constructor(e){this.len=e.page_segments}static sum(e,t,r){let a=0;for(let i=t;i<t+r;++i)a+=e[i];return a}get(e,t){return{totalPageSize:h.sum(e,t,this.len)}}}t.SegmentTable=h;class g extends l.BasicParser{async parse(){m("pos=%s, parsePage()",this.tokenizer.position);try{let e;do{if(e=await this.tokenizer.readToken(g.Header),"OggS"!==e.capturePattern)throw new Error("Invalid 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 i.Uint8ArrayType(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 i.StringType(7,"ascii").get(a.from(r),0);switch(e){case"vorbis":m("Set page consumer to Ogg/Vorbis"),this.pageConsumer=new u.VorbisParser(this.metadata,this.options);break;case"OpusHea":m("Set page consumer to Ogg/Opus"),this.pageConsumer=new d.OpusParser(this.metadata,this.options,this.tokenizer);break;case"Speex ":m("Set page consumer to Ogg/Speex"),this.pageConsumer=new f.SpeexParser(this.metadata,this.options,this.tokenizer);break;case"fishead":case"\0theora":m("Set page consumer to Ogg/Theora"),this.pageConsumer=new p.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 n.EndOfStreamError)this.metadata.addWarning("Last OGG-page is not marked with last-page flag"),m("End-of-stream"),this.metadata.addWarning("Last OGG-page is not marked with last-page flag"),this.header&&this.pageConsumer.calculateDuration(this.header);else{if(!e.message.startsWith("FourCC"))throw e;this.pageNumber>0&&(this.metadata.addWarning("Invalid FourCC ID, maybe last OGG-page is not marked with last-page flag"),this.pageConsumer.flush())}}}}t.OggParser=g,g.Header={len:27,get:(e,t)=>({capturePattern:c.FourCcToken.get(e,t),version:i.UINT8.get(e,t+4),headerType:{continued:o.getBit(e,t+5,0),firstPage:o.getBit(e,t+5,1),lastPage:o.getBit(e,t+5,2)},absoluteGranulePosition:Number(i.UINT64_LE.get(e,t+6)),streamSerialNumber:i.UINT32_LE.get(e,t+14),pageSequenceNo:i.UINT32_LE.get(e,t+18),pageChecksum:i.UINT32_LE.get(e,t+22),page_segments:i.UINT8.get(e,t+26)})}},5044:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdHeader=void 0;const a=r(3416);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)}}}},1272:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OpusParser=void 0;const a=r(3416),i=r(4210),n=r(5044);class s 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){"OpusTags"===new a.StringType(8,"ascii").get(e,0)&&(this.parseUserCommentList(e,8),this.lastPos=this.tokenizer.position-e.length)}calculateDuration(e){if(this.metadata.format.sampleRate&&e.absoluteGranulePosition>=0){const t=e.absoluteGranulePosition-this.idHeader.preSkip;if(this.metadata.setFormat("numberOfSamples",t),this.metadata.setFormat("duration",t/48e3),-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)}}}}t.OpusParser=s},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Header=void 0;const a=r(3416),i=r(3769);t.Header={len:80,get:(e,t)=>({speex:new a.StringType(8,"ascii").get(e,t+0),version:i.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)})}},573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpeexParser=void 0;const a=r(1227),i=r(4210),n=r(6666),s=(0,a.default)("music-metadata:parser:ogg:speex");class o 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)}}t.SpeexParser=o},5177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentificationHeader=void 0;const a=r(3416);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)})}},2630:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TheoraParser=void 0;const a=r(1227),i=r(5177),n=(0,a.default)("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(){n("flush")}calculateDuration(e){n("duration calculation not implemented")}parseFirstPage(e,t){n("First Ogg/Theora page"),this.metadata.setFormat("codec","Theora");const r=i.IdentificationHeader.get(t,0);this.metadata.setFormat("bitrate",r.nombr)}}},2127:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.IdentificationHeader=t.CommonHeader=t.VorbisPictureToken=void 0;const i=r(3416),n=r(8281);class s{constructor(e){this.len=e}static fromBase64(e){return this.fromBuffer(a.from(e,"base64"))}static fromBuffer(e){return new s(e.length).get(e,0)}get(e,t){const r=n.AttachedPictureType[i.UINT32_BE.get(e,t)],s=i.UINT32_BE.get(e,t+=4),o=e.toString("utf-8",t+=4,t+s),c=i.UINT32_BE.get(e,t+=s),l=e.toString("utf-8",t+=4,t+c),u=i.UINT32_BE.get(e,t+=c),d=i.UINT32_BE.get(e,t+=4),f=i.UINT32_BE.get(e,t+=4),p=i.UINT32_BE.get(e,t+=4),m=i.UINT32_BE.get(e,t+=4);return{type:r,format:o,description:l,width:u,height:d,colour_depth:f,indexed_color:p,data:a.from(e.slice(t+=4,t+m))}}}t.VorbisPictureToken=s,t.CommonHeader={len:7,get:(e,t)=>({packetType:e.readUInt8(t),vorbis:new i.StringType(6,"ascii").get(e,t+1)})},t.IdentificationHeader={len:23,get:(e,t)=>{const r=new DataView(e.buffer,e.byteOffset);return{version:r.getUint32(t+0,!0),channelMode:r.getUint8(t+4),sampleRate:r.getUint32(t+5,!0),bitrateMax:r.getUint32(t+9,!0),bitrateNominal:r.getUint32(t+13,!0),bitrateMin:r.getUint32(t+17,!0)}}}},441:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.VorbisDecoder=void 0;const i=r(3416);t.VorbisDecoder=class{constructor(e,t){this.data=e,this.offset=t}readInt32(){const e=i.UINT32_LE.get(this.data,this.offset);return this.offset+=4,e}readStringUtf8(){const e=this.readInt32(),t=a.from(this.data).toString("utf-8",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}}}},4210:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.VorbisParser=void 0;const i=r(3416),n=r(1227),s=r(441),o=r(2127),c=(0,n.default)("music-metadata:parser:ogg:vorbis1");t.VorbisParser=class{constructor(e,t){this.metadata=e,this.options=t,this.pageSegments=[]}parsePage(e,t){if(e.headerType.firstPage)this.parseFirstPage(e,t);else{if(e.headerType.continued){if(0===this.pageSegments.length)throw new Error("Cannot continue on previous page");this.pageSegments.push(t)}if(e.headerType.lastPage||!e.headerType.continued){if(this.pageSegments.length>0){const e=a.concat(this.pageSegments);this.parseFullPage(e)}this.pageSegments=e.headerType.lastPage?[]:[t]}}e.headerType.lastPage&&this.calculateDuration(e)}flush(){this.parseFullPage(a.concat(this.pageSegments))}parseUserComment(e,t){const r=new s.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 c("Ignore picture");t=o.VorbisPictureToken.fromBase64(t),c(`Push picture: id=${e}, format=${t.format}`)}else c(`Push tag: id=${e}, value=${t}`);this.metadata.addTag("vorbis",e,t)}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))}parseFirstPage(e,t){this.metadata.setFormat("codec","Vorbis I"),c("Parse first page");const r=o.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=o.IdentificationHeader.get(t,o.CommonHeader.len);this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("bitrate",e.bitrateNominal),this.metadata.setFormat("numberOfChannels",e.channelMode),c("sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s",e.sampleRate,e.bitrateNominal,e.channelMode)}}parseFullPage(e){const t=o.CommonHeader.get(e,0);if(c("Parse full page: type=%s, byteLength=%s",t.packetType,e.byteLength),3===t.packetType)return this.parseUserCommentList(e,o.CommonHeader.len)}parseUserCommentList(e,t){const r=i.UINT32_LE.get(e,t);t+=4,t+=r;let a=i.UINT32_LE.get(e,t);for(t+=4;a-- >0;)t+=this.parseUserComment(e,t)}}},9860:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VorbisTagMapper=void 0;const a=r(9918),i={TITLE:"title",ARTIST:"artist",ARTISTS:"artists",ALBUMARTIST:"albumartist","ALBUM ARTIST":"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",KEY:"key",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 n extends a.CommonTagMapper{static toRating(e,t){return{source:e?e.toLowerCase():e,rating:parseFloat(t)*a.CommonTagMapper.maxRatingScore}}constructor(){super(["vorbis"],i)}postMap(e){if(0===e.id.indexOf("RATING:")){const t=e.id.split(":");e.value=n.toRating(t[1],e.value),e.id=t[0]}}}t.VorbisTagMapper=n},3211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListInfoTagValue=t.Header=void 0;const a=r(3416);t.Header={len:8,get:(e,t)=>({chunkID:e.toString("binary",t,t+4),chunkSize:a.UINT32_LE.get(e,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)}}},5756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RiffInfoTagMapper=t.riffInfoTagMap=void 0;const a=r(9918);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"};class i extends a.CommonTagMapper{constructor(){super(["exif"],t.riffInfoTagMap)}}t.RiffInfoTagMapper=i},6032:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TrackType=void 0;var a=r(8591);Object.defineProperty(t,"TrackType",{enumerable:!0,get:function(){return a.TrackType}})},8053:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastAudioExtensionChunk=void 0;const a=r(3416);t.BroadcastAudioExtensionChunk={len:420,get:(e,t)=>({description:new a.StringType(256,"ascii").get(e,t).trim(),originator:new a.StringType(32,"ascii").get(e,t+256).trim(),originatorReference:new a.StringType(32,"ascii").get(e,t+288).trim(),originationDate:new a.StringType(10,"ascii").get(e,t+320).trim(),originationTime:new a.StringType(8,"ascii").get(e,t+330).trim(),timeReferenceLow:a.UINT32_LE.get(e,t+338),timeReferenceHigh:a.UINT32_LE.get(e,t+342),version:a.UINT16_LE.get(e,t+346),umid:new a.Uint8ArrayType(64).get(e,t+348),loudnessValue:a.UINT16_LE.get(e,t+412),maxTruePeakLevel:a.UINT16_LE.get(e,t+414),maxMomentaryLoudness:a.UINT16_LE.get(e,t+416),maxShortTermLoudness:a.UINT16_LE.get(e,t+418)})}},9975:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.FactChunk=t.Format=t.WaveFormat=void 0,(r=t.WaveFormat||(t.WaveFormat={}))[r.PCM=1]="PCM",r[r.ADPCM=2]="ADPCM",r[r.IEEE_FLOAT=3]="IEEE_FLOAT",r[r.MPEG_ADTS_AAC=5632]="MPEG_ADTS_AAC",r[r.MPEG_LOAS=5634]="MPEG_LOAS",r[r.RAW_AAC1=255]="RAW_AAC1",r[r.DOLBY_AC3_SPDIF=146]="DOLBY_AC3_SPDIF",r[r.DVM=8192]="DVM",r[r.RAW_SPORT=576]="RAW_SPORT",r[r.ESST_AC3=577]="ESST_AC3",r[r.DRM=9]="DRM",r[r.DTS2=8193]="DTS2",r[r.MPEG=80]="MPEG",t.Format=class{constructor(e){if(e.chunkSize<16)throw new Error("Invalid chunk size");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){if(e.chunkSize<4)throw new Error("Invalid fact chunk size.");this.len=e.chunkSize}get(e,t){return{dwSampleLength:e.readUInt32LE(t)}}}},2682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaveParser=void 0;const a=r(5849),i=r(3416),n=r(1227),s=r(3211),o=r(9975),c=r(8928),l=r(3769),u=r(8049),d=r(7805),f=r(8053),p=(0,n.default)("music-metadata:parser:RIFF");class m 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(u.FourCcToken);if(this.metadata.setFormat("container",t),"WAVE"===t)return this.readWaveChunk(e-u.FourCcToken.len);throw new Error(`Unsupported RIFF format: RIFF/${t}`)}async readWaveChunk(e){for(;e>=s.Header.len;){const t=await this.tokenizer.readToken(s.Header);switch(e-=s.Header.len+t.chunkSize,t.chunkSize>e&&this.metadata.addWarning("Data chunk size exceeds file size"),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 e=await this.tokenizer.readToken(new o.Format(t));let r=o.WaveFormat[e.wFormatTag];r||(p("WAVE/non-PCM format="+e.wFormatTag),r="non-PCM ("+e.wFormatTag+")"),this.metadata.setFormat("codec",r),this.metadata.setFormat("bitsPerSample",e.wBitsPerSample),this.metadata.setFormat("sampleRate",e.nSamplesPerSec),this.metadata.setFormat("numberOfChannels",e.nChannels),this.metadata.setFormat("bitrate",e.nBlockAlign*e.nSamplesPerSec*8),this.blockAlign=e.nBlockAlign;break;case"id3 ":case"ID3 ":const n=await this.tokenizer.readToken(new i.Uint8ArrayType(t.chunkSize)),s=a.fromBuffer(n);await(new c.ID3v2Parser).parse(this.metadata,s,this.options);break;case"data":!1!==this.metadata.format.lossless&&this.metadata.setFormat("lossless",!0);let l=t.chunkSize;if(this.tokenizer.fileInfo.size){const e=this.tokenizer.fileInfo.size-this.tokenizer.position;e<l&&(this.metadata.addWarning("data chunk length exceeding file length"),l=e)}const u=this.fact?this.fact.dwSampleLength:4294967295===l?void 0:l/this.blockAlign;u&&(this.metadata.setFormat("numberOfSamples",u),this.metadata.setFormat("duration",u/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;case"bext":const d=await this.tokenizer.readToken(f.BroadcastAudioExtensionChunk);Object.keys(d).forEach((e=>{this.metadata.addTag("exif","bext."+e,d[e])}));break;case"\0\0\0\0":p(`Ignore padding chunk: RIFF/${t.chunkID} of ${t.chunkSize} bytes`),this.metadata.addWarning("Ignore chunk: RIFF/"+t.chunkID),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))}}async parseListTag(e){const t=await this.tokenizer.readToken(new i.StringType(4,"binary"));return p("pos=%s, parseListTag: chunkID=RIFF/WAVE/LIST/%s",this.tokenizer.position,t),"INFO"===t?this.parseRiffInfoTags(e.chunkSize-4):(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,l.stripNulls(a)),e-=8+r.len}if(0!==e)throw Error("Illegal remaining size: "+e)}addTag(e,t){this.metadata.addTag("exif",e,t)}}t.WaveParser=m},5870:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.WavPackParser=void 0;const i=r(3416),n=r(6742),s=r(8049),o=r(7805),c=r(2989),l=(0,r(1227).default)("music-metadata:parser:WavPack");class u extends o.BasicParser{async parse(){return this.audioDataSize=0,await this.parseWavPackBlocks(),n.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);if("wvpk"!==e.BlockID)throw new Error("Invalid WavPack Block-ID");l(`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);await(0===e.blockIndex?this.parseMetadataSubBlock(e,t):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(e,t){for(;t>c.WavPack.MetadataIdToken.len;){const r=await this.tokenizer.readToken(c.WavPack.MetadataIdToken),n=await this.tokenizer.readNumber(r.largeBlock?i.UINT24_LE:i.UINT8),s=a.alloc(2*n-(r.isOddSize?1:0));switch(await this.tokenizer.readBuffer(s),l(`Metadata Sub-Blocks functionId=0x${r.functionId.toString(16)}, id.largeBlock=${r.largeBlock},data-size=${s.length}`),r.functionId){case 0:break;case 14:l("ID_DSD_BLOCK");const t=1<<s.readUInt8(0),a=e.flags.samplingRate*t*8;if(!e.flags.isDSD)throw new Error("Only expect DSD block if DSD-flag is set");this.metadata.setFormat("sampleRate",a),this.metadata.setFormat("duration",e.totalSamples/a);break;case 36:l("ID_ALT_TRAILER: trailer for non-wav files");break;case 38:this.metadata.setFormat("audioMD5",s);break;case 47:l(`ID_BLOCK_CHECKSUM: checksum=${s.toString("hex")}`);break;default:l(`Ignore unsupported meta-sub-block-id functionId=0x${r.functionId.toString(16)}`)}t-=c.WavPack.MetadataIdToken.len+(r.largeBlock?i.UINT24_LE.len:i.UINT8.len)+2*n,l(`remainingLength=${t}`),r.isOddSize&&this.tokenizer.ignore(1)}if(0!==t)throw new Error("metadata-sub-block should fit it remaining length")}}t.WavPackParser=u},2989:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WavPack=void 0;const a=r(3416),i=r(8049),n=[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:i.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:n[s.getBitAllignedNumber(r,23,4)],isDSD:s.isBitSet(r,31)},crc:new a.Uint8ArrayType(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)})}},8985:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Deferred=void 0,t.Deferred=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}}},7279:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EndOfStreamError=t.defaultMessages=void 0,t.defaultMessages="End-Of-Stream";class r extends Error{constructor(){super(t.defaultMessages)}}t.EndOfStreamError=r},6654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;const a=r(7279),i=r(8985);var n=r(7279);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}}),t.StreamReader=class{constructor(e){if(this.s=e,this.deferred=null,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 a.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.subarray(t,t+a)),a}async read(e,t,r){if(0===r)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new a.EndOfStreamError;let i=r,n=0;for(;this.peekQueue.length>0&&i>0;){const r=this.peekQueue.pop();if(!r)throw new Error("peekData should be defined");const a=Math.min(r.length,i);e.set(r.subarray(0,a),t+n),n+=a,i-=a,a<r.length&&this.peekQueue.push(r.subarray(a))}for(;i>0&&!this.endOfStream;){const r=Math.min(i,1048576),a=await this.readFromStream(e,t+n,r);if(n+=a,a<r)break;i-=a}return n}async readFromStream(e,t,r){const a=this.s.read(r);if(a)return e.set(a,t),a.length;{const a={buffer:e,offset:t,length:r,deferred:new i.Deferred};return this.deferred=a.deferred,this.s.once("readable",(()=>{this.readDeferred(a)})),a.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",(()=>{this.readDeferred(e)}))}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}},5167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamReader=t.EndOfStreamError=void 0;var a=r(7279);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return a.EndOfStreamError}});var i=r(6654);Object.defineProperty(t,"StreamReader",{enumerable:!0,get:function(){return i.StreamReader}})},4155:e=>{var t,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:n}catch(e){r=n}}();var o,c=[],l=!1,u=-1;function d(){l&&o&&(l=!1,o.length?c=o.concat(c):u=-1,c.length&&f())}function f(){if(!l){var e=s(d);l=!0;for(var t=c.length;t;){for(o=c,c=[];++u<t;)o&&o[u].run();u=-1,t=c.length}o=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===n||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}a.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];c.push(new p(e,t)),1!==c.length||l||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=m,a.addListener=m,a.once=m,a.off=m,a.removeListener=m,a.removeAllListeners=m,a.emit=m,a.prependListener=m,a.prependOnceListener=m,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},4281:e=>{"use strict";var t={};function r(e,r,a){a||(a=Error);var i=function(e){var t,a;function i(t,a,i){return e.call(this,function(e,t,a){return"string"==typeof r?r:r(e,t,a)}(t,a,i))||this}return a=e,(t=i).prototype=Object.create(a.prototype),t.prototype.constructor=t,t.__proto__=a,i}(a);i.prototype.name=a.name,i.prototype.code=e,t[e]=i}function a(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,n,s,o,c;if("string"==typeof t&&(n="not ",t.substr(0,n.length)===n)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(a(t,"type"));else{var l=("number"!=typeof c&&(c=0),c+".".length>(o=e).length||-1===o.indexOf(".",c)?"argument":"property");s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(a(t,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:(e,t,r)=>{"use strict";var a=r(4155),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(9481),s=r(4229);r(5717)(u,n);for(var o=i(s.prototype),c=0;c<o.length;c++){var l=o[c];u.prototype[l]||(u.prototype[l]=s.prototype[l])}function u(e){if(!(this instanceof u))return new u(e);n.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||a.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,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)}})},2725:(e,t,r)=>{"use strict";e.exports=i;var a=r(4605);function i(e){if(!(this instanceof i))return new i(e);a.call(this,e)}r(5717)(i,a),i.prototype._transform=function(e,t,r){r(null,e)}},9481:(e,t,r)=>{"use strict";var a,i=r(4155);e.exports=E,E.ReadableState=_,r(7187).EventEmitter;var n,s=function(e,t){return e.listeners(t).length},o=r(2503),c=r(8764).Buffer,l=r.g.Uint8Array||function(){},u=r(4616);n=u&&u.debuglog?u.debuglog("stream"):function(){};var d,f,p,m=r(7327),h=r(1195),g=r(2457).getHighWaterMark,y=r(4281).q,b=y.ERR_INVALID_ARG_TYPE,T=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,v=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(E,o);var k=h.errorOrDestroy,I=["error","close","destroy","pause","resume"];function _(e,t,i){a=a||r(6753),e=e||{},"boolean"!=typeof i&&(i=t instanceof a),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new m,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.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=r(2553).s),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function E(e){if(a=a||r(6753),!(this instanceof E))return new E(e);var t=this instanceof a;this._readableState=new _(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function S(e,t,r,a,i){n("readableAddChunk",t);var s,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(n("onEofChunk"),!t.ended){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,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P(e)))}}(e,o);else if(i||(s=function(e,t){var r,a;return a=t,c.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(o,t)),s)k(e,s);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),a)o.endEmitted?k(e,new v):C(e,o,t,!0);else if(o.ended)k(e,new T);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?C(e,o,t,!1):D(e,o)):C(e,o,t,!1)}else a||(o.reading=!1,D(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function C(e,t,r,a){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,a?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),D(e,t)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=h.destroy,E.prototype._undestroy=h.undestroy,E.prototype._destroy=function(e,t){t(e)},E.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=c.from(e,t),t=""),r=!0),S(this,e,t,!1,r)},E.prototype.unshift=function(e){return S(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(e){d||(d=r(2553).s);var t=new d(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var a=this._readableState.buffer.head,i="";null!==a;)i+=t.write(a.data),a=a.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var A=1073741824;function B(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>=A?e=A:(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 x(e){var t=e._readableState;n("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(n("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(P,e))}function P(e){var t=e._readableState;n("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function D(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(M,e,t))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(n("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function O(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){n("readable nexttick read 0"),e.read(0)}function F(e,t){n("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(n("flow",t.flowing);t.flowing&&null!==e.read(););}function N(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.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function z(e){var t=e._readableState;n("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(U,t,e))}function U(e,t){if(n("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function j(e,t){for(var r=0,a=e.length;r<a;r++)if(e[r]===t)return r;return-1}E.prototype.read=function(e){n("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return n("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?z(this):x(this),null;if(0===(e=B(e,t))&&t.ended)return 0===t.length&&z(this),null;var a,i=t.needReadable;return n("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&n("length less than watermark",i=!0),t.ended||t.reading?n("reading or ended",i=!1):i&&(n("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=B(r,t))),null===(a=e>0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&z(this)),null!==a&&this.emit("data",a),a},E.prototype._read=function(e){k(this,new w("_read()"))},E.prototype.pipe=function(e,t){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,t);var o=t&&!1===t.end||e===i.stdout||e===i.stderr?h:c;function c(){n("onend"),e.end()}a.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",(function t(i,s){n("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,n("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",h),r.removeListener("data",d),u=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var t=e._readableState;n("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",l);var u=!1;function d(t){n("ondata");var i=e.write(t);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==j(a.pipes,e))&&!u&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function f(t){n("onerror",t),h(),e.removeListener("error",f),0===s(e,"error")&&k(e,t)}function p(){e.removeListener("finish",m),h()}function m(){n("onfinish"),e.removeListener("close",p),h()}function h(){n("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events.error?Array.isArray(e._events.error)?e._events.error.unshift(r):e._events.error=[r,e._events.error]:e.on(t,r)}(e,"error",f),e.once("close",p),e.once("finish",m),e.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),e},E.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||(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,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var n=0;n<i;n++)a[n].emit("unpipe",this,{hasUnpiped:!1});return this}var s=j(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},E.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t),a=this._readableState;return"data"===e?(a.readableListening=this.listenerCount("readable")>0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,n("on readable",a.length,a.reading),a.length?x(this):a.reading||i.nextTick(R,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(O,this),r},E.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(O,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(n("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(F,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var i in e.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){n("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(a=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<I.length;s++)e.on(I[s],this.emit.bind(this,I[s]));return this._read=function(t){n("wrapped _read",t),a&&(a=!1,e.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(5850)),f(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=N,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(e,t){return void 0===p&&(p=r(889)),p(E,e,t)})},4605:(e,t,r)=>{"use strict";e.exports=u;var a=r(4281).q,i=a.ERR_METHOD_NOT_IMPLEMENTED,n=a.ERR_MULTIPLE_CALLBACK,s=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=a.ERR_TRANSFORM_WITH_LENGTH_0,c=r(6753);function l(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(null===a)return this.emit("error",new n);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);c.call(this,e),this._transformState={afterTransform:l.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",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,r){f(e,t,r)}))}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new o;if(e._transformState.transforming)throw new s;return e.push(null)}r(5717)(u,c),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new i("_transform()"))},u.prototype._write=function(e,t,r){var a=this._transformState;if(a.writecb=r,a.writechunk=e,a.writeencoding=t,!a.transforming){var i=this._readableState;(a.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:(e,t,r)=>{"use strict";var a,i=r(4155);function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var a=e.entry;for(e.entry=null;a;){var i=a.callback;t.pendingcb--,i(undefined),a=a.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=E,E.WritableState=_;var s,o={deprecate:r(4927)},c=r(2503),l=r(8764).Buffer,u=r.g.Uint8Array||function(){},d=r(1195),f=r(2457).getHighWaterMark,p=r(4281).q,m=p.ERR_INVALID_ARG_TYPE,h=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,y=p.ERR_STREAM_CANNOT_PIPE,b=p.ERR_STREAM_DESTROYED,T=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,v=p.ERR_UNKNOWN_ENCODING,k=d.errorOrDestroy;function I(){}function _(e,t,s){a=a||r(6753),e=e||{},"boolean"!=typeof s&&(s=t instanceof a),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,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"!=typeof n)throw new g;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(P,e,t),e._writableState.errorEmitted=!0,k(e,a)):(n(a),e._writableState.errorEmitted=!0,k(e,a),P(e,t))}(e,r,a,t,n);else{var s=B(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||A(e,r),a?i.nextTick(C,e,r,s,n):C(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.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function E(e){var t=this instanceof(a=a||r(6753));if(!t&&!s.call(E,this))return new E(e);this._writableState=new _(e,this,t),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)),c.call(this)}function S(e,t,r,a,i,n,s){t.writelen=a,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,n,t.onwrite),t.sync=!1}function C(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),P(e,t)}function A(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,i=new Array(a),s=t.corkedRequestsFree;s.entry=r;for(var o=0,c=!0;r;)i[o]=r,r.isBuf||(c=!1),r=r.next,o+=1;i.allBuffers=c,S(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,d=r.callback;if(S(e,t,!1,t.objectMode?1:l.length,l,u,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function B(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final((function(r){t.pendingcb--,r&&k(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)}))}function P(e,t){var r=B(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var a=e._readableState;(!a||a.autoDestroy&&a.endEmitted)&&e.destroy()}return r}r(5717)(E,c),_.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(_.prototype,"buffer",{get:o.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]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===E&&e&&e._writableState instanceof _}})):s=function(e){return e instanceof this},E.prototype.pipe=function(){k(this,new y)},E.prototype.write=function(e,t,r){var a,n=this._writableState,s=!1,o=!n.objectMode&&(a=e,l.isBuffer(a)||a instanceof u);return o&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=I),n.ending?function(e,t){var r=new w;k(e,r),i.nextTick(t,r)}(this,r):(o||function(e,t,r,a){var n;return null===r?n=new T:"string"==typeof r||t.objectMode||(n=new m("chunk",["string","Buffer"],r)),!n||(k(e,n),i.nextTick(a,n),!1)}(this,n,e,r))&&(n.pendingcb++,s=function(e,t,r,a,i,n){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,a,i);a!==s&&(r=!0,i="buffer",a=s)}var o=t.objectMode?1:a.length;t.length+=o;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:a,encoding:i,isBuf:r,callback:n,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else S(e,t,!1,o,a,i,n);return c}(this,n,o,e,t,r)),s},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},E.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 v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new h("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,r){var a=this._writableState;return"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||function(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,a,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=d.destroy,E.prototype._undestroy=d.undestroy,E.prototype._destroy=function(e,t){t(e)}},5850:(e,t,r)=>{"use strict";var a,i=r(4155);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(8610),o=Symbol("lastResolve"),c=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),d=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function m(e,t){return{value:e,done:t}}function h(e){var t=e[o];if(null!==t){var r=e[p].read();null!==r&&(e[d]=null,e[o]=null,e[c]=null,t(m(r,!1)))}}function g(e){i.nextTick(h,e)}var y=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((n(a={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(m(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[l]?r(e[l]):t(m(void 0,!0))}))}));var r,a=this[d];if(a)r=new Promise(function(e,t){return function(r,a){e.then((function(){t[u]?r(m(void 0,!0)):t[f](r,a)}),a)}}(a,this));else{var n=this[p].read();if(null!==n)return Promise.resolve(m(n,!1));r=new Promise(this[f])}return this[d]=r,r}},Symbol.asyncIterator,(function(){return this})),n(a,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(m(void 0,!0))}))}))})),a),y);e.exports=function(e){var t,r=Object.create(b,(n(t={},p,{value:e,writable:!0}),n(t,o,{value:null,writable:!0}),n(t,c,{value:null,writable:!0}),n(t,l,{value:null,writable:!0}),n(t,u,{value:e._readableState.endEmitted,writable:!0}),n(t,f,{value:function(e,t){var a=r[p].read();a?(r[d]=null,r[o]=null,r[c]=null,e(m(a,!1))):(r[o]=e,r[c]=t)},writable:!0}),t));return r[d]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];return null!==t&&(r[d]=null,r[o]=null,r[c]=null,t(e)),void(r[l]=e)}var a=r[o];null!==a&&(r[d]=null,r[o]=null,r[c]=null,a(m(void 0,!0))),r[u]=!0})),e.on("readable",g.bind(null,r)),r}},7327:(e,t,r)=>{"use strict";function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var s=r(8764).Buffer,o=r(2361).inspect,c=o&&o.custom||"inspect";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}var t,r;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,a,i=s.allocUnsafe(e>>>0),n=this.head,o=0;n;)t=n.data,r=i,a=o,s.prototype.copy.call(t,r,a),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,a=t.data;for(e-=a.length;t=t.next;){var i=t.data,n=e>i.length?i.length:e;if(n===i.length?a+=i:a+=i.slice(0,e),0==(e-=n)){n===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(n));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,n=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,n),0==(e-=n)){n===i.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(n));break}++a}return this.length-=a,t}},{key:c,value:function(e,t){return o(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&n(t.prototype,r),e}()},1195:(e,t,r)=>{"use strict";var a=r(4155);function i(e,t){s(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return o||c?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,a.nextTick(s,this,e)):a.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?a.nextTick(n,r):(r._writableState.errorEmitted=!0,a.nextTick(i,r,e)):a.nextTick(i,r,e):t?(a.nextTick(n,r),t(e)):a.nextTick(n,r)})),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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,a=e._writableState;r&&r.autoDestroy||a&&a.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,r)=>{"use strict";var a=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,n){if("function"==typeof r)return e(t,null,r);r||(r={}),n=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];e.apply(this,a)}}}(n||i);var s=r.readable||!1!==r.readable&&t.readable,o=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||u()},l=t._writableState&&t._writableState.finished,u=function(){o=!1,l=!0,s||n.call(t)},d=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,d=!0,o||n.call(t)},p=function(e){n.call(t,e)},m=function(){var e;return s&&!d?(t._readableState&&t._readableState.ended||(e=new a),n.call(t,e)):o&&!l?(t._writableState&&t._writableState.ended||(e=new a),n.call(t,e)):void 0},h=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",m),t.req?h():t.on("request",h)):o&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",f),t.on("finish",u),!1!==r.error&&t.on("error",p),t.on("close",m),function(){t.removeListener("complete",u),t.removeListener("abort",m),t.removeListener("request",h),t.req&&t.req.removeListener("finish",u),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",u),t.removeListener("end",f),t.removeListener("error",p),t.removeListener("close",m)}}},889:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,r)=>{"use strict";var a,i=r(4281).q,n=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function c(e,t,i,n){n=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(n);var o=!1;e.on("close",(function(){o=!0})),void 0===a&&(a=r(8610)),a(e,{readable:t,writable:i},(function(e){if(e)return n(e);o=!0,n()}));var c=!1;return function(t){if(!o&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void n(t||new s("pipe"))}}function l(e){e()}function u(e,t){return e.pipe(t)}function d(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a,i=d(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new n("streams");var s=t.map((function(e,r){var n=r<t.length-1;return c(e,n,r>0,(function(e){a||(a=e),e&&s.forEach(l),n||(s.forEach(l),i(a))}))}));return t.reduce(u)}},2457:(e,t,r)=>{"use strict";var a=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var n=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new a(i?r:"highWaterMark",n);return Math.floor(n)}return e.objectMode?16:16384}}},2503:(e,t,r)=>{e.exports=r(7187).EventEmitter},8473:(e,t,r)=>{(t=e.exports=r(9481)).Stream=t,t.Readable=t,t.Writable=r(4229),t.Duplex=r(6753),t.Transform=r(4605),t.PassThrough=r(2725),t.finished=r(8610),t.pipeline=r(9946)},8090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableWebToNodeStream=void 0;const a=r(8473);class i 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()}}t.ReadableWebToNodeStream=i},9509:(e,t,r)=>{var a=r(8764),i=a.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=a:(n(a,t),t.Buffer=s),n(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var a=i(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 i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},2553:(e,t,r)=>{"use strict";var a=r(9509).Buffer,i=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 n(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===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=u,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,"<22>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(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 l(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 u(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.s=n,n.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||""},n.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},n.prototype.text=function(e,t){var r=function(e,t,r){var a=t.length-1;if(a<r)return 0;var i=s(t[a]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--a<r||-2===i?0:(i=s(t[a]))>=0?(i>0&&(e.lastNeed=i-2),i):--a<r||-2===i?0:(i=s(t[a]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):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)},n.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}},842:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTokenizer=void 0;const i=r(5167);t.AbstractTokenizer=class{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position;const r=a.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new i.EndOfStreamError;return e.get(r,0)}async peekToken(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position;const r=a.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new i.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new i.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new i.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}}},778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferTokenizer=void 0;const a=r(5167),i=r(842);class n extends i.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,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` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),i=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&i<r.length)throw new a.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+i),r.offset),i}async close(){}}t.BufferTokenizer=n},599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadStreamTokenizer=void 0;const a=r(842),i=r(5167);class n extends a.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new i.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),a=r.position-this.position;if(a>0)return await this.ignore(a),this.readBuffer(e,t);if(a<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const n=await this.streamReader.read(e,r.offset,r.length);if(this.position+=n,(!t||!t.mayBeLess)&&n<r.length)throw new i.EndOfStreamError;return n}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let a=0;if(r.position){const t=r.position-this.position;if(t>0){const i=new Uint8Array(r.length+t);return a=await this.peekBuffer(i,{mayBeLess:r.mayBeLess}),e.set(i.subarray(t),r.offset),a-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{a=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof i.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&a<r.length)throw new i.EndOfStreamError}return a}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let a=0;for(;a<e;){const i=e-a,n=await this.readBuffer(r,{length:Math.min(t,i)});if(n<0)return n;a+=n}return a}}t.ReadStreamTokenizer=n},5849:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromBuffer=t.fromStream=t.EndOfStreamError=void 0;const a=r(599),i=r(778);var n=r(5167);Object.defineProperty(t,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}}),t.fromStream=function(e,t){return t=t||{},new a.ReadStreamTokenizer(e,t)},t.fromBuffer=function(e,t){return new i.BufferTokenizer(e,t)}},3416:(e,t,r)=>{"use strict";var a=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.AnsiStringType=t.StringType=t.BufferType=t.Uint8ArrayType=t.IgnoreType=t.Float80_LE=t.Float80_BE=t.Float64_LE=t.Float64_BE=t.Float32_LE=t.Float32_BE=t.Float16_LE=t.Float16_BE=t.INT64_BE=t.UINT64_BE=t.INT64_LE=t.UINT64_LE=t.INT32_LE=t.INT32_BE=t.INT24_BE=t.INT24_LE=t.INT16_LE=t.INT16_BE=t.INT8=t.UINT32_BE=t.UINT32_LE=t.UINT24_BE=t.UINT24_LE=t.UINT16_BE=t.UINT16_LE=t.UINT8=void 0;const i=r(645);function n(e){return new DataView(e.buffer,e.byteOffset)}t.UINT8={len:1,get:(e,t)=>n(e).getUint8(t),put:(e,t,r)=>(n(e).setUint8(t,r),t+1)},t.UINT16_LE={len:2,get:(e,t)=>n(e).getUint16(t,!0),put:(e,t,r)=>(n(e).setUint16(t,r,!0),t+2)},t.UINT16_BE={len:2,get:(e,t)=>n(e).getUint16(t),put:(e,t,r)=>(n(e).setUint16(t,r),t+2)},t.UINT24_LE={len:3,get(e,t){const r=n(e);return r.getUint8(t)+(r.getUint16(t+1,!0)<<8)},put(e,t,r){const a=n(e);return a.setUint8(t,255&r),a.setUint16(t+1,r>>8,!0),t+3}},t.UINT24_BE={len:3,get(e,t){const r=n(e);return(r.getUint16(t)<<8)+r.getUint8(t+2)},put(e,t,r){const a=n(e);return a.setUint16(t,r>>8),a.setUint8(t+2,255&r),t+3}},t.UINT32_LE={len:4,get:(e,t)=>n(e).getUint32(t,!0),put:(e,t,r)=>(n(e).setUint32(t,r,!0),t+4)},t.UINT32_BE={len:4,get:(e,t)=>n(e).getUint32(t),put:(e,t,r)=>(n(e).setUint32(t,r),t+4)},t.INT8={len:1,get:(e,t)=>n(e).getInt8(t),put:(e,t,r)=>(n(e).setInt8(t,r),t+2)},t.INT16_BE={len:2,get:(e,t)=>n(e).getInt16(t),put:(e,t,r)=>(n(e).setInt16(t,r),t+2)},t.INT16_LE={len:2,get:(e,t)=>n(e).getInt16(t,!0),put:(e,t,r)=>(n(e).setInt16(t,r,!0),t+2)},t.INT24_LE={len:3,get(e,r){const a=t.UINT24_LE.get(e,r);return a>8388607?a-16777216:a},put(e,t,r){const a=n(e);return a.setUint8(t,255&r),a.setUint16(t+1,r>>8,!0),t+3}},t.INT24_BE={len:3,get(e,r){const a=t.UINT24_BE.get(e,r);return a>8388607?a-16777216:a},put(e,t,r){const a=n(e);return a.setUint16(t,r>>8),a.setUint8(t+2,255&r),t+3}},t.INT32_BE={len:4,get:(e,t)=>n(e).getInt32(t),put:(e,t,r)=>(n(e).setInt32(t,r),t+4)},t.INT32_LE={len:4,get:(e,t)=>n(e).getInt32(t,!0),put:(e,t,r)=>(n(e).setInt32(t,r,!0),t+4)},t.UINT64_LE={len:8,get:(e,t)=>n(e).getBigUint64(t,!0),put:(e,t,r)=>(n(e).setBigUint64(t,r,!0),t+8)},t.INT64_LE={len:8,get:(e,t)=>n(e).getBigInt64(t,!0),put:(e,t,r)=>(n(e).setBigInt64(t,r,!0),t+8)},t.UINT64_BE={len:8,get:(e,t)=>n(e).getBigUint64(t),put:(e,t,r)=>(n(e).setBigUint64(t,r),t+8)},t.INT64_BE={len:8,get:(e,t)=>n(e).getBigInt64(t),put:(e,t,r)=>(n(e).setBigInt64(t,r),t+8)},t.Float16_BE={len:2,get(e,t){return i.read(e,t,!1,10,this.len)},put(e,t,r){return i.write(e,r,t,!1,10,this.len),t+this.len}},t.Float16_LE={len:2,get(e,t){return i.read(e,t,!0,10,this.len)},put(e,t,r){return i.write(e,r,t,!0,10,this.len),t+this.len}},t.Float32_BE={len:4,get:(e,t)=>n(e).getFloat32(t),put:(e,t,r)=>(n(e).setFloat32(t,r),t+4)},t.Float32_LE={len:4,get:(e,t)=>n(e).getFloat32(t,!0),put:(e,t,r)=>(n(e).setFloat32(t,r,!0),t+4)},t.Float64_BE={len:8,get:(e,t)=>n(e).getFloat64(t),put:(e,t,r)=>(n(e).setFloat64(t,r),t+8)},t.Float64_LE={len:8,get:(e,t)=>n(e).getFloat64(t,!0),put:(e,t,r)=>(n(e).setFloat64(t,r,!0),t+8)},t.Float80_BE={len:10,get(e,t){return i.read(e,t,!1,63,this.len)},put(e,t,r){return i.write(e,r,t,!1,63,this.len),t+this.len}},t.Float80_LE={len:10,get(e,t){return i.read(e,t,!0,63,this.len)},put(e,t,r){return i.write(e,r,t,!0,63,this.len),t+this.len}},t.IgnoreType=class{constructor(e){this.len=e}get(e,t){}},t.Uint8ArrayType=class{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}},t.BufferType=class{constructor(e){this.len=e}get(e,t){return a.from(e.subarray(t,t+this.len))}},t.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return a.from(e).toString(this.encoding,t,t+this.len)}};class s{constructor(e){this.len=e}static decode(e,t,r){let a="";for(let i=t;i<r;++i)a+=s.codePointToString(s.singleByteDecoder(e[i]));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(s.inRange(e,0,127))return e;const t=s.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return s.decode(e,t,t+this.len)}}t.AnsiStringType=s,s.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]},9620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchFromUrl=t.parseBlob=t.parseReadableStream=t.parseNodeStream=t.selectCover=t.ratingToStars=t.orderTags=t.parseFromTokenizer=t.parseBuffer=void 0;const a=r(1227),i=r(523),n=r(8090),s=a("music-metadata-browser:main");var o=r(523);async function c(e,r,a){const i=new n.ReadableWebToNodeStream(e),s=await(0,t.parseNodeStream)(i,"string"==typeof r?{mimeType:r}:r,a);return await i.close(),s}async function l(e,t){const r={mimeType:e.type,size:e.size};return e instanceof File&&(r.path=e.name),c(e.stream?e.stream():function(e){const t=new FileReader;return new ReadableStream({start(r){t.onloadend=e=>{let t=e.target.result;t instanceof ArrayBuffer&&(t=new Uint8Array(t)),r.enqueue(t),r.close()},t.onerror=e=>{r.close()},t.onabort=e=>{r.close()},t.readAsArrayBuffer(e)}})}(e),{mimeType:e.type,size:e.size},t)}Object.defineProperty(t,"parseBuffer",{enumerable:!0,get:function(){return o.parseBuffer}}),Object.defineProperty(t,"parseFromTokenizer",{enumerable:!0,get:function(){return o.parseFromTokenizer}}),Object.defineProperty(t,"orderTags",{enumerable:!0,get:function(){return o.orderTags}}),Object.defineProperty(t,"ratingToStars",{enumerable:!0,get:function(){return o.ratingToStars}}),Object.defineProperty(t,"selectCover",{enumerable:!0,get:function(){return o.selectCover}}),t.parseNodeStream=i.parseStream,t.parseReadableStream=c,t.parseBlob=l,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 c(r.body,a,t);return s("Closing HTTP-readable-stream..."),r.body.locked||await r.body.cancel(),s("HTTP-readable-stream closed."),e}return l(await r.blob(),t)}throw new Error(`HTTP error status=${r.status}: ${r.statusText}`)}},4927:(e,t,r)=>{function a(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(a("noDeprecation"))return e;var r=!1;return function(){if(!r){if(a("throwDeprecation"))throw new Error(t);a("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},2361:()=>{},4616:()=>{}},__webpack_module_cache__={};function __nested_webpack_require_496077__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__nested_webpack_require_496077__),r.exports}__nested_webpack_require_496077__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var __webpack_exports__=__nested_webpack_require_496077__(9620);return __webpack_exports__})(),module.exports=factory()}}]);
|
||
//# sourceMappingURL=8505.f588195fa145445de93b.js.map
|