!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Webamp=t():e.Webamp=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=117)}([function(e,t,n){"use strict";e.exports=n(55)},function(e,t,n){"use strict";e.exports=n(56)},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";function r(e,t){return e===t}function i(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:r,n=null,a=null;return function(){return i(t,n,arguments)||(a=e.apply(null,arguments)),n=arguments,a}}function o(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function A(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:s;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map((function(t){return e[t]})),(function(){for(var e=arguments.length,t=Array(e),r=0;r{if(t+n>e.length){if("function"!=typeof r)throw new Error("Buffer out of space and no valid flush() function found");return r(e,t),0}return t};t.UINT8={len:1,get:(e,t)=>e.readUInt8(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=0&&n<=255),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeUInt8(n,o),o-t+this.len}},t.UINT16_LE={len:2,get:(e,t)=>e.readUInt16LE(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=0&&n<=65535),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeUInt16LE(n,o),o-t+this.len}},t.UINT16_BE={len:2,get:(e,t)=>e.readUInt16BE(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=0&&n<=65535),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeUInt16BE(n,o),o-t+this.len}},t.UINT24_LE={len:3,get:(e,t)=>e.readUIntLE(t,3),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=0&&n<=16777215),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeUIntLE(n,o,3),o-t+this.len}},t.UINT24_BE={len:3,get:(e,t)=>e.readUIntBE(t,3),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=0&&n<=16777215),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeUIntBE(n,o,3),o-t+this.len}},t.UINT32_LE={len:4,get:(e,t)=>e.readUInt32LE(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=0&&n<=4294967295),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeUInt32LE(n,o),o-t+this.len}},t.UINT32_BE={len:4,get:(e,t)=>e.readUInt32BE(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=0&&n<=4294967295),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeUInt32BE(n,o),o-t+this.len}},t.INT8={len:1,get:(e,t)=>e.readInt8(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=-128&&n<=127),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeInt8(n,o),o-t+this.len}},t.INT16_BE={len:2,get:(e,t)=>e.readInt16BE(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=-32768&&n<=32767),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeInt16BE(n,o),o-t+this.len}},t.INT16_LE={len:2,get:(e,t)=>e.readInt16LE(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=-32768&&n<=32767),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeInt16LE(n,o),o-t+this.len}},t.INT24_LE={len:3,get:(e,t)=>e.readIntLE(t,3),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=-8388608&&n<=8388607),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeIntLE(n,o,3),o-t+this.len}},t.INT24_BE={len:3,get:(e,t)=>e.readIntBE(t,3),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=-8388608&&n<=8388607),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeIntBE(n,o,3),o-t+this.len}},t.INT32_BE={len:4,get:(e,t)=>e.readInt32BE(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=-2147483648&&n<=2147483647),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeInt32BE(n,o),o-t+this.len}},t.INT32_LE={len:4,get:(e,t)=>e.readInt32LE(t),put(e,t,n,i){r.equal(typeof t,"number"),r.equal(typeof n,"number"),r.ok(n>=-2147483648&&n<=2147483647),r.ok(t>=0),r.ok(this.len<=e.length);const o=a(e,t,this.len,i);return e.writeInt32LE(n,o),o-t+this.len}},t.UINT64_LE={len:8,get(e,t){return function(e,t,n){n>>>=0;let r=e[t>>>=0],i=1,a=0;for(;++a>>=0;let i=1,a=0;e[n>>>=0]=255&t;for(;++a>>=0;let r=e[t>>>=0],i=1,a=0;for(;++a=i&&(r-=Math.pow(2,8*n));return r}(e,t,this.len)},put(e,t,n){return A(e,n,t,this.len)}},t.UINT64_BE={len:8,get(e,t){return s(e,t,this.len)},put(e,t,n){return l(e,n,t,this.len)}},t.INT64_BE={len:8,get(e,t){return u(e,t,this.len)},put(e,t,n){return c(e,n,t,this.len)}},t.Float16_BE={len:2,get(e,t){return i.read(e,t,!1,10,this.len)},put(e,t,n){return i.write(e,n,t,!1,10,this.len)}},t.Float16_LE={len:2,get(e,t){return i.read(e,t,!0,10,this.len)},put(e,t,n){return i.write(e,n,t,!0,10,this.len)}},t.Float32_BE={len:4,get:(e,t)=>e.readFloatBE(t),put:(e,t,n)=>e.writeFloatBE(n,t)},t.Float32_LE={len:4,get:(e,t)=>e.readFloatLE(t),put:(e,t,n)=>e.writeFloatLE(n,t)},t.Float64_BE={len:8,get:(e,t)=>e.readDoubleBE(t),put:(e,t,n)=>e.writeDoubleBE(n,t)},t.Float64_LE={len:8,get:(e,t)=>e.readDoubleLE(t),put:(e,t,n)=>e.writeDoubleLE(n,t)},t.Float80_BE={len:10,get(e,t){return i.read(e,t,!1,63,this.len)},put(e,t,n){return i.write(e,n,t,!1,63,this.len)}},t.Float80_LE={len:10,get(e,t){return i.read(e,t,!0,63,this.len)},put(e,t,n){return i.write(e,n,t,!0,63,this.len)}};t.IgnoreType=class{constructor(e){this.len=e}get(e,t){}};t.BufferType=class{constructor(e){this.len=e}get(e,t){return e.slice(t,t+this.len)}};t.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return e.toString(this.encoding,t,t+this.len)}};class o{constructor(e){this.len=e}static decode(e,t,n){let r="";for(let i=t;i>10),56320+(1023&e)))}static singleByteDecoder(e){if(o.inRange(e,0,127))return e;const t=o.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return o.decode(e,t,t+this.len)}}function A(e,t,n,r){t=+t;let i=0,a=1,o=0;for(e[n>>>=0]=255&t;++i>0)-o&255;return n+r}function s(e,t,n){n>>>=0;let r=e[(t>>>=0)+--n],i=1;for(;n>0&&(i*=256);)r+=e[t+--n]*i;return r}function l(e,t,n,r){t=+t;let i=(r>>>=0)-1,a=1;for(e[(n>>>=0)+i]=255&t;--i>=0&&(a*=256);)e[n+i]=t/a&255;return n+r}function u(e,t,n){let r=n>>>=0,i=1,a=e[(t>>>=0)+--r];for(;r>0&&(i*=256);)a+=e[t+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*n)),a}function c(e,t,n,r){t=+t;let i=r-1,a=1,o=0;for(e[(n>>>=0)+i]=255&t;--i>=0&&(a*=256);)t<0&&0===o&&0!==e[n+i+1]&&(o=1),e[n+i]=(t/a>>0)-o&255;return n+r}t.AnsiStringType=o,o.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],t.writeIntLE=A,t.readUIntBE=s,t.writeUIntBE=l,t.readIntBE=u,t.writeIntBE=c},function(e,t,n){var r=n(65);e.exports=function(e,t){if(null==e)return{};var n,i,a=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){(function(r){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(120)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(30))},function(e,t,n){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var r=n(118),i=n(102),a=n(103);function o(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function A(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function f(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(e).length;default:if(r)return P(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){var a,o=1,A=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,A/=2,s/=2,n/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=n;aA&&(n=A-s),a=n;a>=0;a--){for(var c=!0,d=0;di&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+c<=n)switch(c){case 1:l<128&&(u=l);break;case 2:128==(192&(a=e[i+1]))&&(s=(31&l)<<6|63&a)>127&&(u=s);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(s=(15&l)<<12|(63&a)<<6|63&o)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:a=e[i+1],o=e[i+2],A=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&A)&&(s=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&A)>65535&&s<1114112&&(u=s)}null===u?(u=65533,c=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=c}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},s.prototype.compare=function(e,t,n,r,i){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),A=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n),c=0;ci)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return v(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,a){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function _(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function D(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,a){return a||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,a){return a||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}s.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUInt8=function(e,t){return t||U(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||U(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||U(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||U(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||U(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},s.prototype.readInt8=function(e,t){return t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||U(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||U(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||U(e,4,this.length),i.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||U(e,4,this.length),i.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||U(e,8,this.length),i.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||U(e,8,this.length),i.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=0,o=1,A=0;for(this[t]=255&e;++a>0)-A&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=n-1,o=1,A=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===A&&0!==this[t+a+1]&&(A=1),this[t+a]=(e/o>>0)-A&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(17))},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(o=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(a).concat([i]).join("\n")}var o;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i=0&&c.splice(t,1)}function m(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return b(t,e.attrs),p(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function E(e,t){var n,r,i,a;if(t.transform&&e.css){if(!(a="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=a}if(t.singleton){var o=u++;n=l||(l=m(t)),r=v.bind(null,n,o,!1),i=v.bind(null,n,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),p(e,t),t}(t),r=S.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=m(t),r=k.bind(null,n),i=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return h(n,t),function(e){for(var r=[],i=0;i=n)return n;i+=2}return i}for(;0!==e[i];){if(i>=n)return n;i++}return i}static trimRightNull(e){const t=e.indexOf("\0");return-1===t?e:e.substr(0,t)}static swapBytes(e){const t=e.length;r.ok(0==(1&t),"Buffer length must be even");for(let n=0;n>i;const A=8-i,s=r-A;return s<0?o>>=8-i-r:s>0&&(o<<=s,o|=a.getBitAllignedNumber(e,t,n+A,s)),o}static isBitSet(e,t,n){return 1===a.getBitAllignedNumber(e,t,n,1)}static a2hex(e){const t=[];for(let n=0,r=e.length;n0!=(e[t]&1<{const a=e.toString("binary",n,n+t.FourCcToken.len);if(!a.match(i))throw new Error("FourCC contains invalid characters: "+r.default.a2hex(a));return a},put:(t,n,r)=>{const i=e.from(r,"binary");if(4!==i.length)throw new Error("Invalid length");return i.copy(t,n)}}}).call(this,n(9).Buffer)},function(e,t,n){"use strict";function r(e,t,n=0,r=e.length){if(r%t)throw new Error("Bad buffer length.");for(let a=n;a>6*e)+a,n++;e>0;)t[n]=128|i>>6*(e-1)&63,n++,e--}}return n}n.r(t),n.d(t,"unpackString",(function(){return l})),n.d(t,"packString",(function(){return u})),n.d(t,"packStringTo",(function(){return c})),n.d(t,"packArrayTo",(function(){return d})),n.d(t,"unpackArrayTo",(function(){return h})),n.d(t,"packTo",(function(){return f})),n.d(t,"pack",(function(){return p})),n.d(t,"packArray",(function(){return g})),n.d(t,"unpackArray",(function(){return m})),n.d(t,"unpack",(function(){return b}));class o{constructor(e,t=!1,n=!1){this.bits=e,this.bytes=e<8?1:Math.ceil(e/8),this.max=Math.pow(2,e)-1,this.min=0;let r=8-(1+(e-1|7)-e);this.lastByteMask_=Math.pow(2,r>0?r:8)-1,this.unpack=this.unpackUnsigned_,t&&(this.max=Math.pow(2,e)/2-1,this.min=-this.max-1,this.unpack=this.unpackSigned_),n&&(this.overflow_=this.overflowClamp_)}pack(e,t,n=0){if(t!=t||t.constructor!=Number)throw new TypeError;t=this.overflow_(t),e[n]=255&(t<0?t+Math.pow(2,this.bits):t),n++;for(let r=2,i=this.bytes;r8&&(e[n]=Math.floor(t/Math.pow(2,8*(this.bytes-1)))&this.lastByteMask_,n++),n}unpack_(e,t=0){let n=0;for(let r=0;rthis.max||ethis.max?this.max:ethis.max&&(e-=2*this.max+2),e}}class A{constructor(e,t){this.ebits=e,this.fbits=t,this.bias=(1<this.biasP2-2*this.ebitsFbits&&(t=t<0?-1/0:1/0);let r=((t=+t)||1/t)<0||t<0?1:0;t=Math.abs(t);let i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023),a=s(t/Math.pow(2,i)*Math.pow(2,this.fbits));return t!=t?(a=Math.pow(2,this.fbits-1),i=(1<=Math.pow(2,1-this.bias)?(a/Math.pow(2,this.fbits)>=2&&(i+=1,a=1),i>this.bias?(i=(1<=0;n--){let r=e[n+t].toString(2);i+="00000000".substring(r.length)+r}let a="1"==i.charAt(0)?-1:1;i=i.substring(1);let o=parseInt(i.substring(0,this.ebits),2);return i=i.substring(this.ebits),o==r?0!==parseInt(i,2)?NaN:a*(1/0):(0===o?(o+=1,n=parseInt(i,2)):n=parseInt("1"+i,2),a*n*this.fbias*Math.pow(2,o-this.bias))}packFloatBits_(e,t,n,r,i){let a=[];a.push(n);for(let e=this.ebits;e>0;e-=1)a[e]=r%2?1:0,r=Math.floor(r/2);let o=a.length;for(let e=this.fbits;e>0;e-=1)a[o+e]=i%2?1:0,i=Math.floor(i/2);let A=a.join(""),s=this.numBytes+t-1,l=t;for(;s>=t;)e[s]=parseInt(A.substring(0,8),2),A=A.substring(8),s--,l++;return l}}function s(e){let t=Math.floor(e),n=e-t;return n<.5?t:n>.5||t%2?t+1:t}function l(e,t=0,n=e.length){return function(e,t=0,n=e.length){let r="";for(let i=t;i=0&&o<=127)r+=String.fromCharCode(o);else{let A=0;o>=194&&o<=223?A=1:o>=224&&o<=239?(A=2,224===e[i]&&(t=160),237===e[i]&&(n=159)):o>=240&&o<=244?(A=3,240===e[i]&&(t=144),244===e[i]&&(n=143)):a=!0,o&=(1<<8-A-1)-1;for(let r=0;rn)&&(a=!0),o=o<<6|63&e[i],i++;a?r+=String.fromCharCode(65533):o<=65535?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296+(o>>10&1023),56320+(1023&o)))}}return r}(e,t,n)}function u(e){let t=[];return a(e,t,0),t}function c(e,t,n=0){return a(e,t,n)}function d(e,t,n,i=0,a=!1){let o=w((t=t||{}).bits,t.fp,t.signed,a),A=Math.ceil(t.bits/8),s=0,l=i;try{for(let t=e.length;s53)throw new Error("Unsupported type: int, bits: "+e)}(e),t&&16===e?new A(5,11):t&&32==e?new A(8,23):t&&64==e?new A(11,52):new o(e,n,r)}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(t){var r=n(23); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */function i(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i=0;l--)if(u[l]!==c[l])return!1;for(l=u.length-1;l>=0;l--)if(A=u[l],!E(e[A],t[A],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function y(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function v(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&m(i,n,"Missing expected exception"+r);var a="string"==typeof r,A=!e&&i&&!n;if((!e&&o.isError(i)&&a&&y(i,n)||A)&&m(i,n,"Got unwanted exception"+r),e&&i&&n&&!y(i,n)||!e&&i)throw i}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return p(g(e.actual),128)+" "+e.operator+" "+p(g(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=f(t),a=r.indexOf("\n"+i);if(a>=0){var o=r.indexOf("\n",a+1);r=r.substring(o+1)}this.stack=r}}},o.inherits(d.AssertionError,Error),d.fail=m,d.ok=b,d.equal=function(e,t,n){e!=t&&m(e,t,n,"==",d.equal)},d.notEqual=function(e,t,n){e==t&&m(e,t,n,"!=",d.notEqual)},d.deepEqual=function(e,t,n){E(e,t,!1)||m(e,t,n,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,n){E(e,t,!0)||m(e,t,n,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,n){E(e,t,!1)&&m(e,t,n,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,n,r){E(t,n,!0)&&m(t,n,r,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,n){e!==t&&m(e,t,n,"===",d.strictEqual)},d.notStrictEqual=function(e,t,n){e===t&&m(e,t,n,"!==",d.notStrictEqual)},d.throws=function(e,t,n){v(!0,e,t,n)},d.doesNotThrow=function(e,t,n){v(!1,e,t,n)},d.ifError=function(e){if(e)throw e},d.strict=r((function e(t,n){t||m(t,!0,n,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var k=Object.keys||function(e){var t=[];for(var n in e)A.call(e,n)&&t.push(n);return t}}).call(this,n(17))},function(e,t,n){"use strict";e.exports=function(e,t,n,r,i,a,o,A){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,o,A],u=0;(s=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BasicParser=class{constructor(){this.warnings=[]}init(e,t,n){return this.metadata=e,this.tokenizer=t,this.options=n,this}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(48);class i{constructor(e,t){this.tagTypes=e,this.tagMap=t}static parseGenre(e){const t=e.trim().split(/\((.*?)\)/g).filter(e=>""!==e),n=[];for(let e of t)/^\d+$/.test(e)&&!isNaN(parseInt(e,10))&&(e=r.Genres[e]),n.push(e);return n.filter(e=>void 0!==e).join("/")}static fixPictureMimeType(e){switch(e=e.toLocaleLowerCase()){case"image/jpg":return"image/jpeg"}return e}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){e={id:e.id,value:e.value},this.postMap(e);const t=this.getCommonName(e.id);return t?{id:t,value:e.value}:null}getCommonName(e){return this.tagMap[e]}postMap(e){}}i.maxRatingScore=1,t.CommonTagMapper=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.endOfFile="End-Of-File"},function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,A,s=o(e),l=1;l1)for(var n=1;n0?this.parseExtendedHeaderData(t,e.size):this.parseId3Data(this.id3Header.size-e.size)}))}parseExtendedHeaderData(t,n){return r(this,void 0,void 0,(function*(){const r=e.alloc(t);return yield this.tokenizer.readBuffer(r,0,t),this.parseId3Data(this.id3Header.size-n)}))}parseId3Data(t){return r(this,void 0,void 0,(function*(){const n=e.alloc(t);yield this.tokenizer.readBuffer(n,0,t);for(const e of this.parseMetadata(n))if("TXXX"===e.id)for(const t of e.value.text)this.addTag(s.makeDescriptionTagName(e.id,e.value.description),t);else if("COM"===e.id)for(const t of e.value)this.addTag(s.makeDescriptionTagName(e.id,t.description),t.text);else if(Array.isArray(e.value))for(const t of e.value)this.addTag(e.id,t);else this.addTag(e.id,e.value)}))}addTag(e,t){this.metadata.addTag(this.headerType,e,t)}parseMetadata(e){let t=0;const n=[];for(;t!==e.length;){const r=s.getFrameHeaderLength(this.id3Header.version.major);if(t+r>e.length)break;const i=e.slice(t,t+=r),a=s.readFrameHeader(i,this.id3Header.version.major);if(""===a.id||"\0\0\0\0"===a.id||-1==="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a.id[0]))break;const o=e.slice(t,t+=a.length),A=s.readFrameData(o,a,this.id3Header.version.major,!this.options.skipCovers);n.push({id:a.id,value:A})}return n}}t.ID3v2Parser=s}).call(this,n(9).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6),i=n(14);!function(e){e[e.Other=0]="Other",e[e["32x32 pixels 'file icon' (PNG only)"]=1]="32x32 pixels 'file icon' (PNG only)",e[e["Other file icon"]=2]="Other file icon",e[e["Cover (front)"]=3]="Cover (front)",e[e["Cover (back)"]=4]="Cover (back)",e[e["Leaflet page"]=5]="Leaflet page",e[e["Media (e.g. label side of CD)"]=6]="Media (e.g. label side of CD)",e[e["Lead artist/lead performer/soloist"]=7]="Lead artist/lead performer/soloist",e[e["Artist/performer"]=8]="Artist/performer",e[e.Conductor=9]="Conductor",e[e["Band/Orchestra"]=10]="Band/Orchestra",e[e.Composer=11]="Composer",e[e["Lyricist/text writer"]=12]="Lyricist/text writer",e[e["Recording Location"]=13]="Recording Location",e[e["During recording"]=14]="During recording",e[e["During performance"]=15]="During performance",e[e["Movie/video screen capture"]=16]="Movie/video screen capture",e[e["A bright coloured fish"]=17]="A bright coloured fish",e[e.Illustration=18]="Illustration",e[e["Band/artist logotype"]=19]="Band/artist logotype",e[e["Publisher/Studio logotype"]=20]="Publisher/Studio logotype"}(t.AttachedPictureType||(t.AttachedPictureType={}));class a{}a.UINT32SYNCSAFE={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},a.Header={len:10,get:(e,t)=>({fileIdentifier:new r.StringType(3,"ascii").get(e,t),version:{major:r.INT8.get(e,t+3),revision:r.INT8.get(e,t+4)},flags:{raw:r.INT8.get(e,t+4),unsynchronisation:i.default.strtokBITSET.get(e,t+5,7),isExtendedHeader:i.default.strtokBITSET.get(e,t+5,6),expIndicator:i.default.strtokBITSET.get(e,t+5,5),footer:i.default.strtokBITSET.get(e,t+5,4)},size:a.UINT32SYNCSAFE.get(e,t+6)})},a.ExtendedHeader={len:10,get:(e,t)=>({size:r.UINT32_BE.get(e,t),extendedFlags:r.UINT16_BE.get(e,t+4),sizeOfPadding:r.UINT32_BE.get(e,t+6),crcDataPresent:i.default.strtokBITSET.get(e,t+4,31)})},t.ID3v2Token=a},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(9).Buffer)},function(e,t){e.exports={PRESET_VALUES:["hz60","hz170","hz310","hz600","hz1000","hz3000","hz6000","hz12000","hz14000","hz16000","preamp"],HEADER:"Winamp EQ library file v1.1"}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(12).compose;t.__esModule=!0,t.composeWithDevTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}}},function(e){e.exports=JSON.parse('{"images":{"EQ_PREAMP_LINE":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHEAAAABCAYAAADpXEERAAAAE0lEQVQoU2Pcdfruf4ZRMKRDAAD1lwNjTqcaUQAAAABJRU5ErkJggg==","EQ_GRAPH_LINE_COLORS":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAATCAYAAABRC2cZAAAAR0lEQVQYV2O4rCT9n+F9kOJ/hvfViv8ZHkzSQCE2afxneH/HEJm49Nr0PwOYWPLIAkp0PjL4z1B41uQ/Q9QGnf8MWrPEIAQANWYwvnlToNIAAAAASUVORK5CYII="},"colors":["rgb(0,0,0)","rgb(24,33,41)","rgb(239,49,16)","rgb(206,41,16)","rgb(214,90,0)","rgb(214,102,0)","rgb(214,115,0)","rgb(198,123,8)","rgb(222,165,24)","rgb(214,181,33)","rgb(189,222,41)","rgb(148,222,33)","rgb(41,206,16)","rgb(50,190,16)","rgb(57,181,16)","rgb(49,156,8)","rgb(41,148,0)","rgb(24,132,8)","rgb(255,255,255)","rgb(214,214,222)","rgb(181,189,189)","rgb(160,170,175)","rgb(148,156,165)","rgb(150,150,150)"],"playlistStyle":{"normal":"#00FF00","current":"#FFFFFF","normalbg":"#000000","selectedbg":"#0000FF","font":"Arial"}}')},function(e,t,n){"use strict";function r(e,t){if(!(this instanceof r))return new r(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||i,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function i(e,t){return et?1:0}e.exports=r,e.exports.default=r,r.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var t=this.data,n=this.compare,r=t[e];e>0;){var i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r},_down:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e];e=0)break;t[e]=A,e=a}t[e]=i}}},function(e,t,n){var r=n(75),i=n(77),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(a,r).replace(o,"")}},function(e){e.exports=JSON.parse('{"type":"Winamp EQ library file v1.1","presets":[{"name":"Classical","hz60":33,"hz170":33,"hz310":33,"hz600":33,"hz1000":33,"hz3000":33,"hz6000":20,"hz12000":20,"hz14000":20,"hz16000":16,"preamp":33},{"name":"Club","hz60":33,"hz170":33,"hz310":38,"hz600":42,"hz1000":42,"hz3000":42,"hz6000":38,"hz12000":33,"hz14000":33,"hz16000":33,"preamp":33},{"name":"Dance","hz60":48,"hz170":44,"hz310":36,"hz600":32,"hz1000":32,"hz3000":22,"hz6000":20,"hz12000":20,"hz14000":32,"hz16000":32,"preamp":33},{"name":"Laptop speakers/headphones","hz60":40,"hz170":50,"hz310":41,"hz600":26,"hz1000":28,"hz3000":35,"hz6000":40,"hz12000":48,"hz14000":53,"hz16000":56,"preamp":33},{"name":"Large hall","hz60":49,"hz170":49,"hz310":42,"hz600":42,"hz1000":33,"hz3000":24,"hz6000":24,"hz12000":24,"hz14000":33,"hz16000":33,"preamp":33},{"name":"Party","hz60":44,"hz170":44,"hz310":33,"hz600":33,"hz1000":33,"hz3000":33,"hz6000":33,"hz12000":33,"hz14000":44,"hz16000":44,"preamp":33},{"name":"Pop","hz60":29,"hz170":40,"hz310":44,"hz600":45,"hz1000":41,"hz3000":30,"hz6000":28,"hz12000":28,"hz14000":29,"hz16000":29,"preamp":33},{"name":"Reggae","hz60":33,"hz170":33,"hz310":31,"hz600":22,"hz1000":33,"hz3000":43,"hz6000":43,"hz12000":33,"hz14000":33,"hz16000":33,"preamp":33},{"name":"Rock","hz60":45,"hz170":40,"hz310":23,"hz600":19,"hz1000":26,"hz3000":39,"hz6000":47,"hz12000":50,"hz14000":50,"hz16000":50,"preamp":33},{"name":"Soft","hz60":40,"hz170":35,"hz310":30,"hz600":28,"hz1000":30,"hz3000":39,"hz6000":46,"hz12000":48,"hz14000":50,"hz16000":52,"preamp":33},{"name":"Ska","hz60":28,"hz170":24,"hz310":25,"hz600":31,"hz1000":39,"hz3000":42,"hz6000":47,"hz12000":48,"hz14000":50,"hz16000":48,"preamp":33},{"name":"Full Bass","hz60":48,"hz170":48,"hz310":48,"hz600":42,"hz1000":35,"hz3000":25,"hz6000":18,"hz12000":15,"hz14000":14,"hz16000":14,"preamp":33},{"name":"Soft Rock","hz60":39,"hz170":39,"hz310":36,"hz600":31,"hz1000":25,"hz3000":23,"hz6000":26,"hz12000":31,"hz14000":37,"hz16000":47,"preamp":33},{"name":"Full Treble","hz60":16,"hz170":16,"hz310":16,"hz600":25,"hz1000":37,"hz3000":50,"hz6000":58,"hz12000":58,"hz14000":58,"hz16000":60,"preamp":33},{"name":"Full Bass & Treble","hz60":44,"hz170":42,"hz310":33,"hz600":20,"hz1000":24,"hz3000":35,"hz6000":46,"hz12000":50,"hz14000":52,"hz16000":52,"preamp":33},{"name":"Live","hz60":24,"hz170":33,"hz310":39,"hz600":41,"hz1000":42,"hz3000":42,"hz6000":39,"hz12000":37,"hz14000":37,"hz16000":36,"preamp":33},{"name":"Techno","hz60":45,"hz170":42,"hz310":33,"hz600":23,"hz1000":24,"hz3000":33,"hz6000":45,"hz12000":48,"hz14000":48,"hz16000":47,"preamp":33}]}')},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;t1?e.blocksPerFrame*(e.totalFrames-1):0;return t+=e.finalFrameBlocks,t/e.sampleRate}static parseTagHeader(t,n,i){return r(this,void 0,void 0,(function*(){if(n.fileSize&&n.fileSize-n.position0?this.parseDescriptorExpansion(t):this.parseHeader();return yield this.tokenizer.readToken(new o.IgnoreType(n.forwardBytes)),d.parseTagHeader(this.metadata,this.tokenizer,this.options)}))}parseDescriptorExpansion(e){return r(this,void 0,void 0,(function*(){return yield this.tokenizer.readToken(new o.IgnoreType(e)),this.parseHeader()}))}parseHeader(){return r(this,void 0,void 0,(function*(){const e=yield this.tokenizer.readToken(u.Header);return this.metadata.setFormat("lossless",!0),this.metadata.setFormat("dataformat","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",d.calculateDuration(e)),{forwardBytes:this.ape.descriptor.seekTableBytes+this.ape.descriptor.headerDataBytes+this.ape.descriptor.apeFrameDataBytes+this.ape.descriptor.terminatingDataBytes}}))}}t.APEv2Parser=d}).call(this,n(9).Buffer)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(22),a=n(33),o=n(32),A=n(48),s=n(8),l=n(20),u=s("music-metadata:parser:ID3");class c extends l.BasicParser{constructor(){super(...arguments),this.id3parser=new o.ID3v2Parser}static startsWithID3v2Header(e){return r(this,void 0,void 0,(function*(){return"ID3"===(yield e.peekToken(a.ID3v2Token.Header)).fileIdentifier}))}parse(){return this.parseID3v2().catch(e=>{if(e.message!==i.endOfFile)throw e})}finalize(){}parseID3v2(){return r(this,void 0,void 0,(function*(){if(yield this.tryReadId3v2Headers(),u("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),yield this._parse(),this.options.skipPostHeaders&&this.metadata.hasAny())this.finalize();else{const e=new A.ID3v1Parser;yield e.init(this.metadata,this.tokenizer,this.options).parse(),this.finalize()}}))}tryReadId3v2Headers(){return r(this,void 0,void 0,(function*(){if("ID3"===(yield this.tokenizer.peekToken(a.ID3v2Token.Header)).fileIdentifier)return u("Found ID3v2 header, pos=%s",this.tokenizer.position),yield this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}))}}t.AbstractID3Parser=c},function(e,t,n){"use strict";n.r(t);var r=n(2),i=n.n(r),a=n(0),o=n(1),A=n.n(o),s=n(5),l=n.n(s),u=(n(60),A.a.createContext(null));var c=function(e){e()},d={notify:function(){}};function h(){var e=c,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var f=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=d,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=h())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=d)},e}();var p=function(e){var t=e.store,n=e.context,r=e.children,i=Object(o.useMemo)((function(){var e=new f(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),a=Object(o.useMemo)((function(){return t.getState()}),[t]);Object(o.useEffect)((function(){var e=i.subscription;return e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[i,a]);var s=n||u;return A.a.createElement(s.Provider,{value:i},r)};n(27),n(26);var g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;var m=n(12);function b(){return Object(o.useContext)(u)}function E(e){void 0===e&&(e=u);var t=e===u?b:function(){return Object(o.useContext)(e)};return function(){return t().store}}var w=E();function y(e){void 0===e&&(e=u);var t=e===u?w:E(e);return function(){return t().dispatch}}var v=y(),k=function(e,t){return e===t};function S(e){void 0===e&&(e=u);var t=e===u?b:function(){return Object(o.useContext)(e)};return function(e,n){void 0===n&&(n=k);var r=t(),i=function(e,t,n,r){var i,a=Object(o.useReducer)((function(e){return e+1}),0)[1],A=Object(o.useMemo)((function(){return new f(n,r)}),[n,r]),s=Object(o.useRef)(),l=Object(o.useRef)(),u=Object(o.useRef)(),c=Object(o.useRef)(),d=n.getState();try{i=e!==l.current||d!==u.current||s.current?e(d):c.current}catch(e){throw s.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+s.current.stack+"\n\n"),e}return g((function(){l.current=e,u.current=d,c.current=i,s.current=void 0})),g((function(){function e(){try{var e=l.current(n.getState());if(t(e,c.current))return;c.current=e}catch(e){s.current=e}a()}return A.onStateChange=e,A.trySubscribe(),e(),function(){return A.tryUnsubscribe()}}),[n,A]),i}(e,n,r.store,r.subscription);return Object(o.useDebugValue)(i),i}}var I,O=S();function T(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(i){return"function"==typeof i?i(n,r,e):t(i)}}}}I=s.unstable_batchedUpdates,c=I;var C=T();C.withExtraArgument=T;var x=C,B=n(37);var U=n(38);const M=[60,170,310,600,1e3,3e3,6e3,12e3,14e3,16e3],N="main",_="playlist",D="equalizer",L="milkdrop",j="BUFFER",R="PLAY",F="NONE",P="INITIALIZED",Q="FAILED",z="COMPLETE",V="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),G=U,K="OSCILLOSCOPE",Y="BAR",H="MILKDROP",J=[Y,K,"NONE"],q="ELAPSED",W="REMAINING",Z="PLAYING",X="STOPPED",$="PAUSED";function ee(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=n,r.src=e})}const te=e=>{if(null==e)return{minutesFirstDigit:" ",minutesSecondDigit:" ",secondsFirstDigit:" ",secondsSecondDigit:" "};const t=Math.floor(e/60),n=e%60,r=null==e?[" "," "," "," "]:[String(Math.floor(t/10)),String(Math.floor(t%10)),String(Math.floor(n/10)),String(Math.floor(n%10))],[i,a,o,A]=r;return{minutesFirstDigit:i,minutesSecondDigit:a,secondsFirstDigit:o,secondsSecondDigit:A}},ne=(e,t=!0)=>{if(null==e)return"";const{minutesFirstDigit:n,minutesSecondDigit:r,secondsFirstDigit:i,secondsSecondDigit:a}=te(e);return[t&&"0"===n?"":n,r,":",i,a].join("")},re=/^\s*\[(.+?)\]\s*$/,ie=/^\s*([^;][^=]*)\s*=\s*(.*)\s*$/,ae=e=>{let t,n;return e.split(/[\r\n]+/g).reduce((e,r)=>{if((n=r.match(ie))&&null!=t){const r=n[1].trim().toLowerCase(),i=n[2].replace(/\=.*$/g,"").trim().replace(/(^")|("$)|(^')|('$)/g,"");e[t][r]=i}else(n=r.match(re))&&(t=n[1].trim().toLowerCase(),e[t]={});return e},{})},oe=(e,t,n)=>Math.min(Math.max(e,t),n);function Ae(e){return window.btoa(Array.from(e).map(e=>String.fromCharCode(e)).join(""))}function se(e,t){const n=document.createElement("a");n.download=t,n.href=e,window.document.body.appendChild(n),n.click(),window.document.body.removeChild(n)}const le=(e,t,n)=>(n-e)/(t-e),ue=(e,t,n)=>t+Math.round(e*(n-t)),ce=(e,t)=>ue(e,0,t-1),de=(e,t,n,r)=>i=>ue(le(e,t,i),n,r),he=de(1,64,0,100),fe=de(0,100,1,64);function pe(e,t,n,r){const i=le(e,t,n);return r[ce(i,r.length)]}function ge(e){const t=[...e];let n=t.length;for(;n;){const e=Math.floor(Math.random()*n--),r=t[n];t[n]=t[e],t[e]=r}return t}function me(e,t,n){const r=new Array(e.length);let i=0;for(let a=0;a=0&&ot(e[n],n))}function we(e,t){const n={};return Object.keys(e).forEach(r=>n[r]=t(e[r],r)),n}const ye=e=>{if(0===e.length)return null;return e.map(e=>({left:e.x,top:e.y,bottom:e.y+e.height,right:e.x+e.width})).reduce((e,t)=>({left:Math.min(e.left,t.left),top:Math.min(e.top,t.top),bottom:Math.max(e.bottom,t.bottom),right:Math.max(e.right,t.right)}))};function ve(){return{width:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth),height:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)}}function ke(e){switch(e.type){case"touchstart":case"touchmove":{var t;const n=null!==(t=e.targetTouches[0])&&void 0!==t?t:e.touches[0];if(null==n)throw new Error("Unexpected touch event with zero touch targets.");return n}case"mousedown":case"mousemove":return e;default:throw new Error("Unexpected event type: "+e.type)}}function Se(e){return ke(e).clientX}function Ie(e){return ke(e).clientY}function Oe(e){const t=new WeakMap;return n=>(t.has(n)||t.set(n,e(n)),t.get(n))}function Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t{switch(t.type){case"CLICKED_TRACK":return Ce(Ce({},e),{},{selectedTracks:new Set([e.trackOrder[t.index]]),lastSelectedIndex:t.index});case"CTRL_CLICKED_TRACK":{const i=e.trackOrder[t.index],a=new Set(e.selectedTracks);return r=i,(n=a).has(r)?n.delete(r):n.add(r),Ce(Ce({},e),{},{selectedTracks:a,lastSelectedIndex:t.index})}case"SHIFT_CLICKED_TRACK":if(null==e.lastSelectedIndex)return e;const i=t.index,a=Math.min(i,e.lastSelectedIndex),o=Math.max(i,e.lastSelectedIndex),A=new Set(e.trackOrder.slice(a,o+1));return Ce(Ce({},e),{},{selectedTracks:A});case"SELECT_ALL":return Ce(Ce({},e),{},{selectedTracks:new Set(e.trackOrder)});case"SELECT_ZERO":return Ce(Ce({},e),{},{selectedTracks:new Set});case"INVERT_SELECTION":return Ce(Ce({},e),{},{selectedTracks:new Set(e.trackOrder.filter(t=>!e.selectedTracks.has(t)))});case"REMOVE_ALL_TRACKS":return Ce(Ce({},e),{},{trackOrder:[],currentTrack:null,selectedTracks:new Set,lastSelectedIndex:null});case"REMOVE_TRACKS":const s=new Set(t.ids.map(Number)),{currentTrack:l}=e;return Ce(Ce({},e),{},{trackOrder:e.trackOrder.filter(e=>!s.has(e)),currentTrack:s.has(Number(l))?null:l,selectedTracks:new Set(Array.from(e.selectedTracks).filter(e=>s.has(e))),lastSelectedIndex:null});case"REVERSE_LIST":return Ce(Ce({},e),{},{trackOrder:[...e.trackOrder].reverse(),lastSelectedIndex:null});case"RANDOMIZE_LIST":return Ce(Ce({},e),{},{trackOrder:ge(e.trackOrder)});case"SET_TRACK_ORDER":const{trackOrder:u}=t;return Ce(Ce({},e),{},{trackOrder:u});case"ADD_TRACK_FROM_URL":const c=null==t.atIndex?e.trackOrder.length:t.atIndex;return Ce(Ce({},e),{},{trackOrder:[...e.trackOrder.slice(0,c),Number(t.id),...e.trackOrder.slice(c)],lastSelectedIndex:null});case"PLAY_TRACK":case"BUFFER_TRACK":return Ce(Ce({},e),{},{currentTrack:t.id});case"DRAG_SELECTED":return Ce(Ce({},e),{},{trackOrder:me(e.trackOrder,t=>e.selectedTracks.has(e.trackOrder[t]),t.offset),lastSelectedIndex:null});default:return e}var n,r},Ue=n(7),Me=n.n(Ue);function Ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t({size:e.size,open:e.open,hidden:!1,shade:e.shade||!1,position:e.position})),focused:e.focused}}var je=(e=De,t)=>{switch(t.type){case"ENABLE_MILKDROP":return _e(_e({},e),{},{genWindows:_e(_e({},e.genWindows),{},{[L]:{title:"Milkdrop",size:[0,0],open:t.open,shade:!1,canResize:!0,canShade:!1,canDouble:!1,position:{x:0,y:0}}})});case"SET_FOCUSED_WINDOW":let n=e.windowOrder;return null!=t.window&&(n=[...e.windowOrder.filter(e=>e!==t.window),t.window]),_e(_e({},e),{},{focused:t.window,windowOrder:n});case"TOGGLE_WINDOW_SHADE_MODE":const{canShade:r}=e.genWindows[t.windowId];if(!r)throw new Error("Tried to shade/unshade a window that cannot be shaded: "+t.windowId);return _e(_e({},e),{},{genWindows:_e(_e({},e.genWindows),{},{[t.windowId]:_e(_e({},e.genWindows[t.windowId]),{},{shade:!e.genWindows[t.windowId].shade})})});case"TOGGLE_WINDOW":const i=e.genWindows[t.windowId];return _e(_e({},e),{},{genWindows:_e(_e({},e.genWindows),{},{[t.windowId]:_e(_e({},i),{},{open:!i.open})})});case"CLOSE_WINDOW":return _e(_e({},e),{},{genWindows:_e(_e({},e.genWindows),{},{[t.windowId]:_e(_e({},e.genWindows[t.windowId]),{},{open:!1})})});case"WINDOW_SIZE_CHANGED":const{canResize:a}=e.genWindows[t.windowId];if(!a)throw new Error("Tried to resize a window that cannot be resized: "+t.windowId);return _e(_e({},e),{},{genWindows:_e(_e({},e.genWindows),{},{[t.windowId]:_e(_e({},e.genWindows[t.windowId]),{},{size:t.size})})});case"UPDATE_WINDOW_POSITIONS":return _e(_e({},e),{},{positionsAreRelative:!0!==t.absolute&&e.positionsAreRelative,genWindows:we(e.genWindows,(e,n)=>{const r=t.positions[n];return null==r?e:_e(_e({},e),{},{position:r})})});case"RESET_WINDOW_SIZES":return _e(_e({},e),{},{genWindows:we(e.genWindows,e=>_e(_e({},e),{},{size:[0,0]}))});case"LOAD_SERIALIZED_STATE":{const{genWindows:n,focused:r,positionsAreRelative:i}=t.serializedState.windows;return _e(_e({},e),{},{positionsAreRelative:i,genWindows:we(e.genWindows,(e,t)=>{const r=n[t];if(null==r)return e;const{hidden:i}=r,a=Me()(r,["hidden"]);return _e(_e({},e),a)}),focused:r})}case"BROWSER_WINDOW_SIZE_CHANGED":return _e(_e({},e),{},{browserWindowSize:{height:t.height,width:t.width}});default:return e}};function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t{switch(t.type){case"PLAY":case"IS_PLAYING":return Fe(Fe({},e),{},{status:Z});case"PAUSE":return Fe(Fe({},e),{},{status:$});case"STOP":case"IS_STOPPED":return Fe(Fe({},e),{},{status:X});case"TOGGLE_TIME_MODE":const n=e.timeMode===W?q:W;return Fe(Fe({},e),{},{timeMode:n});case"UPDATE_TIME_ELAPSED":return Fe(Fe({},e),{},{timeElapsed:t.elapsed});case"SET_MEDIA":return Fe({},e);case"SET_VOLUME":return Fe(Fe({},e),{},{volume:t.volume});case"SET_BALANCE":return Fe(Fe({},e),{},{balance:t.balance});case"TOGGLE_REPEAT":return Fe(Fe({},e),{},{repeat:!e.repeat});case"TOGGLE_SHUFFLE":return Fe(Fe({},e),{},{shuffle:!e.shuffle});case"LOAD_SERIALIZED_STATE":return Fe(Fe({},e),t.serializedState.media);default:return e}},Ve=n(3);function Ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ke(e){for(var t=1;t{switch(t.type){case"LOAD_DEFAULT_SKIN":{const{skinImages:t,skinColors:n,skinCursors:r,skinPlaylistStyle:i,skinRegion:a,skinGenLetterWidths:o,skinGenExColors:A}=He;return Ke(Ke({},e),{},{skinImages:t,skinColors:n,skinCursors:r,skinPlaylistStyle:i,skinRegion:a,skinGenLetterWidths:o,skinGenExColors:A})}case"TOGGLE_DOUBLESIZE_MODE":return Ke(Ke({},e),{},{doubled:!e.doubled});case"TOGGLE_LLAMA_MODE":return Ke(Ke({},e),{},{llama:!e.llama});case"STEP_MARQUEE":return e.disableMarquee?e:Ke(Ke({},e),{},{marqueeStep:e.marqueeStep+1});case"DISABLE_MARQUEE":return Ke(Ke({},e),{},{disableMarquee:!0});case"STOP_WORKING":return Ke(Ke({},e),{},{working:!1});case"START_WORKING":return Ke(Ke({},e),{},{working:!0});case"CLOSE_WINAMP":return Ke(Ke({},e),{},{closed:!0});case"OPEN_WINAMP":return Ke(Ke({},e),{},{closed:!1});case"LOADING":return Ke(Ke({},e),{},{loading:!0});case"LOADED":return Ke(Ke({},e),{},{loading:!1});case"SET_SKIN_DATA":const{data:n}=t;return Ke(Ke({},e),{},{loading:!1,skinImages:n.skinImages,skinColors:n.skinColors,skinPlaylistStyle:n.skinPlaylistStyle,skinCursors:n.skinCursors,skinRegion:n.skinRegion,skinGenLetterWidths:n.skinGenLetterWidths,skinGenExColors:n.skinGenExColors||Ye});case"TOGGLE_VISUALIZER_STYLE":return Ke(Ke({},e),{},{visualizerStyle:(e.visualizerStyle+1)%J.length});case"SET_PLAYLIST_SCROLL_POSITION":return Ke(Ke({},e),{},{playlistScrollPosition:t.position});case"SET_Z_INDEX":return Ke(Ke({},e),{},{zIndex:t.zIndex});case"SET_DUMMY_VIZ_DATA":return Ke(Ke({},e),{},{dummyVizData:t.data});case"LOAD_SERIALIZED_STATE":{const n=t.serializedState.display,{skinCursors:r}=n,i=Me()(n,["skinCursors"]),a=e=>({type:"cur",url:e}),o=null==r?null:we(r,a);return Ke(Ke({},e),{},{skinCursors:o},i)}default:return e}};const qe=e=>{const{visualizerStyle:t,doubled:n,llama:r,marqueeStep:i,skinImages:a,skinCursors:o,skinRegion:A,skinGenLetterWidths:s,skinColors:l,skinPlaylistStyle:u}=e;let c=null;return null!=o&&(c=we(o,e=>"cur"===e.type?e.url:void 0)),{visualizerStyle:t,doubled:n,llama:r,marqueeStep:i,skinImages:a,skinCursors:c,skinRegion:A,skinGenLetterWidths:s,skinColors:l,skinPlaylistStyle:u}},We=Object(Ve.createSelector)(e=>e.visualizerStyle,e=>J[e]);function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xe(e){for(var t=1;t{switch(t.type){case"SET_FOCUS":return Xe(Xe({},e),{},{focus:t.input,bandFocused:null});case"SET_BAND_FOCUS":return Xe(Xe({},e),{},{focus:t.input,bandFocused:t.bandFocused});case"UNSET_FOCUS":return Xe(Xe({},e),{},{focus:null,bandFocused:null});case"SET_SCRUB_POSITION":return Xe(Xe({},e),{},{scrubPosition:t.position});case"SET_USER_MESSAGE":return Xe(Xe({},e),{},{userMessage:t.message});case"UNSET_USER_MESSAGE":return Xe(Xe({},e),{},{userMessage:null});default:return e}};function tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nt(e){for(var t=1;t{switch(t.type){case"SET_BAND_VALUE":const n=nt(nt({},e.sliders),{},{[t.band]:t.value});return nt(nt({},e),{},{sliders:n});case"SET_EQ_ON":return nt(nt({},e),{},{on:!0});case"SET_EQ_OFF":return nt(nt({},e),{},{on:!1});case"SET_EQ_AUTO":return nt(nt({},e),{},{auto:t.value});case"LOAD_SERIALIZED_STATE":return t.serializedState.equalizer||e;default:return e}};function at(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ot(e){for(var t=1;t{switch(t.type){case"NETWORK_CONNECTED":return ot(ot({},e),{},{connected:!0});case"NETWORK_DISCONNECTED":return ot(ot({},e),{},{connected:!1});default:return e}};function st(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t{switch(t.type){case"SET_AVAILABLE_SKINS":return lt(lt({},e),{},{availableSkins:t.skins});default:return e}},dt=n(19),ht=n.n(dt);async function ft(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=n,r.readAsText(e)})}async function pt({accept:e,directory:t=!1}={accept:null,directory:!1}){return new Promise(n=>{const r=document.createElement("input");e&&r.setAttribute("accept",e),r.type="file",r.multiple=!0,r.webkitdirectory=t,r.directory=t,r.mozdirectory=t,r.value=null,r.addEventListener("change",e=>{const t=e.target.files;n(t)}),r.click()})}function gt(e){return"data:image/x-win-bitmap;base64,"+Ae(e)}function mt(e){if(function(e){return/^blob:/.test(e)}(e))return null;const t=e.split("/").pop();return null==t?null:t.split("#")[0].split("?")[0]}const bt=Oe(e=>{const{artist:t,title:n,defaultName:r,url:i}=e;if(t&&n)return`${t} - ${n}`;if(n)return n;if(r)return r;if(i){const e=mt(i);if(e)return e}return"???"});Oe(e=>{if(e.url){const t=mt(e.url);if(null!=t)return t}return e.defaultName?e.defaultName:"???"});function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t{var n;switch(t.type){case"ADD_TRACK_FROM_URL":return wt(wt({},e),{},{[t.id]:{id:t.id,defaultName:t.defaultName||null,duration:null!==(n=t.duration)&&void 0!==n?n:null,url:t.url,mediaTagsRequestStatus:P}});case"SET_MEDIA":{const n=wt(wt({},e[t.id]),{},{duration:t.length});return wt(wt({},e),{},{[t.id]:n})}case"MEDIA_TAG_REQUEST_INITIALIZED":return wt(wt({},e),{},{[t.id]:wt(wt({},e[t.id]),{},{mediaTagsRequestStatus:P})});case"MEDIA_TAG_REQUEST_FAILED":return wt(wt({},e),{},{[t.id]:wt(wt({},e[t.id]),{},{mediaTagsRequestStatus:Q})});case"SET_MEDIA_DURATION":return wt(wt({},e),{},{[t.id]:wt(wt({},e[t.id]),{},{duration:t.duration})});case"SET_MEDIA_TAGS":const r=e[t.id],{sampleRate:i,bitrate:a,numberOfChannels:o,title:A,artist:s,album:l,albumArtUrl:u}=t,{kbps:c,khz:d,channels:h}=r;return wt(wt({},e),{},{[t.id]:wt(wt({},r),{},{mediaTagsRequestStatus:z,title:A,artist:s,album:l,albumArtUrl:u,kbps:null!=a?String(Math.round(a/1e3)):c,khz:null!=i?String(Math.round(i/1e3)):d,channels:null!=o?o:h})});default:return e}};let kt;function St(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function It(e){for(var t=1;t{switch(t.type){case"SET_MILKDROP_DESKTOP":return It(It({},e),{},{display:t.enabled?"DESKTOP":"WINDOW"});case"SET_MILKDROP_FULLSCREEN":return It(It({},e),{},{display:t.enabled?"FULLSCREEN":"WINDOW"});case"GOT_BUTTERCHURN":return It(It({},e),{},{butterchurn:t.butterchurn});case"GOT_BUTTERCHURN_PRESETS":return It(It({},e),{},{presets:e.presets.concat(t.presets)});case"PRESET_REQUESTED":return t.addToHistory?It(It({},e),{},{presetHistory:[...e.presetHistory,t.index]}):It(It({},e),{},{presetHistory:e.presetHistory.slice(0,-1)});case"RESOLVE_PRESET_AT_INDEX":const a=e.presets[t.index];return It(It({},e),{},{presets:(n=e.presets,r=t.index,i={type:"RESOLVED",name:a.name,preset:t.json},[...n.slice(0,r),i,...n.slice(r+1)])});case"SELECT_PRESET_AT_INDEX":return It(It({},e),{},{currentPresetIndex:t.index,transitionType:t.transitionType});case"TOGGLE_PRESET_OVERLAY":return It(It({},e),{},{overlay:!e.overlay});case"TOGGLE_RANDOMIZE_PRESETS":return It(It({},e),{},{randomize:!e.randomize});case"TOGGLE_PRESET_CYCLING":return It(It({},e),{},{cycling:!e.cycling});case"SCHEDULE_MILKDROP_MESSAGE":return It(It({},e),{},{message:{text:t.message,time:Date.now()}});default:return e}var n,r,i};var Ct=Object(m.combineReducers)({userInput:et,windows:je,display:Je,settings:ct,equalizer:it,playlist:Be,media:ze,network:At,tracks:vt,milkdrop:Tt});function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;tObject(a.jsx)("body",Bt({},e)),Nt=e=>Object(a.jsx)("font",Bt({},e)),_t=e=>Object(a.jsx)("hr",Bt({},e)),Dt=e=>Object(a.jsx)("div",Bt({},e)),Lt=e=>Object(a.jsx)("table",Bt({},e)),jt=e=>Object(a.jsxs)("html",{children:[Object(a.jsxs)("head",{children:[Object(a.jsx)("link",{rel:"stylesheet",href:"null"}),Object(a.jsx)("style",{type:"text/css",children:'\n body { background: #000040; }\n .para1 { margin-top: -42px; margin-left: 145px; margin-right: 10px; font-family: "font2, Arial"; font-size: 30px; line-height: 35px; text-align: left; color: #E1E1E1; }\n .para2 { margin-top: 15px; margin-left: 15px; margin-right: 50px; font-family: "font1, Arial Black"; font-size: 50px; line-height: 40px; text-align: left; color: #004080; }\n '}),Object(a.jsx)("title",{children:"Winamp Generated PlayList"})]}),Object(a.jsxs)(Mt,{bgcolor:"#000080",topmargin:"0",leftmargin:"0",text:"#FFFFFF",children:[Object(a.jsxs)(Dt,{align:"center",children:[Object(a.jsx)(Dt,{className:"para2",align:"center",children:Object(a.jsx)("p",{children:"WINAMP"})}),Object(a.jsx)(Dt,{className:"para1",align:"center",children:Object(a.jsx)("p",{children:"playlist"})})]}),Object(a.jsx)(_t,{align:"left",width:"90%",size:"1",color:"#FFBF00",style:Ut}),Object(a.jsx)(Dt,{align:"right",children:Object(a.jsx)(Lt,{border:"0",cellSpacing:"0",cellPadding:"0",width:"98%",children:Object(a.jsx)("tbody",{children:Object(a.jsx)("tr",{children:Object(a.jsxs)("td",{children:[Object(a.jsx)("small",{children:Object(a.jsxs)("small",{children:[Object(a.jsx)(Nt,{face:"Arial",color:"#FFBF00",children:e.numberOfTracks}),Object(a.jsx)(Nt,{color:"#409FFF",face:"Arial",children:" track in playlist, average track length: "}),Object(a.jsx)(Nt,{face:"Arial",color:"#FFBF00",children:e.averageTrackLength})]})}),Object(a.jsx)("br",{}),Object(a.jsx)("small",{children:Object(a.jsxs)("small",{children:[Object(a.jsx)(Nt,{color:"#409FFF",face:"Arial",children:"Playlist length: "}),Object(a.jsx)(Nt,{face:"Arial",color:"#FFBF00",children:e.playlistLengthMinutes}),Object(a.jsx)(Nt,{color:"#409FFF",face:"Arial",children:" minutes "}),Object(a.jsx)(Nt,{face:"Arial",color:"#FFBF00",children:e.playlistLengthSeconds}),Object(a.jsx)(Nt,{color:"#409FFF",face:"Arial",children:" second "}),Object(a.jsx)("br",{}),Object(a.jsxs)(Nt,{color:"#409FFF",face:"Arial",children:["Right-click ",Object(a.jsx)("a",{href:"./",children:"here"})," to save this HTML file."]})]})})]})})})})}),Object(a.jsxs)("blockquote",{children:[Object(a.jsx)("p",{children:Object(a.jsx)(Nt,{color:"#FFBF00",face:"Arial",children:Object(a.jsx)("big",{children:"Playlist files:"})})}),Object(a.jsx)("ul",{children:Object(a.jsx)(Nt,{face:"Arial",color:"#FFFFFF",children:Object(a.jsx)("small",{children:e.tracks.map(e=>Object(a.jsxs)("span",{children:[e,Object(a.jsx)("br",{})]},e))})})})]}),Object(a.jsx)(_t,{align:"left",width:"90%",size:"1",color:"#FFBF00",style:Ut})]})]}),Rt=e=>{return t=(e=>{const t=document.createElement("div");return Object(s.render)(Object(a.jsx)(jt,Bt({},e)),t),t.innerHTML})(e),"data:text/html;base64,"+window.btoa(t);var t},Ft=(e,t)=>{const n=(r=(t-50)/50*12,(Math.round(10*r)/10).toFixed(1));var r;var i;return`EQ: ${"preamp"===e?"Preamp":(i=e)<1e3?i+"HZ":i/1e3+"KHZ"} ${(e=>e>0?"+"+e:e.toString())(n)} DB`};function Pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;te.equalizer.sliders,Vt=Object(Ve.createSelector)(zt,e=>{const t={name:"Entry1",preamp:fe(e.preamp)};return M.forEach(n=>{t["hz"+n]=fe(e[n])}),{presets:[t],type:"Winamp EQ library file v1.1"}}),Gt=e=>e.tracks,Kt=e=>t=>{var n;return null===(n=e.tracks[t])||void 0===n?void 0:n.url},Yt=e=>e.playlist.trackOrder,Ht=Object(Ve.createSelector)(Yt,e=>e.length),Jt=Object(Ve.createSelector)(Gt,Yt,(e,t)=>t.filter(t=>e[t])),qt=Object(Ve.createSelector)(Gt,Yt,(e,t)=>t.map(t=>{const n=e[t];return{url:n.url,metaData:{artist:n.artist||"",title:n.title||"",album:n.album,albumArtUrl:n.albumArtUrl||""}}})),Wt=Object(Ve.createSelector)(Gt,Jt,(e,t)=>t.map(t=>e[t])),Zt=e=>e.playlist.selectedTracks,Xt=Object(Ve.createSelector)(Wt,Zt,(e,t)=>e.filter(e=>t.has(e.id))),$t=e=>e.reduce((e,t)=>e+Number(t.duration),0),en=Object(Ve.createSelector)(Wt,$t),tn=Object(Ve.createSelector)(Xt,$t),nn=Object(Ve.createSelector)(en,tn,(e,t)=>`${ne(t)}/${ne(e)}`),rn=e=>{const{playlist:t}=e;return null==t.currentTrack?-1:t.trackOrder.indexOf(t.currentTrack)},an=Object(Ve.createSelector)(rn,e=>e+1),on=e=>e.playlist.currentTrack,An=(e,t=1)=>{const{playlist:{trackOrder:n},media:{repeat:r,shuffle:i}}=e;if(i)return(e=>{const{playlist:{trackOrder:t,currentTrack:n}}=e;if(0===t.length)return null;let r;do{r=t[Math.floor(t.length*Math.random())]}while(r===n&&t.length>1);return r})(e);const a=Ht(e);if(0===a)return null;const o=rn(e);let A=o+t;return r?(A%=a,A<0&&(A+=a),n[A]):o===a-1&&t>0||0===o&&t<0?null:(A=oe(A,0,a-1),n[A])},sn=e=>e.windows.genWindows,ln=Object(Ve.createSelector)(sn,e=>t=>e[t].open),un=Object(Ve.createSelector)((function(e){return"WINDOW"===e.milkdrop.display}),e=>t=>t===L&&!e),cn=Object(Ve.createSelector)(sn,e=>t=>e[t].shade),dn=Object(Ve.createSelector)(sn,e=>t=>e[t].size),hn=Object(Ve.createSelector)(sn,e=>we(e,e=>e.position)),fn=Object(Ve.createSelector)(dn,e=>{const t=e("playlist");return Math.floor((58+29*t[1])/13)}),pn=Object(Ve.createSelector)(Ht,fn,(e,t)=>Math.max(0,e-t)),gn=e=>e.display.playlistScrollPosition,mn=Object(Ve.createSelector)(pn,gn,(e,t)=>0===e?0:Math.round(Math.round(e*t/100)/e*100)),bn=Object(Ve.createSelector)(gn,Ht,fn,(e,t,n)=>{const r=Math.max(0,t-n);return ce(e/100,r+1)}),En=Object(Ve.createSelector)(bn,Yt,fn,(e,t,n)=>t.slice(e,e+n));function wn(e){return En(e).length===e.playlist.trackOrder.length}const yn=Object(Ve.createSelector)(En,e=>t=>e.includes(t)),vn=(Object(Ve.createSelector)(En,Gt,(e,t)=>e.map(e=>t[e])),e=>{const{playlist:t,tracks:n}=e;if(null==t.currentTrack)return null;const r=n[t.currentTrack];return r&&r.duration}),kn=Object(Ve.createSelector)(Gt,e=>Object(Ve.defaultMemoize)(t=>((e,t=null)=>{if(null==t)return null;const n=e[t];return null==n?null:bt(n)})(e,t))),Sn=Object(Ve.createSelector)(on,kn,(e,t)=>t(e)),In=e=>e.media.status,On=e=>e.media.status===Z,Tn=Object(Ve.createSelector)(on,Gt,(e,t)=>null==e?null:t[e]),Cn=Object(Ve.createSelector)(On,Tn,(e,t)=>e&&t&&t.mediaTagsRequestStatus!==P?t.id:null),xn=Object(Ve.createSelector)(Tn,e=>null==e?null:{url:e.url,metaData:{title:e.title||null,artist:e.artist||null,album:e.album||null,albumArtUrl:e.albumArtUrl||null}}),Bn=Object(Ve.createSelector)(an,Sn,(e,t)=>null==t?null:`${e}. ${t}`),Un=Object(Ve.createSelector)(Bn,vn,(e,t)=>null==e?null:`${e} (${ne(t)})`),Mn=e=>Yt(e).length,Nn=Object(Ve.createSelector)(Gt,e=>Object.values(e).reduce((e,t)=>e+(t.duration||0),0)),_n=Object(Ve.createSelector)(Mn,Nn,Yt,Gt,kn,(e,t,n,r,i)=>Rt({numberOfTracks:e,averageTrackLength:ne(t/e),playlistLengthMinutes:Math.floor(t/60),playlistLengthSeconds:Math.floor(t%60),tracks:n.map((e,t)=>`${t+1}. ${i(e)} (${ne(r[e].duration)})`)}));function Dn(e,t){const[n,r]=e.size,i=t&&e.canDouble?2:1,a=116+29*r,o=275+25*n;return{height:(e.shade?14:a)*i,width:o*i}}function Ln(e){return e.windows.focused}function jn(e){return e.display.doubled}function Rn(e){return e.display.llama}function Fn(e){return e.display.zIndex}const Pn=Object(Ve.createSelector)(sn,jn,(e,t)=>we(e,e=>Dn(e,t))),Qn=Object(Ve.createSelector)(Pn,e=>t=>e[t]),zn=Object(Ve.createSelector)(e=>e.windows.windowOrder,sn,(e,t)=>[N,...e.filter(e=>e!==N&&null!=t[e])]),Vn=Object(Ve.createSelector)(Pn,hn,zn,(e,t,n)=>n.map(n=>Qt(Qt({key:n},e[n]),t[n]))),Gn=Object(Ve.createSelector)(Vn,(function(e){const t={},n={};for(const r of e){const e=r.y+r.height;t[e]?t[e].push(r):t[e]=[r];const i=r.x+r.width;n[i]?n[i].push(r):n[i]=[r]}const r={};for(const i of e){const e={},a=i.y,o=i.x,A=t[a],s=n[o];if(A)for(const t of A){const n=t.x+t.widthi.x+i.width;if(!(n||r)){e.below=t.key;break}}if(s)for(const t of s){const n=t.y+t.heighti.y+i.height;if(!(n||r)){e.right=t.key;break}}r[i.key]=e}return r})),Kn={normal:"#00FF00",current:"#FFFFFF",normalbg:"#000000",selectedbg:"#0000C6",font:"Arial"};function Yn(e){return e.display.skinColors}const Hn=e=>e.display.skinPlaylistStyle||Kn,Jn=e=>{const t=e.windows.genWindows[L];return null!=t&&t.open?H:We(e.display)},qn=e=>e.media.volume,Wn=e=>e.media.balance,Zn=e=>e.media.shuffle,Xn=e=>e.media.repeat,$n=Object(Ve.createSelector)(Tn,e=>null!=e&&e.channels||null),er=e=>e.media.timeElapsed;function tr(e){return e.equalizer.on}function nr(e){return e.windows.browserWindowSize}const rr=Object(Ve.createSelector)(sn,e=>{return t=e,n=e=>e.open,Object.keys(t).reduce((e,r)=>(n(t[r],r)&&(e[r]=t[r]),e),{});var t,n}),ir=Object(Ve.createSelector)(rr,jn,(e,t)=>{let n=0;return we(e,e=>{const r={x:0,y:n};return n+=Dn(e,t).height,r})}),ar=e=>e.userInput.focus,or=e=>e.userInput.scrubPosition,Ar=e=>{if(null!=e.userInput.userMessage)return e.userInput.userMessage;switch(ar(e)){case"balance":return(e=>{if(0===e)return"Balance: Center";const t=e>0?"Right":"Left";return`Balance: ${Math.abs(e)}% ${t}`})(e.media.balance);case"volume":return`Volume: ${e.media.volume}%`;case"position":const t=vn(e);return null==t?"Winamp 2.91":((e,t)=>`Seek to: ${ne(e*t/100,!1)}/${ne(e,!1)} (${t}%)`)(t,or(e));case"double":return(e.display.doubled?"Disable":"Enable")+" doublesize mode";case"eq":const n=e.userInput.bandFocused;return null==n?"Winamp 2.91":Ft(n,e.equalizer.sliders[n])}if(null!=e.playlist.currentTrack){const t=Un(e);return null==t?"Winamp 2.91":t}return"Winamp 2.91"},sr=Object(Ve.createSelector)(Tn,e=>null!=e&&e.kbps||null),lr=Object(Ve.createSelector)(Tn,e=>null!=e&&e.khz||null);function ur(e){return e.milkdrop.message}function cr(e){return"DESKTOP"===e.milkdrop.display}function dr(e){return"FULLSCREEN"===e.milkdrop.display}function hr(e){return e.milkdrop.butterchurn}function fr(e){return e.milkdrop.transitionType}function pr(e){return e.milkdrop.currentPresetIndex}function gr(e){const t=pr(e);if(null==t)return null;const n=e.milkdrop.presets[t];return null==n||"UNRESOLVED"===n.type?null:n.preset}function mr(e){return e.milkdrop.presets.map(e=>e.name)}function br(e){return e.milkdrop.overlay}function Er(e){return e.milkdrop.cycling}function wr(e){return e.milkdrop.randomize}function yr(e){return e.display.closed}function vr(e){return e.display.skinRegion}const kr=Object(Ve.createSelector)((function(e){return e.display.skinImages.EQ_PREAMP_LINE}),async e=>null==e?null:ee(e)),Sr=Object(Ve.createSelector)((function(e){return e.display.skinImages.EQ_GRAPH_LINE_COLORS}),async e=>null==e?null:ee(e));function Ir(e){return e.display.dummyVizData}function Or(e){return e.display.marqueeStep}function Tr(e){return e.network.connected}function Cr(e){return e.media.timeMode}function xr(e){return e.display.loading}function Br(e){return e.display.working}function Ur(e){return e.settings.availableSkins}const Mr=e=>e.y,Nr=e=>e.y+e.height,_r=e=>e.x,Dr=e=>e.x+e.width,Lr=(e,t)=>Math.abs(e-t)<15,jr=(e,t)=>{let n,r;var i,a;return a=t,Mr(i=e)<=Nr(a)+15&&Mr(a)<=Nr(i)+15&&(Lr(_r(e),Dr(t))?n=Dr(t):Lr(Dr(e),_r(t))?n=_r(t)-e.width:Lr(_r(e),_r(t))?n=_r(t):Lr(Dr(e),Dr(t))&&(n=Dr(t)-e.width)),((e,t)=>_r(e)<=Dr(t)+15&&_r(t)<=Dr(e)+15)(e,t)&&(Lr(Mr(e),Nr(t))?r=Nr(t):Lr(Nr(e),Mr(t))?r=Mr(t)-e.height:Lr(Mr(e),Mr(t))?r=Mr(t):Lr(Nr(e),Nr(t))&&(r=Nr(t)-e.height)),{x:n,y:r}},Rr=(e,t)=>{const n=jr(e,t);return{x:void 0===n.x?0:n.x-e.x,y:void 0===n.y?0:n.y-e.y}};const Fr=(e,t)=>({x:e.x+t.x,y:e.y+t.y});function Pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qr(e){for(var t=1;t{const r=n(),i=Gn(r),a=Pn(r);t(e);const o=Pn(n()),A={};for(const e of Object.keys(o)){const t=a[e],n=o[e];A[e]={height:n.height-t.height,width:n.width-t.width}}const s=function(e,t){const n={},r={};for(const t of Object.keys(e))n[t]={above:[],left:[]},r[t]={x:0,y:0};for(const[t,r]of Object.entries(e)){const{below:e,right:i}=r;null!=i&&n[i].left.push(t),null!=e&&n[e].above.push(t)}function i(e){const a=n[e],o=t[e];a.left.forEach(t=>{r[t].x+=o.width+r[e].x,i(t)})}function a(e){const i=n[e],o=t[e];i.above.forEach(t=>{r[t].y+=o.height+r[e].y,a(t)})}for(const[t,n]of Object.entries(e))null==n.below&&a(t),null==n.right&&i(t);return r}(i,A);t(Zr(we(hn(r),(e,t)=>Fr(e,s[t]))))}}function Vr(){return zr({type:"TOGGLE_DOUBLESIZE_MODE"})}function Gr(){return zr({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"equalizer"})}function Kr(){return zr({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"main"})}function Yr(){return zr({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"playlist"})}function Hr(e){return{type:"CLOSE_WINDOW",windowId:e}}function Jr(e){return{type:"SET_FOCUSED_WINDOW",window:e}}function qr(e,t){return{type:"WINDOW_SIZE_CHANGED",windowId:e,size:t}}function Wr(e){return{type:"TOGGLE_WINDOW",windowId:e}}function Zr(e,t){return{type:"UPDATE_WINDOW_POSITIONS",positions:e,absolute:t}}function Xr(e){return(t,n)=>{const r=n(),i=Vn(r),a=ln(r),{top:o,left:A,width:s,height:l}=e,u=A+window.scrollX,c=o+window.scrollY,d=ye(i.filter(e=>a(e.key)));if(null==d)return;const h=d.bottom-d.top,f=d.right-d.left,p=Math.ceil(u-d.left+(s-f)/2),g=Math.ceil(c-d.top+(l-h)/2);t(Zr(i.reduce((e,t)=>Qr(Qr({},e),{},{[t.key]:{x:p+t.x,y:g+t.y}}),{}),!0))}}function $r(e){return t=>{t(Qr({type:"BROWSER_WINDOW_SIZE_CHANGED"},e)),t(ti())}}function ei(){return(e,t)=>{e(Zr(ir(t())))}}function ti(){return(e,t)=>{const n=t(),r=Vn(n),i=ln(n),{height:a,width:o}=ve(),A=ye(r.filter(e=>i(e.key)));if(null==A)return;const s=hn(n);if(A.left>=0&&A.top>=0&&A.right<=o&&A.bottom<=a)return;const l=A.bottom-A.top;if(A.right-A.left<=o&&l<=a){let t=0,n=0;return A.top<=0?t=A.top:A.bottom>a&&(t=A.bottom-a),A.left<=0?n=A.left:A.right>o&&(n=A.right-o),void e(Zr(we(s,e=>({x:e.x-n,y:e.y-t}))))}e({type:"RESET_WINDOW_SIZES"}),e(ei()),e(Xr({left:window.scrollX,top:window.scrollY,width:window.innerWidth,height:window.innerHeight}))}}function ni(e){return{type:"PLAY_TRACK",id:e}}function ri(){return(e,t)=>{const n=t();n.media.status===X&&null==n.playlist.currentTrack&&0===n.playlist.trackOrder.length?e(Oa()):e({type:"PLAY"})}}function ii(){return(e,t)=>{const{status:n}=t().media;e(n===Z?{type:"PAUSE"}:{type:"PLAY"})}}function ai(){return{type:"STOP"}}function oi(e){return(t,n)=>{const r=An(n(),e);var i;null!=r?t((i=r,(e,t)=>{const n=t();e(In(n)===X?{type:"BUFFER_TRACK",id:i}:{type:"PLAY_TRACK",id:i})})):t({type:"IS_STOPPED"})}}function Ai(){return oi(1)}function si(){return oi(-1)}function li(e){return function(t,n){const r=n(),i=vn(r);null!=i&&t({type:"SEEK_TO_PERCENT_COMPLETE",percent:e/i*100})}}function ui(e){return function(t,n){t(li(er(n())+e))}}function ci(e){return ui(-e)}function di(e){return{type:"SET_VOLUME",volume:oe(e,0,100)}}function hi(e){return(t,n)=>t(di(n().media.volume+e))}function fi(e){return e.preventDefault(),(t,n)=>t(di(n().media.volume+e.deltaY))}function pi(e){return e=oe(e,-100,100),Math.abs(e)<25&&(e=0),{type:"SET_BALANCE",balance:e}}function gi(){return{type:"TOGGLE_REPEAT"}}function mi(){return{type:"TOGGLE_SHUFFLE"}}function bi(){return{type:"TOGGLE_TIME_MODE"}}function Ei(e){return e<55&&e>45?50:e}function wi(e,t){return{type:"SET_BAND_VALUE",band:e,value:Ei(t)}}function yi(e){return t=>{Object.values(M).forEach(n=>{t({type:"SET_BAND_VALUE",value:e,band:n})})}}function vi(){return yi(100)}function ki(){return yi(50)}function Si(){return yi(0)}function Ii(e){return{type:"SET_BAND_VALUE",band:"preamp",value:Ei(e)}}function Oi(){return(e,t)=>{t().equalizer.on?e({type:"SET_EQ_OFF"}):e({type:"SET_EQ_ON"})}}function Ti(){return e=>{e({type:"SET_EQ_AUTO",value:!1})}}var Ci=n(29);const xi={a:[0,0],b:[0,1],c:[0,2],d:[0,3],e:[0,4],f:[0,5],g:[0,6],h:[0,7],i:[0,8],j:[0,9],k:[0,10],l:[0,11],m:[0,12],n:[0,13],o:[0,14],p:[0,15],q:[0,16],r:[0,17],s:[0,18],t:[0,19],u:[0,20],v:[0,21],w:[0,22],x:[0,23],y:[0,24],z:[0,25],'"':[0,26],"@":[0,27]," ":[0,30],0:[1,0],1:[1,1],2:[1,2],3:[1,3],4:[1,4],5:[1,5],6:[1,6],7:[1,7],8:[1,8],9:[1,9],"…":[1,10],".":[1,11],":":[1,12],"(":[1,13],")":[1,14],"-":[1,15],"'":[1,16],"!":[1,17],_:[1,18],"+":[1,19],"\\":[1,20],"/":[1,21],"[":[1,22],"]":[1,23],"^":[1,24],"&":[1,25],"%":[1,26],",":[1,27],"=":[1,28],$:[1,29],"#":[1,30],"Å":[2,0],"Ö":[2,1],"Ä":[2,2],"?":[2,3],"*":[2,4],"<":[1,22],">":[1,23],"{":[1,22],"}":[1,23]},Bi=e=>"CHARACTER_"+e.charCodeAt(0),Ui=[];for(const e in xi)if(xi.hasOwnProperty(e)){const t=xi[e];Ui.push({name:Bi(e),y:6*t[0],x:5*t[1],width:5,height:6})}var Mi={BALANCE:[{name:"MAIN_BALANCE_BACKGROUND",x:9,y:0,width:38,height:420},{name:"MAIN_BALANCE_THUMB",x:15,y:422,width:14,height:11},{name:"MAIN_BALANCE_THUMB_ACTIVE",x:0,y:422,width:14,height:11}],CBUTTONS:[{name:"MAIN_PREVIOUS_BUTTON",x:0,y:0,width:23,height:18},{name:"MAIN_PREVIOUS_BUTTON_ACTIVE",x:0,y:18,width:23,height:18},{name:"MAIN_PLAY_BUTTON",x:23,y:0,width:23,height:18},{name:"MAIN_PLAY_BUTTON_ACTIVE",x:23,y:18,width:23,height:18},{name:"MAIN_PAUSE_BUTTON",x:46,y:0,width:23,height:18},{name:"MAIN_PAUSE_BUTTON_ACTIVE",x:46,y:18,width:23,height:18},{name:"MAIN_STOP_BUTTON",x:69,y:0,width:23,height:18},{name:"MAIN_STOP_BUTTON_ACTIVE",x:69,y:18,width:23,height:18},{name:"MAIN_NEXT_BUTTON",x:92,y:0,width:23,height:18},{name:"MAIN_NEXT_BUTTON_ACTIVE",x:92,y:18,width:22,height:18},{name:"MAIN_EJECT_BUTTON",x:114,y:0,width:22,height:16},{name:"MAIN_EJECT_BUTTON_ACTIVE",x:114,y:16,width:22,height:16}],MAIN:[{name:"MAIN_WINDOW_BACKGROUND",x:0,y:0,width:275,height:116}],MONOSTER:[{name:"MAIN_STEREO",x:0,y:12,width:29,height:12},{name:"MAIN_STEREO_SELECTED",x:0,y:0,width:29,height:12},{name:"MAIN_MONO",x:29,y:12,width:27,height:12},{name:"MAIN_MONO_SELECTED",x:29,y:0,width:27,height:12}],NUMBERS:[{name:"NO_MINUS_SIGN",x:9,y:6,width:5,height:1},{name:"MINUS_SIGN",x:20,y:6,width:5,height:1},{name:"DIGIT_0",x:0,y:0,width:9,height:13},{name:"DIGIT_1",x:9,y:0,width:9,height:13},{name:"DIGIT_2",x:18,y:0,width:9,height:13},{name:"DIGIT_3",x:27,y:0,width:9,height:13},{name:"DIGIT_4",x:36,y:0,width:9,height:13},{name:"DIGIT_5",x:45,y:0,width:9,height:13},{name:"DIGIT_6",x:54,y:0,width:9,height:13},{name:"DIGIT_7",x:63,y:0,width:9,height:13},{name:"DIGIT_8",x:72,y:0,width:9,height:13},{name:"DIGIT_9",x:81,y:0,width:9,height:13}],NUMS_EX:[{name:"NO_MINUS_SIGN_EX",x:90,y:0,width:9,height:13},{name:"MINUS_SIGN_EX",x:99,y:0,width:9,height:13},{name:"DIGIT_0_EX",x:0,y:0,width:9,height:13},{name:"DIGIT_1_EX",x:9,y:0,width:9,height:13},{name:"DIGIT_2_EX",x:18,y:0,width:9,height:13},{name:"DIGIT_3_EX",x:27,y:0,width:9,height:13},{name:"DIGIT_4_EX",x:36,y:0,width:9,height:13},{name:"DIGIT_5_EX",x:45,y:0,width:9,height:13},{name:"DIGIT_6_EX",x:54,y:0,width:9,height:13},{name:"DIGIT_7_EX",x:63,y:0,width:9,height:13},{name:"DIGIT_8_EX",x:72,y:0,width:9,height:13},{name:"DIGIT_9_EX",x:81,y:0,width:9,height:13}],PLAYPAUS:[{name:"MAIN_PLAYING_INDICATOR",x:0,y:0,width:9,height:9},{name:"MAIN_PAUSED_INDICATOR",x:9,y:0,width:9,height:9},{name:"MAIN_STOPPED_INDICATOR",x:18,y:0,width:9,height:9},{name:"MAIN_NOT_WORKING_INDICATOR",x:36,y:0,width:9,height:9},{name:"MAIN_WORKING_INDICATOR",x:39,y:0,width:9,height:9}],PLEDIT:[{name:"PLAYLIST_TOP_TILE",x:127,y:21,width:25,height:20},{name:"PLAYLIST_TOP_LEFT_CORNER",x:0,y:21,width:25,height:20},{name:"PLAYLIST_TITLE_BAR",x:26,y:21,width:100,height:20},{name:"PLAYLIST_TOP_RIGHT_CORNER",x:153,y:21,width:25,height:20},{name:"PLAYLIST_TOP_TILE_SELECTED",x:127,y:0,width:25,height:20},{name:"PLAYLIST_TOP_LEFT_SELECTED",x:0,y:0,width:25,height:20},{name:"PLAYLIST_TITLE_BAR_SELECTED",x:26,y:0,width:100,height:20},{name:"PLAYLIST_TOP_RIGHT_CORNER_SELECTED",x:153,y:0,width:25,height:20},{name:"PLAYLIST_LEFT_TILE",x:0,y:42,width:12,height:29},{name:"PLAYLIST_RIGHT_TILE",x:31,y:42,width:20,height:29},{name:"PLAYLIST_BOTTOM_TILE",x:179,y:0,width:25,height:38},{name:"PLAYLIST_BOTTOM_LEFT_CORNER",x:0,y:72,width:125,height:38},{name:"PLAYLIST_BOTTOM_RIGHT_CORNER",x:126,y:72,width:150,height:38},{name:"PLAYLIST_VISUALIZER_BACKGROUND",x:205,y:0,width:75,height:38},{name:"PLAYLIST_SHADE_BACKGROUND",x:72,y:57,width:25,height:14},{name:"PLAYLIST_SHADE_BACKGROUND_LEFT",x:72,y:42,width:25,height:14},{name:"PLAYLIST_SHADE_BACKGROUND_RIGHT",x:99,y:57,width:50,height:14},{name:"PLAYLIST_SHADE_BACKGROUND_RIGHT_SELECTED",x:99,y:42,width:50,height:14},{name:"PLAYLIST_SCROLL_HANDLE_SELECTED",x:61,y:53,width:8,height:18},{name:"PLAYLIST_SCROLL_HANDLE",x:52,y:53,width:8,height:18},{name:"PLAYLIST_ADD_URL",x:0,y:111,width:22,height:18},{name:"PLAYLIST_ADD_URL_SELECTED",x:23,y:111,width:22,height:18},{name:"PLAYLIST_ADD_DIR",x:0,y:130,width:22,height:18},{name:"PLAYLIST_ADD_DIR_SELECTED",x:23,y:130,width:22,height:18},{name:"PLAYLIST_ADD_FILE",x:0,y:149,width:22,height:18},{name:"PLAYLIST_ADD_FILE_SELECTED",x:23,y:149,width:22,height:18},{name:"PLAYLIST_REMOVE_ALL",x:54,y:111,width:22,height:18},{name:"PLAYLIST_REMOVE_ALL_SELECTED",x:77,y:111,width:22,height:18},{name:"PLAYLIST_CROP",x:54,y:130,width:22,height:18},{name:"PLAYLIST_CROP_SELECTED",x:77,y:130,width:22,height:18},{name:"PLAYLIST_REMOVE_SELECTED",x:54,y:149,width:22,height:18},{name:"PLAYLIST_REMOVE_SELECTED_SELECTED",x:77,y:149,width:22,height:18},{name:"PLAYLIST_REMOVE_MISC",x:54,y:168,width:22,height:18},{name:"PLAYLIST_REMOVE_MISC_SELECTED",x:77,y:168,width:22,height:18},{name:"PLAYLIST_INVERT_SELECTION",x:104,y:111,width:22,height:18},{name:"PLAYLIST_INVERT_SELECTION_SELECTED",x:127,y:111,width:22,height:18},{name:"PLAYLIST_SELECT_ZERO",x:104,y:130,width:22,height:18},{name:"PLAYLIST_SELECT_ZERO_SELECTED",x:127,y:130,width:22,height:18},{name:"PLAYLIST_SELECT_ALL",x:104,y:149,width:22,height:18},{name:"PLAYLIST_SELECT_ALL_SELECTED",x:127,y:149,width:22,height:18},{name:"PLAYLIST_SORT_LIST",x:154,y:111,width:22,height:18},{name:"PLAYLIST_SORT_LIST_SELECTED",x:177,y:111,width:22,height:18},{name:"PLAYLIST_FILE_INFO",x:154,y:130,width:22,height:18},{name:"PLAYLIST_FILE_INFO_SELECTED",x:177,y:130,width:22,height:18},{name:"PLAYLIST_MISC_OPTIONS",x:154,y:149,width:22,height:18},{name:"PLAYLIST_MISC_OPTIONS_SELECTED",x:177,y:149,width:22,height:18},{name:"PLAYLIST_NEW_LIST",x:204,y:111,width:22,height:18},{name:"PLAYLIST_NEW_LIST_SELECTED",x:227,y:111,width:22,height:18},{name:"PLAYLIST_SAVE_LIST",x:204,y:130,width:22,height:18},{name:"PLAYLIST_SAVE_LIST_SELECTED",x:227,y:130,width:22,height:18},{name:"PLAYLIST_LOAD_LIST",x:204,y:149,width:22,height:18},{name:"PLAYLIST_LOAD_LIST_SELECTED",x:227,y:149,width:22,height:18},{name:"PLAYLIST_ADD_MENU_BAR",x:48,y:111,width:3,height:54},{name:"PLAYLIST_REMOVE_MENU_BAR",x:100,y:111,width:3,height:72},{name:"PLAYLIST_SELECT_MENU_BAR",x:150,y:111,width:3,height:54},{name:"PLAYLIST_MISC_MENU_BAR",x:200,y:111,width:3,height:54},{name:"PLAYLIST_LIST_BAR",x:250,y:111,width:3,height:54},{name:"PLAYLIST_CLOSE_SELECTED",x:52,y:42,width:9,height:9},{name:"PLAYLIST_COLLAPSE_SELECTED",x:62,y:42,width:9,height:9},{name:"PLAYLIST_EXPAND_SELECTED",x:150,y:42,width:9,height:9}],EQ_EX:[{name:"EQ_SHADE_BACKGROUND_SELECTED",x:0,y:0,width:275,height:14},{name:"EQ_SHADE_BACKGROUND",x:0,y:15,width:275,height:14},{name:"EQ_SHADE_VOLUME_SLIDER_LEFT",x:1,y:30,width:3,height:7},{name:"EQ_SHADE_VOLUME_SLIDER_CENTER",x:4,y:30,width:3,height:7},{name:"EQ_SHADE_VOLUME_SLIDER_RIGHT",x:7,y:30,width:3,height:7},{name:"EQ_SHADE_BALANCE_SLIDER_LEFT",x:11,y:30,width:3,height:7},{name:"EQ_SHADE_BALANCE_SLIDER_CENTER",x:14,y:30,width:3,height:7},{name:"EQ_SHADE_BALANCE_SLIDER_RIGHT",x:17,y:30,width:3,height:7},{name:"EQ_MAXIMIZE_BUTTON_ACTIVE",x:1,y:38,width:9,height:9},{name:"EQ_MINIMIZE_BUTTON_ACTIVE",x:1,y:47,width:9,height:9},{name:"EQ_SHADE_CLOSE_BUTTON",x:11,y:38,width:9,height:9},{name:"EQ_SHADE_CLOSE_BUTTON_ACTIVE",x:11,y:47,width:9,height:9}],EQMAIN:[{name:"EQ_WINDOW_BACKGROUND",x:0,y:0,width:275,height:116},{name:"EQ_TITLE_BAR",x:0,y:149,width:275,height:14},{name:"EQ_TITLE_BAR_SELECTED",x:0,y:134,width:275,height:14},{name:"EQ_SLIDER_BACKGROUND",x:13,y:164,width:209,height:129},{name:"EQ_SLIDER_THUMB",x:0,y:164,width:11,height:11},{name:"EQ_SLIDER_THUMB_SELECTED",x:0,y:176,width:11,height:11},{name:"EQ_CLOSE_BUTTON",x:0,y:116,width:9,height:9},{name:"EQ_CLOSE_BUTTON_ACTIVE",x:0,y:125,width:9,height:9},{name:"EQ_MAXIMIZE_BUTTON_ACTIVE_FALLBACK",x:254,y:152,width:9,height:9},{name:"EQ_ON_BUTTON",x:10,y:119,width:26,height:12},{name:"EQ_ON_BUTTON_DEPRESSED",x:128,y:119,width:26,height:12},{name:"EQ_ON_BUTTON_SELECTED",x:69,y:119,width:26,height:12},{name:"EQ_ON_BUTTON_SELECTED_DEPRESSED",x:187,y:119,width:26,height:12},{name:"EQ_AUTO_BUTTON",x:36,y:119,width:32,height:12},{name:"EQ_AUTO_BUTTON_DEPRESSED",x:154,y:119,width:32,height:12},{name:"EQ_AUTO_BUTTON_SELECTED",x:95,y:119,width:32,height:12},{name:"EQ_AUTO_BUTTON_SELECTED_DEPRESSED",x:213,y:119,width:32,height:12},{name:"EQ_GRAPH_BACKGROUND",x:0,y:294,width:113,height:19},{name:"EQ_GRAPH_LINE_COLORS",x:115,y:294,width:1,height:19},{name:"EQ_PRESETS_BUTTON",x:224,y:164,width:44,height:12},{name:"EQ_PRESETS_BUTTON_SELECTED",x:224,y:176,width:44,height:12},{name:"EQ_PREAMP_LINE",x:0,y:314,width:113,height:1}],POSBAR:[{name:"MAIN_POSITION_SLIDER_BACKGROUND",x:0,y:0,width:248,height:10},{name:"MAIN_POSITION_SLIDER_THUMB",x:248,y:0,width:29,height:10},{name:"MAIN_POSITION_SLIDER_THUMB_SELECTED",x:278,y:0,width:29,height:10}],SHUFREP:[{name:"MAIN_SHUFFLE_BUTTON",x:28,y:0,width:47,height:15},{name:"MAIN_SHUFFLE_BUTTON_DEPRESSED",x:28,y:15,width:47,height:15},{name:"MAIN_SHUFFLE_BUTTON_SELECTED",x:28,y:30,width:47,height:15},{name:"MAIN_SHUFFLE_BUTTON_SELECTED_DEPRESSED",x:28,y:45,width:47,height:15},{name:"MAIN_REPEAT_BUTTON",x:0,y:0,width:28,height:15},{name:"MAIN_REPEAT_BUTTON_DEPRESSED",x:0,y:15,width:28,height:15},{name:"MAIN_REPEAT_BUTTON_SELECTED",x:0,y:30,width:28,height:15},{name:"MAIN_REPEAT_BUTTON_SELECTED_DEPRESSED",x:0,y:45,width:28,height:15},{name:"MAIN_EQ_BUTTON",x:0,y:61,width:23,height:12},{name:"MAIN_EQ_BUTTON_SELECTED",x:0,y:73,width:23,height:12},{name:"MAIN_EQ_BUTTON_DEPRESSED",x:46,y:61,width:23,height:12},{name:"MAIN_EQ_BUTTON_DEPRESSED_SELECTED",x:46,y:73,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON",x:23,y:61,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON_SELECTED",x:23,y:73,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON_DEPRESSED",x:69,y:61,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON_DEPRESSED_SELECTED",x:69,y:73,width:23,height:12}],TEXT:Ui,TITLEBAR:[{name:"MAIN_TITLE_BAR",x:27,y:15,width:275,height:14},{name:"MAIN_TITLE_BAR_SELECTED",x:27,y:0,width:275,height:14},{name:"MAIN_EASTER_EGG_TITLE_BAR",x:27,y:72,width:275,height:14},{name:"MAIN_EASTER_EGG_TITLE_BAR_SELECTED",x:27,y:57,width:275,height:14},{name:"MAIN_OPTIONS_BUTTON",x:0,y:0,width:9,height:9},{name:"MAIN_OPTIONS_BUTTON_DEPRESSED",x:0,y:9,width:9,height:9},{name:"MAIN_MINIMIZE_BUTTON",x:9,y:0,width:9,height:9},{name:"MAIN_MINIMIZE_BUTTON_DEPRESSED",x:9,y:9,width:9,height:9},{name:"MAIN_SHADE_BUTTON",x:0,y:18,width:9,height:9},{name:"MAIN_SHADE_BUTTON_DEPRESSED",x:9,y:18,width:9,height:9},{name:"MAIN_CLOSE_BUTTON",x:18,y:0,width:9,height:9},{name:"MAIN_CLOSE_BUTTON_DEPRESSED",x:18,y:9,width:9,height:9},{name:"MAIN_CLUTTER_BAR_BACKGROUND",x:304,y:0,width:8,height:43},{name:"MAIN_CLUTTER_BAR_BACKGROUND_DISABLED",x:312,y:0,width:8,height:43},{name:"MAIN_CLUTTER_BAR_BUTTON_O_SELECTED",x:304,y:47,width:8,height:8},{name:"MAIN_CLUTTER_BAR_BUTTON_A_SELECTED",x:312,y:55,width:8,height:7},{name:"MAIN_CLUTTER_BAR_BUTTON_I_SELECTED",x:320,y:62,width:8,height:7},{name:"MAIN_CLUTTER_BAR_BUTTON_D_SELECTED",x:328,y:69,width:8,height:8},{name:"MAIN_CLUTTER_BAR_BUTTON_V_SELECTED",x:336,y:77,width:8,height:7},{name:"MAIN_SHADE_BACKGROUND",x:27,y:42,width:275,height:14},{name:"MAIN_SHADE_BACKGROUND_SELECTED",x:27,y:29,width:275,height:14},{name:"MAIN_SHADE_BUTTON_SELECTED",x:0,y:27,width:9,height:9},{name:"MAIN_SHADE_BUTTON_SELECTED_DEPRESSED",x:9,y:27,width:9,height:9},{name:"MAIN_SHADE_POSITION_BACKGROUND",x:0,y:36,width:17,height:7},{name:"MAIN_SHADE_POSITION_THUMB",x:20,y:36,width:3,height:7},{name:"MAIN_SHADE_POSITION_THUMB_LEFT",x:17,y:36,width:3,height:7},{name:"MAIN_SHADE_POSITION_THUMB_RIGHT",x:23,y:36,width:3,height:7}],VOLUME:[{name:"MAIN_VOLUME_BACKGROUND",x:0,y:0,width:68,height:420},{name:"MAIN_VOLUME_THUMB",x:15,y:422,width:14,height:11},{name:"MAIN_VOLUME_THUMB_SELECTED",x:0,y:422,width:14,height:11}],GEN:[{name:"GEN_TOP_LEFT_SELECTED",x:0,y:0,width:25,height:20},{name:"GEN_TOP_LEFT_END_SELECTED",x:26,y:0,width:25,height:20},{name:"GEN_TOP_CENTER_FILL_SELECTED",x:52,y:0,width:25,height:20},{name:"GEN_TOP_RIGHT_END_SELECTED",x:78,y:0,width:25,height:20},{name:"GEN_TOP_LEFT_RIGHT_FILL_SELECTED",x:104,y:0,width:25,height:20},{name:"GEN_TOP_RIGHT_SELECTED",x:130,y:0,width:25,height:20},{name:"GEN_TOP_LEFT",x:0,y:21,width:25,height:20},{name:"GEN_TOP_LEFT_END",x:26,y:21,width:25,height:20},{name:"GEN_TOP_CENTER_FILL",x:52,y:21,width:25,height:20},{name:"GEN_TOP_RIGHT_END",x:78,y:21,width:25,height:20},{name:"GEN_TOP_LEFT_RIGHT_FILL",x:104,y:21,width:25,height:20},{name:"GEN_TOP_RIGHT",x:130,y:21,width:25,height:20},{name:"GEN_BOTTOM_LEFT",x:0,y:42,width:125,height:14},{name:"GEN_BOTTOM_RIGHT",x:0,y:57,width:125,height:14},{name:"GEN_BOTTOM_FILL",x:127,y:72,width:25,height:14},{name:"GEN_MIDDLE_LEFT",x:127,y:42,width:11,height:29},{name:"GEN_MIDDLE_LEFT_BOTTOM",x:158,y:42,width:11,height:24},{name:"GEN_MIDDLE_RIGHT",x:139,y:42,width:8,height:29},{name:"GEN_MIDDLE_RIGHT_BOTTOM",x:170,y:42,width:8,height:24},{name:"GEN_CLOSE_SELECTED",x:148,y:42,width:9,height:9}]};function Ni(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _i(e){for(var t=1;t{n.height=t.height,n.width=t.width,r.drawImage(e,-t.x,-t.y);const a=n.toDataURL();i[t.name]=a}),i}async function Fi(e,t){const n=await Li(e,t,"(png|bmp)","blob");if(!n)return null;const r="image/"+((e=>{const t=/\.([a-z]{3,4})$/i.exec(e);return t?t[1].toLowerCase():null})(n.name)||"*");return ji(new Blob([n.contents],{type:r}))}const Pi="RIFF".split("").map(e=>e.charCodeAt(0));async function Qi(e,t){const n=await Li(e,t,"CUR","uint8array");if(null==n)return null;const r=n.contents;return i=r,Pi.every((e,t)=>i[t]===e)?{type:"ani",aniData:r}:{type:"cur",url:gt(r)};var i}async function zi(e){const t=e.file(Di("PLEDIT","txt"))[0];if(null==t)return G.playlistStyle;const n=await t.async("text");if(null==n)return G.playlistStyle;const r=n&&ae(n).text;return r?(["normal","current","normalbg","selectedbg","mbFG","mbBG"].forEach(e=>{let t=r[e];t&&("#"!==t[0]&&(t="#"+t),r[e]=t.slice(0,7))}),_i(_i({},G.playlistStyle),r)):G.playlistStyle}async function Vi(e){const t=await Fi(e,"GENEX");if(null==t)return null;const n=document.createElement("canvas"),r=n.getContext("2d");if(null==r)return null;n.width=t.width,n.height=t.height,r.drawImage(t,0,0);const i=e=>`rgb(${r.getImageData(e,0,1,1).data.slice(0,3).join(",")})`;return{itemBackground:i(48),itemForeground:i(50),windowBackground:i(52),buttonText:i(54),windowText:i(56),divider:i(58),playlistSelection:i(60),listHeaderBackground:i(62),listHeaderText:i(64),listHeaderFrameTopAndLeft:i(66),listHeaderFrameBottomAndRight:i(68),listHeaderFramePressed:i(70),listHeaderDeadArea:i(72),scrollbarOne:i(74),scrollbarTwo:i(76),pressedScrollbarOne:i(78),pressedScrollbarTwo:i(80),scrollbarDeadArea:i(82),listTextHighlighted:i(84),listTextHighlightedBackground:i(86),listTextSelected:i(88),listTextSelectedBackground:i(90)}}function Gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ki(e){for(var t=1;te.reduce((e,t)=>Object.assign(e,t),{}),Hi=["CLOSE","EQCLOSE","EQNORMAL","EQSLID","EQTITLE","MAINMENU","MMENU","MIN","NORMAL","PCLOSE","PNORMAL","POSBAR","PSIZE","PTBAR","PVSCROLL","PWINBUT","PWSNORM","PWSSIZE","SONGNAME","TITLEBAR","VOLBAL","WINBUT","WSNORMAL","WSPOSBAR"];async function Ji(e){const t=await Li(e,"VISCOLOR","txt","text");return t?(e=>{const t=e.split("\n"),n=/^\s*(\d+)\s*,?\s*(\d+)\s*,?\s*(\d+)/,r=[...G.colors];return t.map(e=>n.exec(e)).filter(Boolean).map(e=>e.slice(1,4).join(",")).map((e,t)=>{r[t]=`rgb(${e})`}),r})(t.contents):G.colors}async function qi(e){const t=await Promise.all(Object.keys(Mi).map(t=>async function(e,t){const n=await Fi(e,t);return null==n?{}:Ri(n,Mi[t])}(e,t)));return Yi(t)}async function Wi(e){const t=await Promise.all(Hi.map(async t=>({[t]:await Qi(e,t)})));return Yi(t)}async function Zi(e){const t=await Li(e,"REGION","txt","text");return t?function(e){const t=ae(e),n={};return Object.keys(t).forEach(e=>{const{numpoints:r,pointlist:i}=t[e];if(!r||!i)return;const a=r.split(/\s*,\s*/).filter(e=>""!==e),o=function(e){const t=[];for(let n=0;n""!==e));let A=0;const s=a.map(e=>{const t=Number(e);if(t<3)return A+=t,null;const n=o.slice(A,A+t).join(" ");return n.length?(A+=t,n):null}).filter(e=>null!=e);s.length&&(n[e]=s)}),n}(t.contents):{}}async function Xi(e){const t=await Fi(e,"GEN");if(null==t)return null;const n=document.createElement("canvas"),r=n.getContext("2d");n.width=t.width,n.height=t.height,r.drawImage(t,0,0);const i=(e,t)=>{const i=t=>r.getImageData(t,e,1,1).data.join(",");let a=1;const o=i(0);return V.map(r=>{let A=a;for(;i(A)!==o&&A{a[e.name]=e.width}),[a,Ri(t,o)]}var $i=async function(e,t){const n=await t.loadAsync(e),[r,i,a,o,A,s,l]=await Promise.all([Ji(n),zi(n),qi(n),Wi(n),Zi(n),Xi(n),Vi(n)]),[u,c]=s||[null,{}];return{colors:r,playlistStyle:i,images:Ki(Ki({},a),c),genLetterWidths:u,cursors:o,region:A,genExColors:l}},ea=n(39),ta=n.n(ea);function na(){return(e,t)=>{const n=t();if(0===Xt(n).length)return;const r=Zt(n),{playlist:{trackOrder:i}}=n;e({type:"REMOVE_TRACKS",ids:i.filter(e=>!r.has(e))})}}function ra(){return(e,t)=>{e({type:"REMOVE_TRACKS",ids:Array.from(Zt(t()))})}}function ia(){return e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}}function aa(){return{type:"REVERSE_LIST"}}function oa(){return{type:"RANDOMIZE_LIST"}}function Aa(){return(e,t)=>{const n=t(),r=Gt(n);var i,a;return e({type:"SET_TRACK_ORDER",trackOrder:(i=Yt(n),a=e=>(""+r[e].title).toLowerCase(),[...i].sort((e,t)=>{const n=a(e),r=a(t);return nr?1:0}))})}}function sa(e){return{type:"SET_PLAYLIST_SCROLL_POSITION",position:e}}function la(e){return(t,n)=>{const r=n(),i=pn(r),a=bn(r);return t({type:"SET_PLAYLIST_SCROLL_POSITION",position:100*(i?oe((a+e)/i,0,1):0)})}}function ua(e){return e.preventDefault(),(t,n)=>{const r=n();pn(r)&&e.stopPropagation();const i=13*r.playlist.trackOrder.length,a=e.deltaY/i*100;t({type:"SET_PLAYLIST_SCROLL_POSITION",position:oe(r.display.playlistScrollPosition+a,0,100)})}}function ca(){return la(-4)}function da(){return la(4)}function ha(e){return(t,n)=>{const r=n(),i=Gt(r),a=Yt(r),o=Zt(r),A=a.findIndex(e=>i[e]&&o.has(e));if(-1===A)return;const s=function(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}(a,e=>i[e]&&o.has(e));if(-1===s)throw new Error("We found a first selected, but not a last selected.");const l=-A,u=a.length-1-s,c=oe(e,l,u);0!==c&&t({type:"DRAG_SELECTED",offset:c})}}function fa(){return{type:"INVERT_SELECTION"}}function pa(){return{type:"SELECT_ZERO"}}function ga(){return{type:"SELECT_ALL"}}const ma=new class{constructor({threads:e}){this._queue=new ta.a([],(e,t)=>e.priority()-t.priority()),this._availableThreads=e}push(e,t){const n={task:e,priority:t};return this._queue.push(n),setTimeout(()=>{this._run()},0),()=>{this._queue=this._queue.filter(e=>e!==n)}}_run(){for(;this._availableThreads>0;){if(0===this._queue.length)return;this._availableThreads--;const e=this._queue.pop().task();ht()("function"==typeof e.then,"LoadQueue only supports loading Promises. Got "+e),e.then(()=>{this._availableThreads++,this._run()})}}}({threads:4});function ba(e,t,n){return Ba(Array.from(e).map(e=>({blob:e,defaultName:e.name})),t,n)}const Ea=new RegExp("(wsz|zip)$","i"),wa=new RegExp("eqf$","i");function ya(e,t=R,n){return r=>{if(!(e.length<1)){if(1===e.length){const t=e[0];if(Ea.test(t.name))return void r(va(t));if(wa.test(t.name))return void r(function(e){return async t=>{const n=await async function(e){return ht()(null!=e,"Attempt to get an ArrayBuffer without assigning a fileReference"),new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})}(e);t(Ma(Object(Ci.parser)(n).presets[0]))}}(t))}r(ba(e,t,n))}}}function va(e){return async(t,n,{requireJSZip:r})=>{if(!r)return void alert("Webamp has not been configured to support custom skins.");let i;t({type:"LOADING"});try{i=await r()}catch(e){return console.error(e),t({type:"LOADED"}),void alert("Failed to load the skin parser.")}try{const n=await $i(e,i);t({type:"SET_SKIN_DATA",data:{skinImages:n.images,skinColors:n.colors,skinPlaylistStyle:n.playlistStyle,skinCursors:n.cursors,skinRegion:n.region,skinGenLetterWidths:n.genLetterWidths,skinGenExColors:n.genExColors}})}catch(e){console.error(e),t({type:"LOADED"}),alert("Failed to parse skin")}}}function ka(e){return async t=>{t({type:"LOADING"});try{const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);t(va(n.blob()))}catch(n){console.error(n),t({type:"LOADED"}),alert("Failed to download skin from "+e)}}}function Sa(e,t){return async n=>{var r;const i=await pt({accept:e});n({type:"OPENED_FILES",expectedType:t,count:i.length,firstFileName:null===(r=i[0])||void 0===r?void 0:r.name}),n(ya(i))}}function Ia(){return Sa(".eqf","EQ")}function Oa(){return Sa(null,"MEDIA")}function Ta(){return Sa(".zip, .wsz","SKIN")}function Ca(e,t){return(n,r)=>{ma.push(async()=>{try{const r=await function(e){return ht()("string"==typeof e,"Attempted to get the duration of media file without passing a url"),new Promise((t,n)=>{const r=document.createElement("audio");r.crossOrigin="anonymous";const i=()=>{t(r.duration),r.removeEventListener("durationchange",i),r.src=""};r.addEventListener("durationchange",i),r.addEventListener("error",e=>{n(e)}),r.src=e})}(e);n({type:"SET_MEDIA_DURATION",duration:r,id:t})}catch(e){}},()=>yn(r())(t)?5:15)}}function xa(e,t=F,n=0){const{files:r}=e.dataTransfer;return async(i,a,{handleTrackDropEvent:o})=>{if(o){const r=await o(e);if(null!=r)return void i(Ba(r,t,n))}i(ya(r,t,n))}}function Ba(e,t=F,n=0){return r=>{t===R&&r(e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}),e.forEach((e,i)=>{r(function(e,t=F,n=0){return r=>{const i=be++,{defaultName:a,metaData:o,duration:A}=e;let s;if("url"in e)s=e.url.toString();else{if(!("blob"in e))throw new Error("Expected track to have either a blob or a url");s=URL.createObjectURL(e.blob)}switch(r({type:"ADD_TRACK_FROM_URL",url:s,duration:e.duration,defaultName:a,id:i,atIndex:n}),t){case j:r({type:"BUFFER_TRACK",id:i});break;case R:r({type:"PLAY_TRACK",id:i});break;case F:default:r(null!=A?{type:"SET_MEDIA_DURATION",duration:A,id:i}:Ca(s,i))}if(null!=o){const{artist:e,title:t,album:n}=o;r({type:"SET_MEDIA_TAGS",artist:e,title:t,album:n,sampleRate:44e3,bitrate:192e3,numberOfChannels:2,id:i})}else r("blob"in e?Ua(e.blob,i):function(e){return(t,n)=>{const r=Gt(n())[e];ma.push(()=>t(Ua(r.url,e)),()=>yn(n())(e)?10:20)}}(i))}}(e,0===i?t:F,n+i))})}}function Ua(e,t){return async(n,r,{requireMusicMetadata:i})=>{n({type:"MEDIA_TAG_REQUEST_INITIALIZED",id:t});try{const r=await function(e,t){ht()(null!=e,"Attempted to get the tags of media file without passing a file");const n={duration:!0,skipPostHeaders:!0};return"string"==typeof e?t.fetchFromUrl(e,n):t.parseBlob(e,n)}(e,await i()),{artist:a,title:o,album:A,picture:s}=r.common,{numberOfChannels:l,bitrate:u,sampleRate:c}=r.format;let d=null;if(s&&s.length>=1){const e=new Uint8Array(s[0].data),t=new Blob([e],{type:s[0].format});d=URL.createObjectURL(t)}n({type:"SET_MEDIA_TAGS",artist:a||"",title:o||"",album:A,albumArtUrl:d,numberOfChannels:l,bitrate:u,sampleRate:c,id:t})}catch(e){n({type:"MEDIA_TAG_REQUEST_FAILED",id:t})}}}function Ma(e){return t=>{t(Ii(he(e.preamp))),M.forEach(n=>{t(wi(n,he(e["hz"+n])))})}}function Na(){return(e,t)=>{const n=t(),r=Vt(n);se("data:application/zip;base64,"+(e=>Ae(new Uint8Array(e)))(Object(Ci.creator)(r)),"entry.eqf")}}function _a(){return(e,t)=>{se(_n(t()),"Winamp Playlist.html")}}let Da=document.createElement("input");Da.type="file";const La=void 0!==Da.webkitdirectory||void 0!==Da.mozdirectory||void 0!==Da.directory;function ja(e){return async t=>{t(ba(await pt(),F,e))}}function Ra(e){return async t=>{if(!La)return void alert("Not supported in your browser");t(ba(await pt({directory:!0}),F,e))}}function Fa(e=0){return async(t,n,{handleAddUrlEvent:r})=>{if(r){const n=await r();if(null!=n)return void t(Ba(n,F,e))}else alert("Not supported in Webamp")}}function Pa(){return async(e,t,{handleLoadListEvent:n})=>{if(n){const t=await n();if(null!=t)return e(e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}),void e(Ba(t,F,0))}else alert("Not supported in Webamp")}}function Qa(){return(e,t,{handleSaveListEvent:n})=>{n?n(qt(t())):alert("Not supported in Webamp")}}function za(e,t){return n=>{var r;return n({type:"DROPPED_FILES",count:e.dataTransfer.files.length,firstFileName:null===(r=e.dataTransfer.files[0])||void 0===r?void 0:r.name,windowId:t})}}function Va(e){const{name:t}=e;if("butterchurnPresetObject"in e)return{type:"RESOLVED",name:t,preset:e.butterchurnPresetObject};if("getButterchrunPresetObject"in e)return{type:"UNRESOLVED",name:t,getPreset:e.getButterchrunPresetObject};if("butterchurnPresetUrl"in e)return{type:"UNRESOLVED",name:t,getPreset:async()=>(await fetch(e.butterchurnPresetUrl)).json()};throw new Error("Invalid preset object")}function Ga(e){return(t,n)=>{const r=n(),i=r.milkdrop.presets.length;t({type:"GOT_BUTTERCHURN_PRESETS",presets:e}),0===i&&wr(r)?t(Ja()):t(qa(i,kt.IMMEDIATE,!0))}}function Ka(e){return async(t,n,{convertPreset:r})=>{t(Ga(Array.from(e).map(e=>{const t=e.name.toLowerCase();if(t.endsWith(".milk")){if(null==r)throw new Error("Invalid type");return{type:"UNRESOLVED",name:e.name.slice(0,e.name.length-".milk".length),getPreset:()=>r(e)}}return t.endsWith(".json")?{type:"UNRESOLVED",name:e.name.slice(0,e.name.length-".json".length),getPreset:async()=>{const t=await ft(e);return JSON.parse(t)}}:(console.error("Invalid type preset when loading directory"),null)}).filter(Boolean)))}}function Ya(e=kt.DEFAULT){return(t,n)=>{const r=n();if(wr(r))return t(Ja(e));const i=pr(r);null!=i&&t(qa(i+1,e,!0))}}function Ha(e=kt.DEFAULT){return(t,n)=>{const r=n(),{presetHistory:i}=r.milkdrop;i.length<1||t(qa(i[i.length-2],e,!1))}}function Ja(e=kt.DEFAULT){return(t,n)=>{const r=n();t(qa(Math.floor(Math.random()*r.milkdrop.presets.length),e,!0))}}function qa(e,t,n){return async(r,i)=>{const a=i().milkdrop.presets[e];if(null!=a)switch(r({type:"PRESET_REQUESTED",index:e,addToHistory:n}),a.type){case"RESOLVED":return void r({type:"SELECT_PRESET_AT_INDEX",index:e,transitionType:t});case"UNRESOLVED":const n=await a.getPreset();return r({type:"RESOLVE_PRESET_AT_INDEX",index:e,json:n}),void r({type:"SELECT_PRESET_AT_INDEX",index:e,transitionType:t})}}}function Wa(e){return Ka(e.dataTransfer.files)}function Za(){return{type:"TOGGLE_RANDOMIZE_PRESETS"}}function Xa(){return{type:"TOGGLE_PRESET_CYCLING"}}function $a(e){return{type:"SCHEDULE_MILKDROP_MESSAGE",message:e}}function eo(){return e=>{let t=!1;e({type:"CLOSE_REQUESTED",cancel:()=>{t=!0}}),t||(e({type:"STOP"}),e({type:"CLOSE_WINAMP"}))}}function to(){return{type:"TOGGLE_VISUALIZER_STYLE"}}function no(){return{type:"MINIMIZE_WINAMP"}}function ro(e){return{type:"SET_FOCUS",input:e}}function io(){return{type:"UNSET_FOCUS"}}function ao(e){return{type:"SET_BAND_FOCUS",input:"eq",bandFocused:e}}function oo(){return{type:"LOAD_DEFAULT_SKIN"}}function Ao(){return(e,t)=>{cr(t())?e({type:"SET_MILKDROP_DESKTOP",enabled:!1}):e({type:"SET_MILKDROP_DESKTOP",enabled:!0})}}function so(e){return{type:"SET_MILKDROP_FULLSCREEN",enabled:e}}function lo(){return(e,t)=>{e(so(!dr(t())))}}function uo(){return(e,t)=>{br(t())&&e(Jr(L)),e({type:"TOGGLE_PRESET_OVERLAY"})}}function co(){return{type:"STEP_MARQUEE"}}Da=null;var ho=e=>t=>{const{media:{volume:n,balance:r},equalizer:{sliders:i}}=t.getState();return e.setVolume(n),e.setBalance(r),e.setPreamp(i.preamp),e.on("timeupdate",()=>{t.dispatch({type:"UPDATE_TIME_ELAPSED",elapsed:e.timeElapsed()})}),e.on("ended",()=>{t.dispatch(Ai())}),e.on("playing",()=>{t.dispatch({type:"IS_PLAYING"})}),e.on("waiting",()=>{t.dispatch({type:"START_WORKING"})}),e.on("stopWaiting",()=>{t.dispatch({type:"STOP_WORKING"})}),e.on("fileLoaded",()=>{const n=on(t.getState());null!=n&&t.dispatch({id:n,type:"SET_MEDIA",kbps:"128",khz:"44",channels:2,length:e.duration()})}),n=>r=>{const i=n(r),a=t.getState();switch(r.type){case"PLAY":e.play();break;case"PAUSE":e.pause();break;case"STOP":e.stop();break;case"SET_VOLUME":e.setVolume(qn(a));break;case"SET_BALANCE":e.setBalance(Wn(a));break;case"SEEK_TO_PERCENT_COMPLETE":e.seekToPercentComplete(r.percent);break;case"PLAY_TRACK":{const n=Kt(t.getState())(r.id);null!=n&&e.loadFromUrl(n,!0);break}case"BUFFER_TRACK":{const n=Kt(t.getState())(r.id);null!=n&&e.loadFromUrl(n,!1);break}case"SET_BAND_VALUE":"preamp"===r.band?e.setPreamp(r.value):e.setEqBand(r.band,r.value);break;case"SET_EQ_OFF":e.disableEq();break;case"SET_EQ_ON":e.enableEq();break;case"LOAD_SERIALIZED_STATE":tr(a)?e.enableEq():e.disableEq(),e.setVolume(qn(a)),e.setBalance(Wn(a)),Ee(a.equalizer.sliders,(t,n)=>{"preamp"===n?e.setPreamp(t):e.setEqBand(n,t)})}return i}};const fo=Object(B.composeWithDevTools)({actionsBlacklist:["UPDATE_TIME_ELAPSED","STEP_MARQUEE"]});var po=function(e,t,n=[],r,i){let a;r&&(a=function e(t,n){const r=n,i=t;for(const t of Object.keys(r))r[t]instanceof Object&&Object.assign(r[t],e(i[t],r[t]));return Object.assign(t||{},n),t}(Ct(void 0,{type:"@@init"}),r));const o=fo(Object(m.applyMiddleware)(...[x.withExtraArgument(i),ho(e),()=>e=>n=>(t.trigger(n.type,n),e(n)),...n].filter(Boolean)));return a?Object(m.createStore)(Ct,a,o):Object(m.createStore)(Ct,o)},go=n(13),mo=n.n(go);var bo=function(e){const{onChange:t,enabled:n}=e,r=Object(o.useRef)(null);return Object(o.useEffect)(()=>{function e(){t&&t(mo.a.fullscreenElement===r.current)}return mo.a.addEventListener("fullscreenchange",e),()=>{mo.a.removeEventListener("fullscreenchange",e)}},[t]),Object(o.useLayoutEffect)(()=>{const e=mo.a.fullscreenElement===r.current;var t;e&&!n?mo.a.fullscreenEnabled&&mo.a.exitFullscreen():!e&&n&&null!=r.current&&(t=r.current,mo.a.fullscreenEnabled&&mo.a.requestFullscreen(t))},[n]),Object(a.jsx)("div",{ref:r,style:e.enabled?{height:"100%",width:"100%"}:void 0,children:e.children})};function Eo(e){const[t,n]=Object(o.useState)(null);return Object(o.useEffect)(()=>{let t=!1;return e.then(e=>{t||n(e)}),()=>{t=!0}},[e]),t}function wo(){const[e]=Object(o.useState)({width:window.screen.width,height:window.screen.height});return e}function yo(){const[e,t]=Object(o.useState)(ve()),n=Object(o.useCallback)(function(e,t){let n=null,r=[];return function(i,...a){r=a,n||(n=window.setTimeout(()=>{e.apply(i,r),n=null},t))}}(()=>{t(ve())},100),[]);return Object(o.useEffect)(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n]),e}const vo={current:{pageX:0,pageY:0}};function ko(){const e=vo,[t,n]=Object(o.useState)(!1),[r,i]=Object(o.useState)(null);return Object(o.useLayoutEffect)(()=>{if(null==r)return void n(!1);const t=r.getBoundingClientRect(),{pageX:i,pageY:a}=e.current;n(i>=t.left&&i<=t.right&&a>=t.top&&a<=t.bottom);const o=()=>n(!0),A=()=>n(!1);return r.addEventListener("mouseenter",o),r.addEventListener("mouseleave",A),()=>{r.removeEventListener("mouseenter",o),r.removeEventListener("mouseleave",A)}},[r,e]),{ref:i,hover:t}}function So(e){return O(e)}function Io(e){const t=v();return Object(o.useCallback)((...n)=>t(e(...n)),[t,e])}function Oo(){return v()}window.document.addEventListener("mousemove",({pageX:e,pageY:t})=>{vo.current={pageX:e,pageY:t}});var To=n(4),Co=n.n(To);n(68);function xo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Bo=Object(o.memo)((function(e){const{currentSize:t,setWindowSize:n,widthOnly:r}=e,A=Me()(e,["currentSize","setWindowSize","widthOnly"]),[s,l]=Object(o.useState)(!1),[u,c]=Object(o.useState)(null);Object(o.useEffect)(()=>{if(!1===s||null==u)return;const[n,i]=t,a=t=>{const a=Se(t)-u.x,o=Ie(t)-u.y,A=[Math.max(0,n+Math.round(a/25)),r?n:Math.max(0,i+Math.round(o/29))];e.setWindowSize(A)};window.addEventListener("mousemove",a),window.addEventListener("touchmove",a);const o=()=>l(!1);return window.addEventListener("mouseup",o),window.addEventListener("touchend",o),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("touchmove",a),window.removeEventListener("mouseup",o),window.removeEventListener("touchend",o)}},[u,s]);const d=e=>{c({x:Se(e),y:Ie(e)}),l(!0)};return Object(a.jsx)("div",function(e){for(var t=1;t{t!==r&&i(t)},[t,r,i]),[s,l]=Object(o.useState)(null);return Object(o.useEffect)(()=>{if(null!=s&&null!=e)return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[e,t,r,s]),Object(o.useEffect)(()=>{if(null==s||t!==r)return;const e=new MutationObserver(e=>{document.activeElement===document.body&&e.some(e=>e.removedNodes.length>0)&&s.focus()});return e.observe(s,{subtree:!0,attributes:!1,childList:!0}),()=>e.disconnect()},[t,r,s]),Object(a.jsx)("div",{ref:l,onMouseDown:A,onTouchStart:A,onFocus:A,tabIndex:-1,style:{height:"100%",width:"100%"},children:n})};const Mo=({children:e})=>{const t=e.split("");return Object(a.jsx)(o.Fragment,{children:t.map((e,t)=>Object(a.jsx)("div",{className:"draggable gen-text-letter gen-text-"+(" "===e?"space":e.toLowerCase())},t))})};var No=({children:e,title:t,windowId:n,onKeyDown:r})=>{const i=Io(qr),o=Io(Hr),A=So(Qn),s=So(Ln),l=So(dn)(n),u=s===n,{width:c,height:d}=A(n);return Object(a.jsx)(Uo,{windowId:n,onKeyDown:r,children:Object(a.jsxs)("div",{className:Co()("gen-window","window",{selected:u}),style:{width:c,height:d},children:[Object(a.jsxs)("div",{className:"gen-top draggable",children:[Object(a.jsx)("div",{className:"gen-top-left draggable"}),Object(a.jsx)("div",{className:"gen-top-left-fill draggable"}),Object(a.jsx)("div",{className:"gen-top-left-end draggable"}),Object(a.jsx)("div",{className:"gen-top-title draggable",children:Object(a.jsx)(Mo,{children:t})}),Object(a.jsx)("div",{className:"gen-top-right-end draggable"}),Object(a.jsx)("div",{className:"gen-top-right-fill draggable"}),Object(a.jsx)("div",{className:"gen-top-right draggable",children:Object(a.jsx)("div",{className:"gen-close selected",onClick:()=>o(n)})})]}),Object(a.jsxs)("div",{className:"gen-middle",children:[Object(a.jsx)("div",{className:"gen-middle-left draggable",children:Object(a.jsx)("div",{className:"gen-middle-left-bottom draggable"})}),Object(a.jsx)("div",{className:"gen-middle-center",children:e({width:c-19,height:d-34})}),Object(a.jsx)("div",{className:"gen-middle-right draggable",children:Object(a.jsx)("div",{className:"gen-middle-right-bottom draggable"})})]}),Object(a.jsxs)("div",{className:"gen-bottom draggable",children:[Object(a.jsx)("div",{className:"gen-bottom-left draggable"}),Object(a.jsx)("div",{className:"gen-bottom-right draggable",children:Object(a.jsx)(Bo,{currentSize:l,setWindowSize:e=>i(n,e),id:"gen-resize-target"})})]})]})})};const _o={[kt.DEFAULT]:2.7,[kt.IMMEDIATE]:0,[kt.USER_PRESET]:5.7};var Do=function({analyser:e,width:t,height:n}){const r=So(Jn),i=So(On),A=So(hr),s=So(Sn),l=So(gr),u=So(fr),c=So(ur),d=r===H,h=Object(o.useRef)(null),[f,p]=Object(o.useState)(null);Object(o.useEffect)(()=>{if(null==h.current||null==A)return;if(null!=f)return;const r=A.createVisualizer(e.context,h.current,{width:t,height:n,meshWidth:32,meshHeight:24,pixelRatio:window.devicePixelRatio||1});r.connectAudio(e),p(r)},[A,e,n,t,f]),Object(o.useEffect)(()=>{null!=f&&f.setRendererSize(t,n)},[f,t,n]);const g=Object(o.useRef)(!1);Object(o.useEffect)(()=>{null!=f&&null!=l&&(g.current?f.loadPreset(l,_o[u]):(f.loadPreset(l,_o[kt.IMMEDIATE]),g.current=!0))},[f,l]),Object(o.useEffect)(()=>{null!=f&&s&&f.launchSongTitleAnim(s)},[f,s]);const m=Object(o.useRef)(null);Object(o.useEffect)(()=>{null!=f&&null!=c&&(null==m.current||c.time>m.current)&&(m.current=Date.now(),f.launchSongTitleAnim(c.text))},[f,c]);const b=i&&d;return Object(o.useEffect)(()=>{if(!b||null==f)return;let e=null;const t=()=>{f.render(),e=window.requestAnimationFrame(t)};return t(),()=>{null!=e&&window.cancelAnimationFrame(e)}},[f,b]),Object(a.jsx)("canvas",{height:n,width:t,style:{height:"100%",width:"100%",display:d?"block":"none"},ref:h})};n(71);var Lo=e=>{const{innerRef:t}=e;return Object(a.jsx)("div",{ref:t,className:"draggable",style:{backgroundColor:"#000",position:"absolute",top:0,bottom:0,left:0,right:0,height:"100%",width:"100%"},tabIndex:0,children:e.children})};function jo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ro(e){for(var t=1;t()=>{e.current=!0},[]),e}(),[u,c]=Object(o.useState)(()=>null!=r?r+1:0),d=n.length,h=Object(o.useCallback)(()=>{const t=Math.floor((e-15)/14),i=Math.floor(.75*t),[o,A]=function(e,t,n){const r=Math.min(e,t),i=Math.floor(r/2),a=oe(n-i,0,e-r);return[a,a+r-1]}(d+1,i,u),s=[];for(let e=o;e<=A;e++){const t=zo(e),i=t===r;let o;o=e===u?i?"#FFCC22":"#FF5050":i?"#CCFF03":"#CCCCCC",s.push(Object(a.jsx)("li",{style:{color:o,lineHeight:"14px"},children:0===e?"Load Local Directory":n[t]},e))}return s},[r,e,d,n,u]),f=Object(o.useCallback)(async()=>{const e=await pt({directory:!0});l.current||s(e)},[s,l]),p=Object(o.useCallback)(e=>{switch(e.keyCode){case 38:c(e=>Math.max(e-1,0)),e.stopPropagation();break;case 40:c(e=>Math.min(e+1,d)),e.stopPropagation();break;case 13:0===u?f():i(zo(u),kt.DEFAULT,!0),e.stopPropagation();break;case 27:A(),e.stopPropagation()}},[f,d,i,u,A]),g=Object(o.useCallback)(e=>{null!=e&&document.activeElement!==e&&e.focus()},[]);return null==n?Object(a.jsx)("div",{style:Fo,children:Object(a.jsx)("span",{children:"Loading presets"})}):Object(a.jsx)("div",{ref:g,tabIndex:-1,style:Po,onKeyDown:p,children:Object(a.jsx)("div",{style:Ro(Ro({},Qo),{},{width:t-20-20,maxHeight:e-15}),children:Object(a.jsx)("ul",{style:{listStyleType:"none",padding:0,margin:0},children:h()})})})};function Go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ko(e){for(var t=1;t{const{handleDrop:t,windowId:n}=e,r=Me()(e,["handleDrop","windowId"]),i=Io(za),A=Object(o.useCallback)(e=>{Yo(e),i(e,n);const{currentTarget:r}=e;if(!(r instanceof Element))return;const{left:a,top:o}=r.getBoundingClientRect();t(e,{x:a,y:o})},[t,i,n]);return Object(a.jsx)("div",Ko(Ko({},r),{},{onDragStart:Yo,onDragEnter:Yo,onDragOver:Yo,onDrop:A}))};n(73);function Jo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qo(e){for(var t=1;t{const t=Object(o.useMemo)(()=>{const t=document.createElement("div");return t.id="webamp-context-menu",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.zIndex=String(e.zIndex+1),t},[e.zIndex]);Object(o.useEffect)(()=>(document.body.appendChild(t),()=>{document.body.removeChild(t)}),[t]);const n={top:e.top,left:e.left,position:"absolute"};return Object(s.createPortal)(Object(a.jsx)("div",{style:n,children:e.children}),t)},Zo=()=>Object(a.jsx)("li",{className:"hr",children:Object(a.jsx)("hr",{})}),Xo=({children:e,label:t})=>Object(a.jsxs)("li",{className:"parent",children:[Object(a.jsx)("ul",{children:e}),t]}),$o=e=>Object(a.jsx)("li",{children:Object(a.jsx)("a",qo(qo({},e),{},{children:e.label}))}),eA=e=>{const{label:t,checked:n,className:r=""}=e,i=Me()(e,["label","checked","className"]);return Object(a.jsx)("li",qo(qo({className:Co()(r,{checked:n})},i),{},{children:t}))};function tA({children:e,offsetTop:t,offsetLeft:n,top:r,bottom:i,selected:o}){const A=So(Fn);return o?Object(a.jsx)(Wo,{top:t,left:n,zIndex:A,children:Object(a.jsx)("ul",{className:Co()("context-menu",{top:r,bottom:i}),children:e})}):null}function nA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rA(e){for(var t=1;t{l(null)},[]),c=Object(o.useCallback)(e=>{2!==e.button&&u()},[u]),d=Object(o.useCallback)(e=>{const{pageX:t,pageY:n}=e;l({x:t,y:n}),e.preventDefault(),e.stopPropagation()},[]);return Object(o.useEffect)(()=>{if(null!=s)return document.addEventListener("click",c),document.body.addEventListener("contextmenu",u),()=>{document.removeEventListener("click",c),document.body.removeEventListener("contextmenu",u)}},[s,u,c]),Object(a.jsxs)("div",rA(rA({onContextMenu:d,style:{width:"100%",height:"100%"}},A),{},{children:[Object(a.jsx)(tA,{selected:null!=s,offsetTop:null!==(t=null==s?void 0:s.y)&&void 0!==t?t:0,offsetLeft:null!==(n=null==s?void 0:s.x)&&void 0!==n?n:0,children:i()}),r]}))}var aA=e=>{const t=So(cr),n=Io(Hr),r=Io(Ao),i=Io(lo);return Object(a.jsx)(iA,{renderContents:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(eA,{onClick:i,label:"Fullscreen",hotkey:"Alt+Enter"}),Object(a.jsx)(eA,{onClick:r,checked:t,label:"Desktop Mode",hotkey:"Alt+D"}),Object(a.jsx)(Zo,{}),Object(a.jsx)(eA,{onClick:()=>n(L),label:"Quit"})]}),children:e.children})};var oA=o.memo(({children:e})=>{const[t]=o.useState(()=>document.createElement("div"));return o.useEffect(()=>(t.classList.add("webamp-desktop"),document.body.appendChild(t),()=>{document.body.removeChild(t)}),[t]),l.a.createPortal(e,t)});function AA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sA(e){for(var t=1;t{switch(o.keyCode){case 32:t();break;case 8:n(kt.IMMEDIATE);break;case 72:t(kt.IMMEDIATE);break;case 82:r();break;case 76:i(),o.stopPropagation();break;case 84:null!=e&&a(e),o.stopPropagation();break;case 145:case 125:A()}},[a,t,n,A,i,r,e])}();Object(o.useEffect)(()=>{if(!i||!s)return;const e=setInterval(u,15e3);return()=>clearInterval(e)},[i,A,s,u]);const f=wo(),p=yo();return t?Object(a.jsx)(oA,{children:Object(a.jsx)(aA,{children:Object(a.jsx)(Do,sA(sA({},p),{},{analyser:e}))})}):Object(a.jsx)(No,{title:"Milkdrop",windowId:L,onKeyDown:h,children:t=>{const i=n?f:t;return Object(a.jsx)(aA,{children:Object(a.jsx)(Lo,{children:Object(a.jsxs)(Ho,{windowId:L,handleDrop:c,children:[r&&Object(a.jsx)(Vo,sA({},i)),Object(a.jsx)(bo,{enabled:n,onChange:d,children:Object(a.jsx)("div",{onDoubleClick:l,children:Object(a.jsx)(Do,sA(sA({},i),{},{analyser:e}))})})]})})})}})};var uA=()=>{const e=Io(si),t=Io(ri),n=Io(ii),r=Io(ai),i=Io(Ai),A=Io(ui),s=Io(ci),l=Io(oi);return Object(a.jsxs)(o.Fragment,{children:[Object(a.jsx)(eA,{label:"Previous",hotkey:"Z",onClick:e}),Object(a.jsx)(eA,{label:"Play",hotkey:"X",onClick:t}),Object(a.jsx)(eA,{label:"Pause",hotkey:"C",onClick:n}),Object(a.jsx)(eA,{label:"Stop",hotkey:"V",onClick:r}),Object(a.jsx)(eA,{label:"Next",hotkey:"B",onClick:i}),Object(a.jsx)(Zo,{}),Object(a.jsx)(eA,{label:"Back 5 seconds",hotkey:"Left",onClick:()=>s(5)}),Object(a.jsx)(eA,{label:"Fwd 5 seconds",hotkey:"Right",onClick:()=>A(5)}),Object(a.jsx)(eA,{label:"10 tracks back",hotkey:"Num. 1",onClick:()=>l(-10)}),Object(a.jsx)(eA,{label:"10 tracks fwd",hotkey:"Num. 3",onClick:()=>l(10)})]})};var cA=()=>{const e=Io(oo),t=Io(Ta),n=Io(ka),r=So(Ur);return Object(a.jsxs)(Xo,{label:"Skins",children:[Object(a.jsx)(eA,{onClick:t,label:"Load Skin..."}),Object(a.jsx)(Zo,{}),Object(a.jsx)(eA,{onClick:e,label:""}),r.map(e=>Object(a.jsx)(eA,{onClick:()=>n(e.url),label:e.name},e.url))]})};var dA=()=>{const e=Io(bi),t=Io(Vr),n=Io(gi),r=Io(mi),i=So(jn),o=So(Cr),A=So(Xn),s=So(Zn);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(cA,{}),Object(a.jsx)(Zo,{}),Object(a.jsx)(eA,{label:"Time elapsed",hotkey:"(Ctrl+T toggles)",onClick:e,checked:o===q}),Object(a.jsx)(eA,{label:"Time remaining",hotkey:"(Ctrl+T toggles)",onClick:e,checked:o===W}),Object(a.jsx)(eA,{label:"Double Size",hotkey:"Ctrl+D",onClick:t,checked:i}),Object(a.jsx)(Zo,{}),Object(a.jsx)(eA,{label:"Repeat",hotkey:"R",onClick:n,checked:A}),Object(a.jsx)(eA,{label:"Shuffle",hotkey:"S",onClick:r,checked:s})]})};var hA=Object(o.memo)(({filePickers:e})=>{const t=So(Tr),n=So(sn),r=Io(eo),i=Io(Oa),A=Io(Ba),s=Io(Wr),l=Io(()=>({type:"MAIN_CONTEXT_MENU_OPENED"}));return Object(o.useEffect)(()=>{l()},[l]),Object(a.jsxs)(o.Fragment,{children:[Object(a.jsx)($o,{href:"https://webamp.org/about",target:"_blank",label:"Webamp..."}),Object(a.jsx)(Zo,{}),Object(a.jsxs)(Xo,{label:"Play",children:[Object(a.jsx)(eA,{onClick:i,label:"File...",hotkey:"L"}),null!=e&&e.map((e,n)=>(t||!e.requiresNetwork)&&Object(a.jsx)(eA,{onClick:async()=>{let t;try{t=await e.filePicker()}catch(e){console.error("Error loading from file picker",e)}A(t||[],R)},label:e.contextMenuName},n))]}),Object(a.jsx)(Zo,{}),Object.keys(n).map(e=>Object(a.jsx)(eA,{label:n[e].title,checked:n[e].open,onClick:()=>s(e),hotkey:n[e].hotkey},e)),Object(a.jsx)(Zo,{}),Object(a.jsx)(cA,{}),Object(a.jsx)(Zo,{}),Object(a.jsx)(Xo,{label:"Options",children:Object(a.jsx)(dA,{})}),Object(a.jsx)(Xo,{label:"Playback",children:Object(a.jsx)(uA,{})}),Object(a.jsx)(Zo,{}),Object(a.jsx)(eA,{onClick:r,label:"Exit"})]})});function fA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pA(e){for(var t=1;t{const n=jr(e,t);return void 0!==n.x||void 0!==n.y};function mA(e){const t=So(Vn),n=So(un),r=So(nr),i=Io(Zr),[a,A]=Object(o.useState)(null);return Object(o.useEffect)(()=>{if(null==a)return;const{boundingBox:e,moving:t,stationary:n,mouseStart:o}=a,s=a=>{const A={x:Se(a)-o.x,y:Ie(a)-o.y},s=t.map(e=>pA(pA({},e),Fr(e,A))),l=pA(pA({},e),Fr(e,A)),u=((e,t)=>{let n=0,r=0;for(const i of e)for(const e of t){const t=Rr(i,e);if(n=n||t.x,r=r||t.y,void 0!==n&&n>0&&void 0!==r&&r>0)break}return{x:n,y:r}})(s,n),c=((e,t)=>{const n=((e,t)=>{let n,r;return e.x-15<0?n=0:e.x+e.width+15>t.width&&(n=t.width-e.width),e.y-15<0?r=0:e.y+e.height+15>t.height&&(r=t.height-e.height),{x:n,y:r}})(e,t);return{x:void 0===n.x?0:n.x-e.x,y:void 0===n.y?0:n.y-e.y}})(l,r),d=((e,...t)=>{const n=t.reduce((e,t)=>({x:0===e.x||0===t.x?e.x+t.x:Math.min(e.x,t.x),y:0===e.y||0===t.y?e.y+t.y:Math.min(e.y,t.y)}));return Fr(e,n)})(A,u,c),h={};t.forEach(e=>{h[e.key]=Fr(e,d)}),i(h,!1)};function l(){A(null)}return window.addEventListener("mouseup",l),window.addEventListener("touchend",l),window.addEventListener("mousemove",s,{passive:!1}),window.addEventListener("touchmove",s,{passive:!1}),()=>{window.removeEventListener("mousemove",s),window.removeEventListener("touchmove",s),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l)}},[r,a,i]),Object(o.useCallback)((r,i)=>{if(!i.target.classList.contains("draggable"))return;const a=Se(i),o=Ie(i);if(n(r))return;const s=t.filter(t=>null!=e[t.key]&&!n(t.key)),l=s.find(e=>e.key===r);if(null==l)throw new Error("Tried to move a node that does not exist: "+r);let u=new Set([l]);if("main"===r){const e=(c=gA,(e,t)=>{const n=new Set,r=t=>{for(const i of e)!n.has(i)&&c(i,t)&&(n.add(i),r(i))};return r(t),n});u=e(s,l)}var c;const d=s.filter(e=>!u.has(e)),h=Array.from(u),f={x:a,y:o},p=(e=>{const t=e.slice(),n=t.pop();if(null==n)throw new Error("boundingBox must be called with at least one node");const r={top:Mr(n),right:Dr(n),bottom:Nr(n),left:_r(n)};return t.forEach(e=>{r.top=Math.min(r.top,Mr(e)),r.right=Math.max(r.right,Dr(e)),r.bottom=Math.max(r.bottom,Nr(e)),r.left=Math.min(r.left,_r(e))}),{x:r.left,y:r.top,width:r.right-r.left,height:r.bottom-r.top}})(h);A({boundingBox:p,moving:h,stationary:d,mouseStart:f})},[n,e,t])}function bA({windows:e}){const t=So(Vn),n=Io(Jr),r=mA(e),i=t.filter(t=>e[t.key]),A=Object(o.useCallback)(e=>{const{currentTarget:t,relatedTarget:r}=e;t===r||t.contains(r)||n(null)},[n]);return Object(a.jsx)(a.Fragment,{children:i.map(t=>Object(a.jsx)("div",{onBlur:A,onMouseDown:e=>{r(t.key,e)},onTouchStart:e=>{r(t.key,e)},style:{position:"absolute",top:0,left:0,transform:`translate(${t.x}px, ${t.y}px)`,touchAction:"none"},children:e[t.key]},t.key))})}var EA=n(40),wA=n.n(EA);function yA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vA(e){for(var t=1;t"character-"+wA()(e.toString()).toLowerCase().charCodeAt(0);var SA=o.memo(e=>{let{children:t,className:n}=e,r=Me()(e,["children","className"]);return Object(a.jsx)("span",vA(vA({},r),{},{className:`${n||""} character ${kA(t)}`,children:t}))});n(88);const IA=()=>Object(a.jsx)(o.Fragment,{children:[1,7,12,20,25].map((e,t)=>Object(a.jsx)(SA,{style:{left:e},className:"background-character",children:" "},t))});var OA=()=>{const e=So(In),t=So(vn),n=So(er),r=So(Cr),i=Io(bi);let o=null;e!==X&&null!=t&&(o=r===q?n:t-n);const A=te(o),s=r===W&&e!==X;return Object(a.jsxs)("div",{onClick:i,className:Co()("mini-time","countdown",{blinking:e===$}),children:[Object(a.jsx)(IA,{}),Object(a.jsx)(SA,{style:{left:1},children:s?"-":" "}),Object(a.jsx)(SA,{style:{left:7},children:A.minutesFirstDigit}),Object(a.jsx)(SA,{style:{left:12},children:A.minutesSecondDigit}),Object(a.jsx)(SA,{style:{left:20},children:A.secondsFirstDigit}),Object(a.jsx)(SA,{style:{left:25},children:A.secondsSecondDigit})]})};function TA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function CA(e){for(var t=1;t{if(n)return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)};function e(e){n&&e.target instanceof Element&&n&&t.current&&!t.current.contains(e.target)&&r(!1)}},[n]);const i=Object(o.useMemo)(()=>n?function(e){if(null==e)return{top:0,left:0};const t=e.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop;return{top:t.top+r,left:t.left+n}}(t.current):{top:0,left:0},[n]),{renderMenu:A,children:s,top:l,bottom:u}=e,c=Me()(e,["renderMenu","children","top","bottom"]);return Object(a.jsxs)("div",UA(UA({},c),{},{children:[Object(a.jsx)("div",{className:"handle",style:{width:"100%",height:"100%"},ref:t,onClick:()=>r(!n),children:s}),Object(a.jsx)(tA,{selected:n,offsetTop:i.top,offsetLeft:i.left,top:l,bottom:u,children:A()})]}))};function NA(e,t,n){const r=t*n,i=r+t;let a=0;for(let t=r;tfunction(e,t,n){const r=document.createElement("canvas");r.width=6,r.height=e;const i=t.slice(2,18),a=r.getContext("2d");if(null==a)throw new Error("Could not construct canvas context");const o=16/n;for(let t=0;t{if(o=2*Math.ceil(o),A=2*Math.ceil(A),o>0||A>0){const s=t-o,l=6;if(t>0&&e.drawImage(i,0,s,l,t,a,s,l,t),!r){const r=t-A;e.fillStyle=n[23],e.fillRect(a,r,l,2)}}},[i,n,t,r])}function DA({renderHeight:e,height:t,analyser:n}){const[r]=Object(o.useState)(()=>new Array(20).fill(0)),[i]=Object(o.useState)(()=>new Array(20).fill(0)),a=n.frequencyBinCount,A=Object(o.useMemo)(()=>function(e){const t=new Array(20).fill(0),n=Math.pow(110.25,.05);t[0]=0,t[1]=200;for(let e=2;e<19;e++)t[e]=t[e-1]*n;t[19]=22050;for(let n=0;n<20;n++){const r=Math.floor(t[n]/22050*e);t[n]=r}return t}(a),[a]),s=Object(o.useMemo)(()=>new Uint8Array(a),[a]),l=_A({height:t,renderHeight:e});return Object(o.useCallback)(t=>{n.getByteFrequencyData(s);const a=e/256;for(let e=0;e<19;e++){const n=A[e],o=A[e+1];let u=0;for(let e=n;e{e.fftSize=2048},[e.fftSize]);const t=So(Yn),n=So(Jn),r=So(In),i=So(cn),A=So(Ir),s=Io(to),l=i("main"),u=l?38:76,c=l?5:16,d=2*u,h=2*c,f=Object(o.useMemo)(()=>function(e,t,n,r,i){const a=document.createElement("canvas");a.width=e,a.height=t;const o=a.getContext("2d");if(null==o)throw new Error("Could not construct canvas context");if(o.fillStyle=n,o.fillRect(0,0,e,t),!i){o.fillStyle=r;for(let n=0;nnew Uint8Array(a),[a]);return Object(o.useCallback)(o=>{e.getByteTimeDomainData(A),o.lineWidth=2,o.strokeStyle=i[18];const s=2*Math.floor(a/n),l=t;o.beginPath();for(let e=0;e<=r;e++){const t=(1-NA(A,s,e)/255)*l,n=2*e;0===n?o.moveTo(n,t):o.lineTo(n,t)}o.stroke()},[e,a,i,A,t,r,n])}({analyser:e,height:h,width:d,renderWidth:u}),g=DA({analyser:e,height:h,renderHeight:c}),m=_A({height:h,renderHeight:c}),b=Object(o.useCallback)(e=>{if(r===Z){if(A)return e.drawImage(f,0,0),void Object.entries(A).forEach(([t,n])=>{m(e,Number(t),n,-1)});switch(n){case K:e.drawImage(f,0,0),p(e);break;case Y:e.drawImage(f,0,0),g(e);break;default:e.clearRect(0,0,d,h)}}},[f,A,h,m,g,p,r,n,d]),[E,w]=Object(o.useState)(null);return Object(o.useLayoutEffect)(()=>{if(null==E)return;const e=E.getContext("2d");if(null==e)return;e.imageSmoothingEnabled=!1;let t=null;const n=()=>{b(e),t=window.requestAnimationFrame(n)};return n(),()=>{null!=t&&window.cancelAnimationFrame(t)}},[E,b]),r===X?null:Object(a.jsx)("canvas",{id:"visualizer",ref:w,style:{width:u,height:c},width:d,height:h,onClick:s})};var jA=Object(o.memo)(()=>{const e=Io(si),t=Io(ri),n=Io(ii),r=Io(Ai),i=Io(ai);return Object(a.jsxs)("div",{className:"actions",children:[Object(a.jsx)("div",{id:"previous",onClick:e,title:"Previous Track"}),Object(a.jsx)("div",{id:"play",onClick:t,title:"Play"}),Object(a.jsx)("div",{id:"pause",onClick:n,title:"Pause"}),Object(a.jsx)("div",{id:"stop",onClick:i,title:"Stop"}),Object(a.jsx)("div",{id:"next",onClick:r,title:"Next Track"})]})});function RA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function FA(e){for(var t=1;ti(Number(e.target.value)),onMouseDown:()=>o("balance"),onMouseUp:A,title:"Balance"})}const QA=e=>{const t=Math.abs(e)/100;return 15*Math.floor(27*t)};var zA=Object(o.memo)(()=>{const e=So(Wn);return Object(a.jsx)(PA,{id:"balance",style:{backgroundPosition:`0 -${QA(e)}px`}})});var VA=Object(o.memo)(()=>{const e=Io(eo);return Object(a.jsx)(xA,{id:"close",onClick:e,title:"Close"})});function GA(){return ro("double")}function KA(){return e=>{e(Vr()),e({type:"UNSET_FOCUS"})}}var YA=Object(o.memo)(()=>{const e=Io(GA),t=Io(KA),n=So(jn);return Object(a.jsxs)("div",{id:"clutter-bar",children:[Object(a.jsx)(MA,{bottom:!0,renderMenu:()=>Object(a.jsx)(dA,{}),children:Object(a.jsx)("div",{id:"button-o"})}),Object(a.jsx)("div",{id:"button-a"}),Object(a.jsx)("div",{id:"button-i"}),Object(a.jsx)("div",{title:"Toggle Doublesize Mode",id:"button-d",className:Co()({selected:n}),onMouseUp:t,onMouseDown:e}),Object(a.jsx)("div",{id:"button-v"})]})});var HA=Object(o.memo)(()=>{const e=Io(Oa);return Object(a.jsx)("div",{id:"eject",onClick:e,title:"Open File(s)"})});function JA(){return Wr("equalizer")}var qA=Object(o.memo)(()=>{const e=Io(JA),t=So(ln)("equalizer");return Object(a.jsx)("div",{id:"equalizer-button",className:Co()({selected:t}),onClick:e,title:"Toggle Graphical Equalizer"})});function WA(){return Wr("playlist")}var ZA=Object(o.memo)(()=>{const e=So(ln)("playlist"),t=Io(WA);return Object(a.jsx)("div",{id:"playlist-button",className:Co()({selected:e}),onClick:t,title:"Toggle Playlist Editor"})});var XA=Object(o.memo)(e=>{const t=(""+e.children||"").split("");return Object(a.jsx)(o.Fragment,{children:t.map((e,t)=>Object(a.jsx)(SA,{children:e},t+e))})});var $A=Object(o.memo)(()=>{const e=So(sr);return Object(a.jsx)("div",{id:"kbps",children:Object(a.jsx)(XA,{children:e||""})})});var es=Object(o.memo)(()=>{const e=So(lr);return Object(a.jsx)("div",{id:"khz",children:Object(a.jsx)(XA,{children:e||""})})});const ts=e=>e.length>=31,ns=e=>ts(e)?`${e} *** ${e}`:e.padEnd(31," ");var rs=o.memo(()=>{const e=So(Ar),t=So(jn),n=So(Or),r=Io(co),{handleMouseDown:i,dragOffset:A,dragging:s}=function(){const[e,t]=o.useState(null),[n,r]=o.useState(0);return o.useEffect(()=>{if(null==e)return;const n=e,i=e=>{const t=Se(e)-n;r(-t)};let a=!1;const o=()=>{a||(document.removeEventListener("mousemove",i),document.removeEventListener("touchmove",i),document.removeEventListener("mouseup",o),document.removeEventListener("touchend",o),t(null),a=!0)};return document.addEventListener("mousemove",i),document.addEventListener("touchmove",i),document.addEventListener("touseup",o),document.addEventListener("touchend",o),o},[e]),{handleMouseDown:o.useCallback(e=>{t(Se(e))},[]),dragOffset:n,dragging:null!=e}}(),l=((e,t,n)=>{if(!ts(e))return 0;const r=5*t+n,i=5*(e.length+" *** ".length);return(r%(a=i)+a)%a;var a})(e,n,A),u=-l+"px";return function({step:e,dragging:t}){const[n,r]=o.useState(!0);o.useEffect(()=>{if(!1===n)return;const t=setInterval(e,220);return()=>clearInterval(t)},[e,n]),o.useEffect(()=>{if(t)return void r(!1);const e=window.setTimeout(()=>{r(!0)},1e3);return()=>{window.clearTimeout(e)}},[t])}({step:r,dragging:s}),Object(a.jsx)("div",{id:"marquee",className:"text",onMouseDown:i,onTouchStart:i,title:"Song Title",children:Object(a.jsx)("div",{style:{whiteSpace:"nowrap",willChange:"transform",transform:`translateX(${u})`},children:Object(a.jsx)(XA,{children:ns(e)})},t?"doubled":"not-doubled")})});var is=Object(o.memo)(()=>{const e=So($n);return Object(a.jsxs)("div",{className:"mono-stereo",children:[Object(a.jsx)("div",{id:"stereo",className:Co()({selected:2===e})}),Object(a.jsx)("div",{id:"mono",className:Co()({selected:1===e})})]})});var as=Object(o.memo)(()=>{const[e,t]=function(){const e=So(vn),t=So(er),n=e?Math.floor(t)/e*100:0,r=So(or);return[n,"position"===So(ar)?r:n]}(),n=Oo(),r=Object(o.useCallback)(e=>{n({type:"SEEK_TO_PERCENT_COMPLETE",percent:Number(e.target.value)}),n({type:"UNSET_FOCUS"})},[n]),i=Object(o.useCallback)(e=>{n({type:"SET_FOCUS",input:"position"}),n({type:"SET_SCRUB_POSITION",position:Number(e.target.value)})},[n]);let A="";return e<=33?A="left":e>=66&&(A="right"),Object(a.jsx)("input",{id:"position",className:A,type:"range",min:"0",max:"100",step:"1",style:{touchAction:"none"},value:t,onInput:i,onChange:()=>{},onMouseUp:r,onMouseDown:i,title:"Seeking Bar"})});var os=Object(o.memo)(()=>{const e=So(Xn),t=Io(gi);return Object(a.jsx)(iA,{renderContents:()=>Object(a.jsx)(eA,{checked:e,label:"Repeat",onClick:t,hotkey:"(R)"}),children:Object(a.jsx)("div",{id:"repeat",className:Co()({selected:e}),onClick:t,title:"Toggle Repeat"})})});var As=Object(o.memo)(()=>{const e=Io(Kr);return Object(a.jsx)(xA,{id:"shade",onMouseDown:e,onDoubleClick:e=>e.stopPropagation(),title:"Toggle Windowshade Mode"})});var ss=Object(o.memo)(()=>{const e=Io(no);return Object(a.jsx)(xA,{id:"minimize",title:"Minimize",onClick:e})});var ls=Object(o.memo)(()=>{const e=So(Zn),t=Io(mi);return Object(a.jsx)(iA,{renderContents:()=>Object(a.jsx)(eA,{checked:e,label:"Shuffle",onClick:t,hotkey:"(S)"}),children:Object(a.jsx)("div",{id:"shuffle",className:Co()({selected:e}),onClick:t,title:"Toggle Shuffle"})})});var us=Object(o.memo)(()=>{const e=Io(bi),t=So(er),n=So(vn)||0,r=So(Cr),i=te(r===q?t:n-t);return Object(a.jsxs)("div",{id:"time",onClick:e,className:"countdown",children:[r===W&&Object(a.jsx)("div",{id:"minus-sign"}),Object(a.jsx)("div",{id:"minute-first-digit",className:"digit digit-"+i.minutesFirstDigit}),Object(a.jsx)("div",{id:"minute-second-digit",className:"digit digit-"+i.minutesSecondDigit}),Object(a.jsx)("div",{id:"second-first-digit",className:"digit digit-"+i.secondsFirstDigit}),Object(a.jsx)("div",{id:"second-second-digit",className:"digit digit-"+i.secondsSecondDigit})]})});function cs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ds(e){for(var t=1;tA(Number(e.target.value)),onMouseDown:()=>i("volume"),onTouchStart:()=>{i("volume")},onMouseUp:o,onTouchEnd:o,title:"Volume Bar"})}var fs=Object(o.memo)(()=>{const e=So(qn)/100,t={backgroundPosition:`0 -${15*(Math.round(28*e)-1)}px`};return Object(a.jsx)("div",{id:"volume",style:t,children:Object(a.jsx)(hs,{})})});n(90);function ps(e){return xa(e,R)}var gs=o.memo(({analyser:e,filePickers:t})=>{const n=So(cn)("main"),r=So(In),i=So(Ln),o=So(xr),A=So(jn),s=So(Rn),l=So(Br),u=Co()({window:!0,play:r===Z,stop:r===X,pause:r===$,selected:i===N,shade:n,draggable:!0,loading:o,doubled:A,llama:s}),c=Io(Kr),d=Io(fi),h=Io(ps);return Object(a.jsx)(Ho,{id:"main-window",windowId:N,className:u,handleDrop:h,onWheel:d,children:Object(a.jsxs)(Uo,{windowId:N,children:[Object(a.jsxs)("div",{id:"title-bar",className:"selected draggable",onDoubleClick:c,children:[Object(a.jsx)(MA,{id:"option-context",bottom:!0,renderMenu:()=>Object(a.jsx)(hA,{filePickers:t}),children:Object(a.jsx)(xA,{id:"option",title:"Winamp Menu"})}),n&&Object(a.jsx)(OA,{}),Object(a.jsx)(ss,{}),Object(a.jsx)(As,{}),Object(a.jsx)(VA,{})]}),Object(a.jsxs)("div",{className:"webamp-status",children:[Object(a.jsx)(YA,{}),!l&&Object(a.jsx)("div",{id:"play-pause"}),Object(a.jsx)("div",{id:"work-indicator",className:Co()({selected:l})}),Object(a.jsx)(us,{})]}),Object(a.jsx)(LA,{analyser:e}),Object(a.jsxs)("div",{className:"media-info",children:[Object(a.jsx)(rs,{}),Object(a.jsx)($A,{}),Object(a.jsx)(es,{}),Object(a.jsx)(is,{})]}),Object(a.jsx)(fs,{}),Object(a.jsx)(zA,{}),Object(a.jsxs)("div",{className:"windows",children:[Object(a.jsx)(qA,{}),Object(a.jsx)(ZA,{})]}),Object(a.jsx)(as,{}),Object(a.jsx)(jA,{}),Object(a.jsx)(HA,{}),Object(a.jsxs)("div",{className:"shuffle-repeat",children:[Object(a.jsx)(ls,{}),Object(a.jsx)(os,{})]}),Object(a.jsx)("a",{id:"about",target:"_blank",href:"https://webamp.org/about",title:"About"})]})})});var ms=function({widthOnly:e}){const t=So(dn),n=Io(qr),r=t("playlist");return Object(a.jsx)(Bo,{currentSize:r,id:"playlist-resize-target",setWindowSize:e=>{n("playlist",e)},widthOnly:e})};var bs=function(){const e=So(Ln),t=So(dn)("playlist"),n=So(vn),r=So(Bn),i=Io(Hr),A=Io(Yr),s=Io(Jr),l=25*t[0],u=Object(o.useMemo)(()=>{if(null==r)return"[No file]";const e=(205+l)/5;return r.length>e?r.slice(0,e-1)+"…":r},[l,r]),c=Object(o.useMemo)(()=>null==r?"":ne(n),[n,r]);return Object(a.jsx)("div",{id:"playlist-window-shade",className:Co()("window","draggable",{selected:e===_}),style:{width:275+l+"px"},onMouseDown:()=>s("playlist"),onDoubleClick:A,children:Object(a.jsx)("div",{className:"left",children:Object(a.jsxs)("div",{className:"right draggable",children:[Object(a.jsx)("div",{id:"playlist-shade-track-title",children:Object(a.jsx)(XA,{children:u})}),Object(a.jsx)("div",{id:"playlist-shade-time",children:Object(a.jsx)(XA,{children:c})}),Object(a.jsx)(ms,{widthOnly:!0}),Object(a.jsx)("div",{id:"playlist-shade-button",onClick:A}),Object(a.jsx)("div",{id:"playlist-close-button",onClick:()=>i("playlist")})]})})})};var Es=Object(o.memo)((function({children:e}){const{ref:t,hover:n}=ko();return Object(a.jsx)("li",{ref:t,className:Co()({hover:n}),children:e})}));var ws=Object(o.memo)((function(e){const[t,n]=Object(o.useState)(!1),[r,i]=Object(o.useState)(null),A=Object(o.useCallback)(()=>{setTimeout(()=>{n(!1)},0)},[]);return function(e,t){Object(o.useEffect)(()=>{if(null==e||null==t)return;const n=r=>{const i=r.target;i instanceof Element&&(e.contains(i)||(t(),window.document.removeEventListener("click",n,{capture:!0})))};return window.document.addEventListener("click",n,{capture:!0}),()=>{window.document.removeEventListener("click",n,{capture:!0})}},[e,t])}(r,t?A:null),Object(a.jsxs)("div",{id:e.id,className:Co()("playlist-menu",{selected:t}),ref:i,onClick:()=>n(e=>!e),children:[Object(a.jsx)("div",{className:"bar"}),t&&Object(a.jsx)("ul",{children:o.Children.map(e.children,(e,t)=>Object(a.jsx)(Es,{children:e},t))})]})}));var ys=()=>{const e=So(Ht),t=Io(Ra),n=Io(ja),r=Io(Fa);return Object(a.jsxs)(ws,{id:"playlist-add-menu",children:[Object(a.jsx)("div",{className:"add-url",onClick:()=>r(e)}),Object(a.jsx)("div",{className:"add-dir",onClick:()=>t(e)}),Object(a.jsx)("div",{className:"add-file",onClick:()=>n(e)})]})};var vs=()=>{const e=Io(ra),t=Io(ia),n=Io(na);return Object(a.jsxs)(ws,{id:"playlist-remove-menu",children:[Object(a.jsx)("div",{className:"remove-misc",onClick:()=>alert("Not supported in Webamp")}),Object(a.jsx)("div",{className:"remove-all",onClick:t}),Object(a.jsx)("div",{className:"crop",onClick:n}),Object(a.jsx)("div",{className:"remove-selected",onClick:e})]})};function ks(){const e=Io(fa),t=Io(pa),n=Io(ga);return Object(a.jsxs)(ws,{id:"playlist-selection-menu",children:[Object(a.jsx)("div",{className:"invert-selection",onClick:e}),Object(a.jsx)("div",{className:"select-zero",onClick:t}),Object(a.jsx)("div",{className:"select-all",onClick:n})]})}function Ss(){const e=Io(aa),t=Io(oa),n=Io(Aa);return Object(a.jsx)(MA,{style:{width:"100%",height:"100%"},top:!0,renderMenu:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(eA,{label:"Sort list by title",onClick:n}),Object(a.jsx)(Zo,{}),Object(a.jsx)(eA,{label:"Reverse list",onClick:e}),Object(a.jsx)(eA,{label:"Randomize list",onClick:t})]}),children:Object(a.jsx)("div",{})})}var Is=()=>{const e=Io(_a);return Object(a.jsx)(MA,{style:{width:"100%",height:"100%"},top:!0,renderMenu:()=>Object(a.jsx)(eA,{onClick:e,label:"Generate HTML playlist"}),children:Object(a.jsx)("div",{})})};var Os=()=>Object(a.jsxs)(ws,{id:"playlist-misc-menu",children:[Object(a.jsx)("div",{className:"sort-list",onClick:e=>e.stopPropagation(),children:Object(a.jsx)(Ss,{})}),Object(a.jsx)("div",{className:"file-info",onClick:()=>alert("Not supported in Webamp")}),Object(a.jsx)("div",{className:"misc-options",onClick:e=>e.stopPropagation(),children:Object(a.jsx)(Is,{})})]});function Ts(){const e=Io(ia),t=Io(Pa),n=Io(Qa);return Object(a.jsxs)(ws,{id:"playlist-list-menu",children:[Object(a.jsx)("div",{className:"new-list",onClick:e}),Object(a.jsx)("div",{className:"save-list",onClick:n}),Object(a.jsx)("div",{className:"load-list",onClick:t})]})}var Cs=()=>{const e=So(nn),t=Object(o.useMemo)(()=>function(e,t,n){for(;e.length{const e=Io(ri),t=Io(ii),n=Io(ai),r=Io(Oa),i=Io(Ai),A=Io(si);return Object(a.jsxs)(o.Fragment,{children:[Object(a.jsx)(Cs,{}),Object(a.jsxs)("div",{className:"playlist-action-buttons",children:[Object(a.jsx)("div",{className:"playlist-previous-button",onClick:A}),Object(a.jsx)("div",{className:"playlist-play-button",onClick:e}),Object(a.jsx)("div",{className:"playlist-pause-button",onClick:t}),Object(a.jsx)("div",{className:"playlist-stop-button",onClick:n}),Object(a.jsx)("div",{className:"playlist-next-button",onClick:i}),Object(a.jsx)("div",{className:"playlist-eject-button",onClick:r})]}),Object(a.jsx)(OA,{})]})};var Bs=function({children:e,handleMoveClick:t,index:n,id:r}){const i=So(Hn),A=So(Zt),s=So(on),l=A.has(r),u=s===r,c=Oo(),d=Io(ni),h=Object(o.useCallback)(e=>e.shiftKey?(e.preventDefault(),void c({type:"SHIFT_CLICKED_TRACK",index:n})):e.metaKey||e.ctrlKey?(e.preventDefault(),void c({type:"CTRL_CLICKED_TRACK",index:n})):(l||c({type:"CLICKED_TRACK",index:n}),void t(e)),[c,t,n,l]),f=Object(o.useCallback)(e=>{function i(){d(r)}l||c({type:"CLICKED_TRACK",index:n}),t(e),e.target.addEventListener("touchstart",i),setTimeout(()=>{e.target.removeEventListener("touchstart",i)},250)},[c,t,r,n,d,l]),p={backgroundColor:l?i.selectedbg:void 0,color:u?i.current:void 0};return Object(a.jsx)("div",{className:Co()("track-cell",{selected:l,current:u}),style:p,onClick:e=>e.stopPropagation(),onMouseDown:h,onTouchStart:f,onContextMenu:e=>e.preventDefault(),onDoubleClick:()=>d(r),children:e})};var Us=({id:e,paddedTrackNumber:t})=>{const n=So(kn)(e);return Object(a.jsxs)("span",{children:[t,". ",n]})};var Ms=function(){const e=So(bn),t=So(En),n=So(Gt),r=So(Mn),i=Io(pa),A=Io(ha),s=Io(ua),[l,u]=Object(o.useState)(null),[c,d]=Object(o.useState)(!1),[h,f]=Object(o.useState)(null),p=e=>{d(!0),f(Ie(e))};function g(n){return t.map((t,r)=>Object(a.jsx)(Bs,{id:t,index:e+r,handleMoveClick:p,children:n(t,r)},t))}Object(o.useEffect)(()=>{if(null==l||null==h||!1===c)return;const{top:e,bottom:t,left:n,right:r}=l.getBoundingClientRect();let i=0;const a=a=>{const o=Se(a),s=Ie(a);if(st||or)return;const l=Math.floor((s-h)/13);if(l!==i){A(l-i),i=l}},o=()=>d(!1);return window.addEventListener("mouseup",o),window.addEventListener("mousemove",a),window.addEventListener("touchend",o),window.addEventListener("touchmove",a),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("touchmove",a),window.removeEventListener("mouseup",o),window.removeEventListener("touchend",o)}},[c]);const m=r.toString().length,b=t=>(t+1+e).toString().padStart(m," ");return Object(o.useEffect)(()=>{if(null!=l)return l.addEventListener("wheel",s,{passive:!1}),()=>{l.removeEventListener("wheel",s)}},[l,s]),Object(a.jsxs)("div",{ref:u,className:"playlist-tracks",style:{height:"100%",userSelect:"none"},onClick:i,children:[Object(a.jsx)("div",{className:"playlist-track-titles",children:g((e,t)=>Object(a.jsx)(Us,{id:e,paddedTrackNumber:b(t)}))}),Object(a.jsx)("div",{className:"playlist-track-durations",children:g(e=>ne(n[e].duration))})]})};function Ns({value:e,height:t,width:n,handle:r,handleHeight:i,onBeforeChange:A,onChange:s,onAfterChange:l,disabled:u}){const c=Object(o.useRef)(null),d=Object(o.useRef)(null);function h({target:e,clientY:t,touch:n}){const r=c.current,i=d.current;if(null==r||null==i)return null;const a=r.getBoundingClientRect(),o=i.getBoundingClientRect(),{top:u,height:h}=a,{top:f,height:p}=o,g=u+(i.contains(e)?t-f:p/2),m=h-p;function b(e){s(oe((e-g)/m,0,1))}if(n){const e=e=>{e.cancelable&&e.preventDefault(),b(e.touches[0].clientY)},t=()=>{null!=l&&l(),document.removeEventListener("touchmove",e),document.removeEventListener("touchend",t)};document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchend",t)}else{const e=e=>{e.preventDefault(),b(e.clientY)},t=()=>{null!=l&&l(),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)};document.addEventListener("mousemove",e),document.addEventListener("mouseup",t)}null!=A&&A(),b(t)}const f=Math.floor((t-i)*e);return Object(a.jsx)("div",{style:{height:t,width:n},onMouseDown:u?void 0:function(e){e.preventDefault(),h({target:e.target,clientY:e.clientY,touch:!1})},onTouchStart:u?void 0:function(e){h({target:e.target,clientY:e.touches[0].clientY,touch:!0})},ref:c,children:Object(a.jsx)("div",{style:{transform:`translateY(${f}px)`},ref:d,children:r})})}const _s=()=>Object(a.jsx)("div",{className:"playlist-scrollbar-handle",style:{height:18}});function Ds(){const e=So(Qn)(_).height,t=So(mn),n=So(wn),r=Io(sa);return Object(a.jsx)("div",{className:"playlist-scrollbar",style:{marginLeft:5},children:Object(a.jsx)(Ns,{height:e-58,handleHeight:18,width:8,value:t/100,onChange:e=>r(100*e),handle:Object(a.jsx)(_s,{}),disabled:n})})}n(92);function Ls(e){return e.playlist.trackOrder.length-1}var js=function({analyser:e}){const t=So(bn),n=So(dn),r=So(Ln),i=So(cn),A=So(ln),s=So(Ls),l=So(Hn),u=So(Qn),c=r===_,d=Boolean(i(_)),h=n(_),f=u(_),p=Io(Hr),g=Io(Yr),m=Io(ca),b=Io(da),E=Io(fi),w=Io(xa),y=h[0]>2,v=!A(N),k=Object(o.useCallback)((e,n)=>{const r=e.clientY-n.y,i=oe(t+Math.round((r-23)/13),0,s+1);w(e,F,i)},[w,s,t]);if(d)return Object(a.jsx)(bs,{});const S={color:l.normal,backgroundColor:l.normalbg,fontFamily:l.font+", Arial, sans-serif",height:f.height+"px",width:f.width+"px"},I=Co()("window","draggable",{selected:c}),O=h[0]%2==0;return Object(a.jsx)(Uo,{windowId:_,children:Object(a.jsxs)(Ho,{id:"playlist-window",windowId:_,className:I,style:S,handleDrop:k,onWheel:E,children:[Object(a.jsxs)("div",{className:"playlist-top draggable",onDoubleClick:g,children:[Object(a.jsx)("div",{className:"playlist-top-left draggable"}),O&&Object(a.jsx)("div",{className:"playlist-top-left-spacer draggable"}),Object(a.jsx)("div",{className:"playlist-top-left-fill draggable"}),Object(a.jsx)("div",{className:"playlist-top-title draggable"}),O&&Object(a.jsx)("div",{className:"playlist-top-right-spacer draggable"}),Object(a.jsx)("div",{className:"playlist-top-right-fill draggable"}),Object(a.jsxs)("div",{className:"playlist-top-right draggable",children:[Object(a.jsx)("div",{id:"playlist-shade-button",onClick:g}),Object(a.jsx)("div",{id:"playlist-close-button",onClick:()=>p(_)})]})]}),Object(a.jsxs)("div",{className:"playlist-middle draggable",children:[Object(a.jsx)("div",{className:"playlist-middle-left draggable"}),Object(a.jsx)("div",{className:"playlist-middle-center",children:Object(a.jsx)(Ms,{})}),Object(a.jsx)("div",{className:"playlist-middle-right draggable",children:Object(a.jsx)(Ds,{})})]}),Object(a.jsxs)("div",{className:"playlist-bottom draggable",children:[Object(a.jsxs)("div",{className:"playlist-bottom-left draggable",children:[Object(a.jsx)(ys,{}),Object(a.jsx)(vs,{}),Object(a.jsx)(ks,{}),Object(a.jsx)(Os,{})]}),Object(a.jsx)("div",{className:"playlist-bottom-center draggable"}),Object(a.jsxs)("div",{className:"playlist-bottom-right draggable",children:[y&&Object(a.jsx)("div",{className:"playlist-visualizer",children:v&&Object(a.jsx)("div",{className:"visualizer-wrapper",children:Object(a.jsx)(LA,{analyser:e})})}),Object(a.jsx)(xs,{}),Object(a.jsx)(Ts,{}),Object(a.jsx)("div",{id:"playlist-scroll-up-button",onClick:m}),Object(a.jsx)("div",{id:"playlist-scroll-down-button",onClick:b}),Object(a.jsx)(ms,{})]})]})]})})};const Rs=()=>Object(a.jsx)("div",{style:{width:11,height:11,marginLeft:1},className:"slider-handle"});function Fs({id:e,onChange:t,band:n}){const r=So(zt)[n],i=Object(o.useMemo)(()=>{const{x:e,y:t}={x:(n=(e=>{const t=e/100;return Math.round(27*t)})(r))%14,y:Math.floor(n/14)};var n;return`-${15*e}px -${65*t}px`},[r]),A=Io(ao),s=Io(io);return Object(a.jsx)("div",{id:e,className:"band",style:{backgroundPosition:i,height:63},children:Object(a.jsx)(Ns,{height:62,width:14,handleHeight:11,value:1-r/100,onBeforeChange:()=>A(n),onChange:e=>t(100*(1-e)),onAfterChange:s,handle:Object(a.jsx)(Rs,{})})})}var Ps=()=>{const e=Io(Oi),t=So(tr);return Object(a.jsx)("div",{id:"on",className:Co()({selected:t}),onClick:e})};var Qs=Object(o.memo)(()=>{const e=So(e=>e.equalizer.auto),t=Io(Ti);return Object(a.jsx)("div",{id:"auto",className:Co()({selected:e}),onClick:t})});function zs(e,t){const n=function(e,t){const n=e.map(()=>0),r=e.length-1,i=function(e,t){const n=[];for(let r=0;ri&&(r=a,i=e[a][t]);Vs(e,t,r);for(let r=t+1;r=0;r--){const i=e[r][n]/e[r][r];t[r]=i;for(let t=r-1;t>=0;t--)e[t][n]-=e[t][r]*i,e[t][r]=0}return t}(i,n)}(e,t),r=e[e.length-1],i=[];let a=1;for(let o=0;o<=r;o++){for(;e[a]{var e;return null!==(e=null==n?void 0:n.getContext("2d"))&&void 0!==e?e:null},[n]),A=function(e){const t=Eo(So(Sr));return Object(o.useMemo)(()=>null==e||null==t?null:e.createPattern(t,"repeat-x"),[e,t])}(i);return Object(o.useLayoutEffect)(()=>{if(null==i||null==n||null==t||null==A)return;const r=Number(n.width),a=Number(n.height);i.clearRect(0,0,r,a),function({colorPattern:e,sliders:t,canvasCtx:n,preampLineImage:r}){const i=ue(t.preamp/100,0,18);n.drawImage(r,0,i,r.width,r.height);const a=M.map(e=>t[e]);n.fillStyle=e;const o=[],A=[];a.forEach((e,t)=>{const n=(100-e)/100;o.push(12*t),A.push(ue(n,0,18))});const s=zs(o,A),l=o[o.length-1];let u=A[0];for(let e=0;e<=l;e++){const t=oe(Math.round(s[e]),0,18),r=Math.min(t,u),i=1+Math.abs(u-t);n.fillRect(2+e,r,1,i),u=t}}({colorPattern:A,sliders:e,canvasCtx:i,preampLineImage:t})},[i,n,A,t,e]),Object(a.jsx)("canvas",{id:"eqGraph",ref:r,width:113,height:19})},Ks=n(41);var Ys=()=>{const e=Io(Ia),t=Io(Na),n=Io(Ma);return Object(a.jsx)(MA,{top:!0,id:"presets-context",renderMenu:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsxs)(Xo,{label:"Load",children:[Ks.presets.map(e=>Object(a.jsx)(eA,{onClick:()=>n(e),label:e.name},e.name)),Object(a.jsx)(Zo,{}),Object(a.jsx)(eA,{onClick:e,label:"From Eqf..."})]}),Object(a.jsx)(eA,{onClick:t,label:"Save"})]}),children:Object(a.jsx)("div",{id:"presets"})})};function Hs(){const e=So(Ln)===D,t=Io(Hr),n=Io(Gr);return Object(a.jsxs)(xA,{id:"eq-buttons",children:[Object(a.jsx)("div",{id:"equalizer-shade",onClick:n}),Object(a.jsx)("div",{id:"equalizer-close",onClick:()=>t(D)})]},e?"selected":"unselected")}var Js=()=>{const e=So(qn),t=So(Wn),n=Io(Gr),r=["left","center","right"],i=pe(0,100,e,r),o=pe(-100,100,t,r);return Object(a.jsxs)("div",{className:"draggable",onDoubleClick:n,style:{width:"100%",height:"100%"},children:[Object(a.jsx)(Hs,{}),Object(a.jsx)(hs,{id:"equalizer-volume",className:i}),Object(a.jsx)(PA,{id:"equalizer-balance",className:o})]})};n(94);var qs=()=>{const e=So(jn),t=So(Ln),n=So(cn),r=t===D,i=n(D),o=Io(Ii),A=Io(Si),s=Io(ki),l=Io(vi),u=Io(wi),c=Io(Gr),d=Co()({selected:r,doubled:e,shade:i,window:!0,draggable:!0});return Object(a.jsx)("div",{id:"equalizer-window",className:d,children:Object(a.jsx)(Uo,{windowId:D,children:i?Object(a.jsx)(Js,{}):Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:"equalizer-top title-bar draggable",onDoubleClick:c,children:Object(a.jsx)(Hs,{})}),Object(a.jsx)(Ps,{}),Object(a.jsx)(Qs,{}),Object(a.jsx)(Gs,{}),Object(a.jsx)(Ys,{}),Object(a.jsx)(Fs,{id:"preamp",band:"preamp",onChange:o}),Object(a.jsx)("div",{id:"plus12db",onClick:l}),Object(a.jsx)("div",{id:"zerodb",onClick:s}),Object(a.jsx)("div",{id:"minus12db",onClick:A}),M.map(e=>{return Object(a.jsx)(Fs,{id:(t=e,"band-"+t),band:e,onChange:t=>u(e,t)},e);var t})]})})})};const Ws={MAIN_BALANCE_BACKGROUND:["#balance"],MAIN_BALANCE_THUMB:["#balance::-webkit-slider-thumb","#balance::-moz-range-thumb"],MAIN_BALANCE_THUMB_ACTIVE:["#balance:active::-webkit-slider-thumb","#balance:active::-moz-range-thumb"],MAIN_PREVIOUS_BUTTON:[".actions #previous"],MAIN_PREVIOUS_BUTTON_ACTIVE:[".actions #previous:active"],MAIN_PLAY_BUTTON:[".actions #play"],MAIN_PLAY_BUTTON_ACTIVE:[".actions #play:active"],MAIN_PAUSE_BUTTON:[".actions #pause"],MAIN_PAUSE_BUTTON_ACTIVE:[".actions #pause:active"],MAIN_STOP_BUTTON:[".actions #stop"],MAIN_STOP_BUTTON_ACTIVE:[".actions #stop:active"],MAIN_NEXT_BUTTON:[".actions #next"],MAIN_NEXT_BUTTON_ACTIVE:[".actions #next:active"],MAIN_EJECT_BUTTON:["#eject"],MAIN_EJECT_BUTTON_ACTIVE:["#eject:active"],MAIN_WINDOW_BACKGROUND:["#main-window"],MAIN_STEREO:[".media-info #stereo",".stop .media-info #stereo.selected"],MAIN_STEREO_SELECTED:[".media-info #stereo.selected"],MAIN_MONO:[".media-info #mono",".stop .media-info #mono.selected"],MAIN_MONO_SELECTED:[".media-info #mono.selected"],NO_MINUS_SIGN:["#time #minus-sign"],MINUS_SIGN:["#time.countdown #minus-sign"],DIGIT_0:[".digit-0"],DIGIT_1:[".digit-1"],DIGIT_2:[".digit-2"],DIGIT_3:[".digit-3"],DIGIT_4:[".digit-4"],DIGIT_5:[".digit-5"],DIGIT_6:[".digit-6"],DIGIT_7:[".digit-7"],DIGIT_8:[".digit-8"],DIGIT_9:[".digit-9"],NO_MINUS_SIGN_EX:["#time #minus-sign"],MINUS_SIGN_EX:["#time.countdown #minus-sign"],DIGIT_0_EX:[".digit-0"],DIGIT_1_EX:[".digit-1"],DIGIT_2_EX:[".digit-2"],DIGIT_3_EX:[".digit-3"],DIGIT_4_EX:[".digit-4"],DIGIT_5_EX:[".digit-5"],DIGIT_6_EX:[".digit-6"],DIGIT_7_EX:[".digit-7"],DIGIT_8_EX:[".digit-8"],DIGIT_9_EX:[".digit-9"],MAIN_PLAYING_INDICATOR:[".play #play-pause"],MAIN_PAUSED_INDICATOR:[".pause #play-pause"],MAIN_STOPPED_INDICATOR:[".stop #play-pause"],MAIN_NOT_WORKING_INDICATOR:["#work-indicator"],MAIN_WORKING_INDICATOR:["#work-indicator.selected"],PLAYLIST_TOP_TILE:[".playlist-top-left-fill",".playlist-top-left-spacer",".playlist-top-right-fill",".playlist-top-right-spacer"],PLAYLIST_TOP_LEFT_CORNER:[".playlist-top-left"],PLAYLIST_TITLE_BAR:[".playlist-top-title"],PLAYLIST_TOP_RIGHT_CORNER:[".playlist-top-right"],PLAYLIST_TOP_TILE_SELECTED:[".selected .playlist-top-left-fill",".selected .playlist-top-left-spacer",".selected .playlist-top-right-fill",".selected .playlist-top-right-spacer"],PLAYLIST_TOP_LEFT_SELECTED:[".selected .playlist-top-left"],PLAYLIST_TITLE_BAR_SELECTED:[".selected .playlist-top-title"],PLAYLIST_TOP_RIGHT_CORNER_SELECTED:[".selected .playlist-top-right"],PLAYLIST_LEFT_TILE:[".playlist-middle-left"],PLAYLIST_RIGHT_TILE:[".playlist-middle-right"],PLAYLIST_SCROLL_HANDLE:[".playlist-scrollbar-handle"],PLAYLIST_SCROLL_HANDLE_SELECTED:[".playlist-middle-right:active .playlist-scrollbar-handle"],PLAYLIST_BOTTOM_TILE:[".playlist-bottom"],PLAYLIST_BOTTOM_LEFT_CORNER:[".playlist-bottom-left"],PLAYLIST_BOTTOM_RIGHT_CORNER:[".playlist-bottom-right"],PLAYLIST_VISUALIZER_BACKGROUND:[".playlist-visualizer"],PLAYLIST_SHADE_BACKGROUND:["#playlist-window-shade"],PLAYLIST_SHADE_BACKGROUND_LEFT:["#playlist-window-shade .left"],PLAYLIST_SHADE_BACKGROUND_RIGHT:["#playlist-window-shade .right"],PLAYLIST_SHADE_BACKGROUND_RIGHT_SELECTED:["#playlist-window-shade.selected .right"],PLAYLIST_ADD_MENU_BAR:["#playlist-add-menu.selected .bar"],PLAYLIST_ADD_URL:["#playlist-add-menu .add-url"],PLAYLIST_ADD_URL_SELECTED:["#playlist-add-menu .hover .add-url"],PLAYLIST_ADD_DIR:["#playlist-add-menu .add-dir"],PLAYLIST_ADD_DIR_SELECTED:["#playlist-add-menu .hover .add-dir"],PLAYLIST_ADD_FILE:["#playlist-add-menu .add-file"],PLAYLIST_ADD_FILE_SELECTED:["#playlist-add-menu .hover .add-file"],PLAYLIST_REMOVE_MENU_BAR:["#playlist-remove-menu.selected .bar"],PLAYLIST_REMOVE_ALL:["#playlist-remove-menu .remove-all"],PLAYLIST_REMOVE_ALL_SELECTED:["#playlist-remove-menu .hover .remove-all"],PLAYLIST_CROP:["#playlist-remove-menu .crop"],PLAYLIST_CROP_SELECTED:["#playlist-remove-menu .hover .crop"],PLAYLIST_REMOVE_SELECTED:["#playlist-remove-menu .remove-selected"],PLAYLIST_REMOVE_SELECTED_SELECTED:["#playlist-remove-menu .hover .remove-selected"],PLAYLIST_REMOVE_MISC:["#playlist-remove-menu .remove-misc"],PLAYLIST_REMOVE_MISC_SELECTED:["#playlist-remove-menu .hover .remove-misc"],PLAYLIST_SELECT_MENU_BAR:["#playlist-selection-menu.selected .bar"],PLAYLIST_INVERT_SELECTION:["#playlist-selection-menu .invert-selection"],PLAYLIST_INVERT_SELECTION_SELECTED:["#playlist-selection-menu .hover .invert-selection"],PLAYLIST_SELECT_ZERO:["#playlist-selection-menu .select-zero"],PLAYLIST_SELECT_ZERO_SELECTED:["#playlist-selection-menu .hover .select-zero"],PLAYLIST_SELECT_ALL:["#playlist-selection-menu .select-all"],PLAYLIST_SELECT_ALL_SELECTED:["#playlist-selection-menu .hover .select-all"],PLAYLIST_CLOSE_SELECTED:["#playlist-close-button:active"],PLAYLIST_COLLAPSE_SELECTED:["#playlist-window #playlist-shade-button:active"],PLAYLIST_EXPAND_SELECTED:["#playlist-window-shade #playlist-shade-button:active"],PLAYLIST_MISC_MENU_BAR:["#playlist-misc-menu.selected .bar"],PLAYLIST_MISC_OPTIONS:["#playlist-misc-menu .misc-options"],PLAYLIST_MISC_OPTIONS_SELECTED:["#playlist-misc-menu .hover .misc-options"],PLAYLIST_FILE_INFO:["#playlist-misc-menu .file-info"],PLAYLIST_FILE_INFO_SELECTED:["#playlist-misc-menu .hover .file-info"],PLAYLIST_SORT_LIST:["#playlist-misc-menu .sort-list"],PLAYLIST_SORT_LIST_SELECTED:["#playlist-misc-menu .hover .sort-list"],PLAYLIST_LIST_BAR:["#playlist-list-menu.selected .bar"],PLAYLIST_NEW_LIST:["#playlist-list-menu .new-list"],PLAYLIST_NEW_LIST_SELECTED:["#playlist-list-menu .hover .new-list"],PLAYLIST_LOAD_LIST:["#playlist-list-menu .load-list"],PLAYLIST_LOAD_LIST_SELECTED:["#playlist-list-menu .hover .load-list"],PLAYLIST_SAVE_LIST:["#playlist-list-menu .save-list"],PLAYLIST_SAVE_LIST_SELECTED:["#playlist-list-menu .hover .save-list"],EQ_WINDOW_BACKGROUND:["#equalizer-window:not(.shade)"],EQ_TITLE_BAR:[".equalizer-top"],EQ_TITLE_BAR_SELECTED:[".selected .equalizer-top"],EQ_SLIDER_BACKGROUND:[".band"],EQ_SLIDER_THUMB:[".band .slider-handle"],EQ_SLIDER_THUMB_SELECTED:[".band:active .slider-handle"],EQ_ON_BUTTON:["#on"],EQ_ON_BUTTON_DEPRESSED:["#on:active"],EQ_ON_BUTTON_SELECTED:["#on.selected"],EQ_ON_BUTTON_SELECTED_DEPRESSED:["#on.selected:active"],EQ_AUTO_BUTTON:["#auto"],EQ_AUTO_BUTTON_DEPRESSED:["#auto:active"],EQ_AUTO_BUTTON_SELECTED:["#auto.selected"],EQ_AUTO_BUTTON_SELECTED_DEPRESSED:["#auto.selected:active"],EQ_GRAPH_BACKGROUND:["#eqGraph"],EQ_PRESETS_BUTTON:["#presets"],EQ_PRESETS_BUTTON_SELECTED:["#presets:active"],EQ_PREAMP_LINE:["#preamp-line"],EQ_SHADE_BACKGROUND:["#equalizer-window.shade"],EQ_SHADE_BACKGROUND_SELECTED:["#equalizer-window.shade.selected"],EQ_SHADE_VOLUME_SLIDER_LEFT:["#equalizer-volume.left::-webkit-slider-thumb","#equalizer-volume.left::-moz-range-thumb"],EQ_SHADE_VOLUME_SLIDER_CENTER:["#equalizer-volume.center::-webkit-slider-thumb","#equalizer-volume.center::-moz-range-thumb"],EQ_SHADE_VOLUME_SLIDER_RIGHT:["#equalizer-volume.right::-webkit-slider-thumb","#equalizer-volume.right::-moz-range-thumb"],EQ_SHADE_BALANCE_SLIDER_LEFT:["#equalizer-balance.left::-webkit-slider-thumb","#equalizer-balance.left::-moz-range-thumb"],EQ_SHADE_BALANCE_SLIDER_CENTER:["#equalizer-balance.center::-webkit-slider-thumb","#equalizer-balance.center::-moz-range-thumb"],EQ_SHADE_BALANCE_SLIDER_RIGHT:["#equalizer-balance.right::-webkit-slider-thumb","#equalizer-balance.right::-moz-range-thumb"],EQ_MAXIMIZE_BUTTON_ACTIVE:["#equalizer-shade:active"],EQ_MINIMIZE_BUTTON_ACTIVE:["#equalizer-window.shade #equalizer-shade:active"],EQ_CLOSE_BUTTON:["#equalizer-window.selected #eq-buttons.clicked #equalizer-close"],EQ_CLOSE_BUTTON_ACTIVE:["#equalizer-window.selected #eq-buttons.clicked #equalizer-close:active"],EQ_SHADE_CLOSE_BUTTON:["#equalizer-window.shade.selected #eq-buttons.clicked #equalizer-close"],EQ_SHADE_CLOSE_BUTTON_ACTIVE:["#equalizer-window.shade.selected #eq-buttons.clicked #equalizer-close:active"],MAIN_POSITION_SLIDER_BACKGROUND:["#position"],MAIN_POSITION_SLIDER_THUMB:["#position::-webkit-slider-thumb","#position::-moz-range-thumb"],MAIN_POSITION_SLIDER_THUMB_SELECTED:["#position:active::-webkit-slider-thumb","#position:active::-moz-range-thumb"],MAIN_SHUFFLE_BUTTON:["#shuffle"],MAIN_SHUFFLE_BUTTON_DEPRESSED:["#shuffle:active"],MAIN_SHUFFLE_BUTTON_SELECTED:["#shuffle.selected"],MAIN_SHUFFLE_BUTTON_SELECTED_DEPRESSED:["#shuffle.selected:active"],MAIN_REPEAT_BUTTON:["#repeat"],MAIN_REPEAT_BUTTON_DEPRESSED:["#repeat:active"],MAIN_REPEAT_BUTTON_SELECTED:["#repeat.selected"],MAIN_REPEAT_BUTTON_SELECTED_DEPRESSED:["#repeat.selected:active"],MAIN_EQ_BUTTON:["#equalizer-button"],MAIN_EQ_BUTTON_SELECTED:["#equalizer-button.selected"],MAIN_EQ_BUTTON_DEPRESSED:["#equalizer-button:active"],MAIN_EQ_BUTTON_DEPRESSED_SELECTED:["#equalizer-button.selected:active"],MAIN_PLAYLIST_BUTTON:["#playlist-button"],MAIN_PLAYLIST_BUTTON_SELECTED:["#playlist-button.selected"],MAIN_PLAYLIST_BUTTON_DEPRESSED:["#playlist-button:active"],MAIN_PLAYLIST_BUTTON_DEPRESSED_SELECTED:["#playlist-button.selected:active"],MAIN_TITLE_BAR:["#title-bar"],MAIN_TITLE_BAR_SELECTED:[".selected #title-bar"],MAIN_EASTER_EGG_TITLE_BAR:[".llama #title-bar"],MAIN_EASTER_EGG_TITLE_BAR_SELECTED:[".llama.selected #title-bar"],MAIN_OPTIONS_BUTTON:[".selected #title-bar #option.clicked"],MAIN_OPTIONS_BUTTON_DEPRESSED:[".selected #title-bar #option:active",".selected #title-bar #option.selected"],MAIN_MINIMIZE_BUTTON:[".selected #title-bar #minimize.clicked"],MAIN_MINIMIZE_BUTTON_DEPRESSED:[".selected #title-bar #minimize:active"],MAIN_SHADE_BUTTON:[".selected #title-bar #shade.clicked"],MAIN_SHADE_BUTTON_DEPRESSED:[".selected #title-bar #shade:active"],MAIN_CLOSE_BUTTON:[".selected #title-bar #close.clicked"],MAIN_CLOSE_BUTTON_DEPRESSED:[".selected #title-bar #close:active"],MAIN_CLUTTER_BAR_BACKGROUND:["#clutter-bar"],MAIN_CLUTTER_BAR_BACKGROUND_DISABLED:["#clutter-bar.disabled"],MAIN_CLUTTER_BAR_BUTTON_O_SELECTED:["#button-o:active","#button-0.selected"],MAIN_CLUTTER_BAR_BUTTON_A_SELECTED:["#button-a:active","#button-a.selected"],MAIN_CLUTTER_BAR_BUTTON_I_SELECTED:["#button-i:active","#button-i.selected"],MAIN_CLUTTER_BAR_BUTTON_D_SELECTED:["#button-d:active","#button-d.selected"],MAIN_CLUTTER_BAR_BUTTON_V_SELECTED:["#button-v:active","#button-v.selected"],MAIN_SHADE_BACKGROUND:[".shade #title-bar"],MAIN_SHADE_BACKGROUND_SELECTED:[".shade.selected #title-bar"],MAIN_SHADE_BUTTON_SELECTED:[".shade.selected #title-bar #shade"],MAIN_SHADE_BUTTON_SELECTED_DEPRESSED:[".shade #title-bar #shade:active"],MAIN_SHADE_POSITION_BACKGROUND:[".shade #position"],MAIN_SHADE_POSITION_THUMB:[".shade #position::-moz-range-thumb",".shade #position::-webkit-slider-thumb"],MAIN_SHADE_POSITION_THUMB_LEFT:[".shade #position.left::-moz-range-thumb",".shade #position.left::-webkit-slider-thumb"],MAIN_SHADE_POSITION_THUMB_RIGHT:[".shade #position.right::-moz-range-thumb",".shade #position.right::-webkit-slider-thumb"],MAIN_VOLUME_BACKGROUND:["#volume"],MAIN_VOLUME_THUMB:["#volume input::-webkit-slider-thumb","#volume input::-moz-range-thumb"],MAIN_VOLUME_THUMB_SELECTED:["#volume input:active::-webkit-slider-thumb","#volume input:active::-moz-range-thumb"],GEN_TOP_CENTER_FILL:[".gen-window .gen-top"],GEN_TOP_LEFT:[".gen-window .gen-top-left"],GEN_TOP_LEFT_END:[".gen-window .gen-top-left-end"],GEN_TOP_RIGHT:[".gen-window .gen-top-right"],GEN_TOP_RIGHT_END:[".gen-window .gen-top-right-end"],GEN_TOP_LEFT_RIGHT_FILL:[".gen-window .gen-top-left-fill",".gen-window .gen-top-right-fill"],GEN_TOP_CENTER_FILL_SELECTED:[".gen-window.selected .gen-top"],GEN_TOP_LEFT_SELECTED:[".gen-window.selected .gen-top-left"],GEN_TOP_LEFT_END_SELECTED:[".gen-window.selected .gen-top-left-end"],GEN_TOP_RIGHT_SELECTED:[".gen-window.selected .gen-top-right"],GEN_TOP_RIGHT_END_SELECTED:[".gen-window.selected .gen-top-right-end"],GEN_TOP_LEFT_RIGHT_FILL_SELECTED:[".gen-window.selected .gen-top-left-fill",".gen-window.selected .gen-top-right-fill"],GEN_BOTTOM_LEFT:[".gen-window .gen-bottom-left"],GEN_BOTTOM_RIGHT:[".gen-window .gen-bottom-right"],GEN_BOTTOM_FILL:[".gen-window .gen-bottom"],GEN_MIDDLE_LEFT:[".gen-window .gen-middle-left"],GEN_MIDDLE_LEFT_BOTTOM:[".gen-window .gen-middle-left-bottom"],GEN_MIDDLE_RIGHT:[".gen-window .gen-middle-right"],GEN_MIDDLE_RIGHT_BOTTOM:[".gen-window .gen-middle-right-bottom"],GEN_CLOSE_SELECTED:[".gen-window .gen-close:active"]};Object.keys(xi).forEach(e=>{const t=Bi(e),n=e.charCodeAt(0);Ws[t]=[".character-"+n]}),V.forEach(e=>{Ws["GEN_TEXT_"+e]=[".gen-text-"+e.toLowerCase()],Ws["GEN_TEXT_SELECTED_"+e]=[".gen-window.selected .gen-text-"+e.toLowerCase()]});const Zs={CLOSE:["#title-bar #close"],EQSLID:["#equalizer-window .band"],EQNORMAL:["#equalizer-window"],EQCLOSE:["#equalizer-window #equalizer-close"],EQTITLE:["#equalizer-window .title-bar","#equalizer-window.shade","#equalizer-window.shade input"],MAINMENU:["#main-window #option","#webamp-context-menu .context-menu"],MIN:["#main-window #minimize"],NORMAL:[".window",".window input","#main-window","#main-window.shade #title-bar"],MMENU:["#main-window.shade #option"],PNORMAL:["#playlist-window"],PTBAR:["#playlist-window .playlist-top"],PCLOSE:["#playlist-window #playlist-close-button","#playlist-window-shade #playlist-close-button"],PWINBUT:["#playlist-window #playlist-shade-button","#playlist-window-shade #playlist-shade-button"],POSBAR:["#main-window #position"],PSIZE:["#playlist-window #playlist-resize-target"],PWSSIZE:["#playlist-window-shade #playlist-resize-target"],PWSNORM:["#playlist-window-shade"],PVSCROLL:["#playlist-window .playlist-scrollbar"],SONGNAME:["#main-window #marquee"],TITLEBAR:["#main-window #title-bar"],VOLBAL:["#volume","#volume input","#balance"],WINBUT:["#main-window #shade"],WSNORMAL:["#main-window.shade #title-bar"],WSPOSBAR:["#main-window.shade #position"]};function Xs({children:e,id:t}){const n=Object(o.useMemo)(()=>{const e=document.createElement("style");return e.type="text/css",e.id=t,e},[t]);return Object(o.useLayoutEffect)(()=>(document.head.appendChild(n),()=>n.remove()),[n]),Object(s.createPortal)(e,n)}function $s({children:e}){const t=Object(o.useMemo)(()=>document.createElement("div"),[]);return Object(o.useLayoutEffect)(()=>(document.body.appendChild(t),()=>t.remove()),[t]),Object(s.createPortal)(Object(a.jsx)("svg",{height:0,width:0,children:Object(a.jsx)("defs",{children:Object.keys(e).map(t=>Object(a.jsx)("clipPath",{id:t,children:e[t].map((e,t)=>Object(a.jsx)("polygon",{points:e},t))},t))})}),t)}var el=n(42);const tl={normal:"mainWindowClipPath",windowshade:"shadeMainWindowClipPath",equalizer:"equalizerWindowClipPath",equalizerws:"shadeEqualizerWindowClipPath"},nl={normal:"#main-window:not(.shade)",windowshade:"#main-window.shade",equalizer:"#equalizer-window:not(.shade)",equalizerws:"#equalizer-window.shade"},rl={MAIN_BALANCE_BACKGROUND:"MAIN_VOLUME_BACKGROUND",MAIN_BALANCE_THUMB:"MAIN_VOLUME_THUMB",MAIN_BALANCE_THUMB_ACTIVE:"MAIN_VOLUME_THUMB_SELECTED",EQ_MAXIMIZE_BUTTON_ACTIVE:"EQ_MAXIMIZE_BUTTON_ACTIVE_FALLBACK"};function il(e){return`${e.startsWith("#webamp-context-menu")?"":"#webamp"} ${e}`}const al=Object(Ve.createSelector)((function(e){return e.display.skinImages}),(function(e){return e.display.skinCursors}),(function(e){return e.display.skinGenLetterWidths}),vr,(e,t,n,r)=>{if(!e||!t)return null;const i=[];Object.keys(Ws).forEach(t=>{const n=e[t]||e[rl[t]];n&&Ws[t].forEach(e=>{i.push(`#webamp ${e} {background-image: url(${n})}`)})}),null!=n&&V.forEach(e=>{const t=n["GEN_TEXT_"+e],r=n["GEN_TEXT_SELECTED_"+e];i.push(`#webamp .gen-text-${e.toLowerCase()} {width: ${t}px;}`),i.push(`#webamp .selected .gen-text-${e.toLowerCase()} {width: ${r}px;}`)}),Object.entries(Zs).forEach(([e,n])=>{const r=t[e];if(null==r)return;const a=n.map(il).map(e=>{switch(r.type){case"cur":return`${e} {cursor: url(${r.url}), auto}`;case"ani":try{return Object(el.convertAniBinaryToCSS)(e,r.aniData)}catch(e){return console.error(e),null}}}).filter(Boolean);i.push(...a)}),(e=>Boolean(e.DIGIT_0_EX))(e)&&i.push("#webamp .webamp-status #time #minus-sign { top: 0px; left: -1px; width: 9px; height: 13px; }");for(const[e,t]of Object.entries(r))if(t){const t=nl[e],n=tl[e];i.push(`#webamp ${t} { clip-path: url(#${n}); }`)}return i.join("\n")}),ol=Object(Ve.createSelector)(vr,e=>{const t={};for(const[n,r]of Object.entries(e))if(r){t[tl[n]]=r}return t});function Al(){const e=So(al),t=So(ol);return null==e?null:Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Xs,{id:"webamp-skin",children:e}),Object(a.jsx)($s,{children:t})]})}n(98);function sl({media:e,filePickers:t}){const n=So(yr),r=So(sn),i=So(Fn),A=Io($r),s=Io(Jr),[u]=Object(o.useState)(()=>{const e=document.createElement("div");return e.id="webamp",e.role="application",e});Object(o.useLayoutEffect)(()=>{u.style.zIndex=String(i)},[u,i]),Object(o.useLayoutEffect)(()=>(document.body.appendChild(u),()=>{document.body.removeChild(u)}),[u]),Object(o.useEffect)(()=>{const e=()=>{null!=u&&(u.style.right="0",u.style.bottom="0",u.style.overflow="hidden",A(ve()),u.style.right="auto",u.style.bottom="auto",u.style.overflow="visible")};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[A,u]);const c=Object(o.useCallback)(()=>we(r,(n,r)=>{if(!n.open)return null;switch(r){case N:return Object(a.jsx)(gs,{analyser:e.getAnalyser(),filePickers:t});case D:return Object(a.jsx)(qs,{});case _:return Object(a.jsx)(js,{analyser:e.getAnalyser()});case L:return Object(a.jsx)(lA,{analyser:e.getAnalyser()});default:throw new Error("Tried to render an unknown window: "+r)}}),[e,t,r]);return n?null:l.a.createPortal(Object(a.jsx)(o.StrictMode,{children:Object(a.jsxs)("div",{onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(null)},children:[Object(a.jsx)(Al,{}),Object(a.jsx)(iA,{renderContents:()=>Object(a.jsx)(hA,{filePickers:t}),children:Object(a.jsx)(bA,{windows:c()})})]})}),u)}const ll=new Set(["input","textarea","select"]);class ul{constructor(){i()(this,"_listeners",void 0),this._listeners={}}on(e,t){const n=this._listeners[e]||[];n.push(t),this._listeners[e]=n;return()=>{this._listeners[e]=n.filter(e=>e!==t)}}trigger(e,...t){const n=this._listeners[e];n&&n.forEach(e=>e(...t))}dispose(){this._listeners={}}}function cl(e,t={balance:0}){let n=0;const r=e.createGain();r.channelCount=2,r.channelCountMode="explicit",r.channelInterpretation="speakers";const i=e.createChannelSplitter(2),a=e.createGain(),o=e.createGain(),A=e.createChannelMerger(2);function s(e){const t=Number(e);a.gain.value=t>0?1-t:1,o.gain.value=t>0?1:1+t,n=t}r.connect(i),i.connect(a,0),i.connect(o,1),a.connect(A,0,0),o.connect(A,0,1);const l={};return Object.defineProperties(l,{value:{get:function(){return n},set:s,enumerable:!0,configurable:!0}}),Object.defineProperties(r,{balance:{value:l,enumerable:!0,writable:!1,configurable:!0},connect:{value:AudioNode.prototype.connect.bind(A),enumerable:!1,writable:!1,configurable:!0},disconnect:{value:AudioNode.prototype.disconnect.bind(A),enumerable:!1,writable:!1,configurable:!0}}),n!==t.balance&&s(t.balance),r}class dl{on(e,t){return this._emitter.on(e,t)}constructor(e,t){i()(this,"_emitter",void 0),i()(this,"_context",void 0),i()(this,"_source",void 0),i()(this,"_destination",void 0),i()(this,"_audio",void 0),i()(this,"_stalled",void 0),i()(this,"_status",void 0),this._emitter=new ul,this._context=e,this._destination=t,this._audio=document.createElement("audio"),this._audio.crossOrigin="anonymous",this._stalled=!1,this._status=X,this._audio.addEventListener("suspend",()=>{this._setStalled(!0)}),this._audio.addEventListener("durationchange",()=>{this._emitter.trigger("loaded"),this._setStalled(!1)}),this._audio.addEventListener("ended",()=>{this._emitter.trigger("ended"),this._setStatus(X)}),this._audio.addEventListener("timeupdate",()=>{this._emitter.trigger("positionChange")}),this._audio.addEventListener("error",e=>{switch(this._audio.error.code){case 1:console.error("MEDIA_ERR_ABORTED",e);break;case 2:console.error("MEDIA_ERR_NETWORK",e);break;case 3:console.error("PIPELINE_ERROR_DECODE",e);break;case 4:console.error("MEDIA_ERR_SRC_NOT_SUPPORTED",e)}this._emitter.trigger("ended"),this._setStatus(X)}),this._source=this._context.createMediaElementSource(this._audio),this._source.connect(t)}_setStalled(e){this._stalled=e,this._emitter.trigger("stallChanged")}disconnect(){this._source.disconnect()}async loadUrl(e){this._audio.src=e}async play(){this._status!==$&&this.seekToTime(0);try{await this._audio.play()}catch(e){}this._setStatus(Z)}pause(){this._audio.pause(),this._setStatus($)}stop(){this._audio.pause(),this._audio.currentTime=0,this._setStatus(X)}seekToTime(e){this._audio.currentTime=oe(e,0,this.getDuration()),this._emitter.trigger("positionChange")}getStalled(){return this._stalled}getStatus(){return this._status}getDuration(){const{duration:e}=this._audio;return isNaN(e)||e===1/0?0:e}getTimeElapsed(){return this._audio.currentTime}_setStatus(e){this._status=e,this._emitter.trigger("statusChange")}dispose(){this.stop(),this._emitter.dispose()}}class hl{constructor(){if(i()(this,"_emitter",void 0),i()(this,"_context",void 0),i()(this,"_balance",void 0),i()(this,"_staticSource",void 0),i()(this,"_preamp",void 0),i()(this,"_analyser",void 0),i()(this,"_gainNode",void 0),i()(this,"_source",void 0),i()(this,"_bands",void 0),this._emitter=new ul,this._context=new(window.AudioContext||window.webkitAudioContext),"suspended"===this._context.state){const e=async()=>{await this._context.resume(),"running"===this._context.state&&(document.body.removeEventListener("touchend",e,!1),document.body.removeEventListener("click",e,!1),document.body.removeEventListener("keydown",e,!1))};document.body.addEventListener("touchend",e,!1),document.body.addEventListener("click",e,!1),document.body.addEventListener("keydown",e,!1)}this._staticSource=this._context.createGain(),this._balance=new cl(this._context),this._preamp=this._context.createGain(),this._analyser=this._context.createAnalyser(),this._analyser.fftSize=2048,this._analyser.smoothingTimeConstant=0,this._gainNode=this._context.createGain(),this._source=new dl(this._context,this._staticSource),this._source.on("positionChange",()=>{this._emitter.trigger("timeupdate")}),this._source.on("ended",()=>{this._emitter.trigger("ended")}),this._source.on("statusChange",()=>{switch(this._source.getStatus()){case Z:this._emitter.trigger("playing")}this._emitter.trigger("timeupdate")}),this._source.on("loaded",()=>{this._emitter.trigger("fileLoaded")}),this._staticSource.connect(this._preamp);let e=this._preamp;this._bands={},M.forEach((t,n)=>{const r=this._context.createBiquadFilter();this._bands[t]=r,0===n?r.type="lowshelf":n===M.length-1?r.type="highshelf":r.type="peaking",r.frequency.value=t,r.gain.value=0,e.connect(r),e=r}),e.connect(this._balance),this._balance.connect(this._gainNode),this._balance.connect(this._analyser),this._gainNode.connect(this._context.destination)}getAnalyser(){return this._analyser}duration(){return this._source.getDuration()}timeElapsed(){return this._source.getTimeElapsed()}timeRemaining(){return this.duration()-this.timeElapsed()}percentComplete(){return this.timeElapsed()/this.duration()*100}async play(){await this._source.play()}pause(){this._source.pause()}stop(){this._source.stop()}seekToPercentComplete(e){const t=this.duration()*(e/100);this.seekToTime(t)}setVolume(e){this._gainNode.gain.value=e/100}setPreamp(e){const t=e/100*24-12;this._preamp.gain.value=Math.pow(10,t/20)}setBalance(e){this._balance.balance.value=e/100}setEqBand(e,t){const n=t/100*24-12;this._bands[e].gain.value=n}disableEq(){this._staticSource.disconnect(),this._staticSource.connect(this._balance)}enableEq(){this._staticSource.disconnect(),this._staticSource.connect(this._preamp)}on(e,t){this._emitter.on(e,t)}seekToTime(e){this._source.seekToTime(e)}async loadFromUrl(e,t){this._emitter.trigger("waiting"),await this._source.loadUrl(e),this._emitter.trigger("stopWaiting"),t&&this.play()}dispose(){this._source.dispose(),this._emitter.dispose()}}n(100);class fl{constructor(){i()(this,"_teardowns",[]),i()(this,"disposed",void 0),this.disposed=!1}add(...e){if(this.disposed)throw new Error("Attempted to add a new teardown to a disposed disposable.");this._teardowns.push(...e)}dispose(){if(this.disposed)throw new Error("Attempted to dispose disposable which is already disposed.");this._teardowns.forEach(e=>{"function"==typeof e?e():"function"==typeof e.dispose&&e.dispose()}),this._teardowns=[],this.disposed=!0}}class pl{static browserIsSupported(){const e=!(!window.AudioContext&&!window.webkitAudioContext),t=!!window.document.createElement("canvas").getContext;return e&&t&&"undefined"!=typeof Promise}constructor(e){i()(this,"_actionEmitter",void 0),i()(this,"_node",void 0),i()(this,"_disposable",void 0),i()(this,"options",void 0),i()(this,"media",void 0),i()(this,"store",void 0),this._node=null,this._disposable=new fl,this._actionEmitter=new ul,this.options=e;const{initialTracks:t,initialSkin:n,avaliableSkins:r,availableSkins:a,enableHotkeys:o=!1,zIndex:A,requireJSZip:s,requireMusicMetadata:l,handleTrackDropEvent:u,handleAddUrlEvent:c,handleLoadListEvent:d,handleSaveListEvent:h,__butterchurnOptions:f,__customMediaClass:p}=this.options;let g=null;if(null!=f){const{importConvertPreset:e,presetConverterEndpoint:t}=f;null!=e&&null!=t&&(g=async n=>{const{convertPreset:r}=await e();return r(await ft(n),t)})}var m;this.media=new(p||hl),this.store=po(this.media,this._actionEmitter,this.options.__customMiddlewares,this.options.__initialState,{requireJSZip:s,requireMusicMetadata:l,convertPreset:g,handleTrackDropEvent:u,handleAddUrlEvent:c,handleLoadListEvent:d,handleSaveListEvent:h}),navigator.onLine?this.store.dispatch({type:"NETWORK_CONNECTED"}):this.store.dispatch({type:"NETWORK_DISCONNECTED"}),null!=A&&this.store.dispatch({type:"SET_Z_INDEX",zIndex:A}),e.__butterchurnOptions&&(this.store.dispatch({type:"ENABLE_MILKDROP",open:e.__butterchurnOptions.butterchurnOpen}),this.store.dispatch((m=e.__butterchurnOptions,async e=>{const{getPresets:t,importButterchurn:n}=m;n().then(t=>{e({type:"GOT_BUTTERCHURN",butterchurn:t.default})});const r=(await t()).map(Va);e(Ga(r))})));const b=()=>this.store.dispatch({type:"NETWORK_CONNECTED"}),E=()=>this.store.dispatch({type:"NETWORK_DISCONNECTED"});window.addEventListener("online",b),window.addEventListener("offline",E),this._disposable.add(()=>{window.removeEventListener("online",b),window.removeEventListener("offline",E)}),n?this.store.dispatch(ka(n.url)):this.store.dispatch({type:"LOADED"}),t&&this._bufferTracks(t),null!=r?(console.warn("The misspelled option `avaliableSkins` is deprecated. Please use `availableSkins` instead."),this.store.dispatch({type:"SET_AVAILABLE_SKINS",skins:r})):null!=a&&this.store.dispatch({type:"SET_AVAILABLE_SKINS",skins:a});const w=e.__initialWindowLayout;null==w?this.store.dispatch(ei()):(Ee(w,(e,t)=>{null!=e.size&&this.store.dispatch(qr(t,e.size))}),this.store.dispatch(Zr(we(w,e=>e.position),!1))),o&&this._disposable.add(function(e){let t=0;const n=[78,85,76,76,83,79,70,84],r=r=>{if(!(r.target instanceof Element&&ll.has(r.target.tagName.toLowerCase()))){if(r.ctrlKey)switch(r.keyCode){case 68:e(Vr()),r.preventDefault();break;case 76:break;case 82:e({type:"REVERSE_LIST"});break;case 84:e({type:"TOGGLE_TIME_MODE"})}else if(r.altKey)switch(r.keyCode){case 87:e(Wr("main"));break;case 69:e(Wr("playlist"));break;case 71:e(Wr("equalizer"))}else switch(r.keyCode){case 37:e(ci(5));break;case 38:e(hi(1));break;case 39:e(ui(5));break;case 40:e(hi(-1));break;case 66:e(Ai());break;case 67:e(ii());break;case 76:e(Oa());break;case 82:e({type:"TOGGLE_REPEAT"});break;case 83:e({type:"TOGGLE_SHUFFLE"});break;case 86:e({type:"STOP"});break;case 88:e(ri());break;case 90:e(si());break;case 96:e(Oa());break;case 97:e(oi(-10));break;case 98:e(hi(-1));break;case 99:e(oi(10));break;case 100:e(si());break;case 101:e(ri());break;case 102:e(Ai());break;case 103:e(ci(5));break;case 104:e(hi(1));break;case 105:e(ui(5))}27!==r.keyCode&&(t=r.keyCode===n[t]?t+1:0,t===n.length&&e({type:"TOGGLE_LLAMA_MODE"}))}};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}}(this.store.dispatch))}play(){this.store.dispatch(ri())}pause(){this.store.dispatch(ii())}stop(){this.store.dispatch({type:"STOP"})}seekBackward(e){this.store.dispatch(ci(e))}seekForward(e){this.store.dispatch(ui(e))}seekToTime(e){this.store.dispatch(li(e))}nextTrack(){this.store.dispatch(Ai())}previousTrack(){this.store.dispatch(si())}_bufferTracks(e){const t=Ht(this.store.getState());this.store.dispatch(Ba(e,j,t))}appendTracks(e){const t=Ht(this.store.getState());this.store.dispatch(Ba(e,F,t))}setTracksToPlay(e){this.store.dispatch(Ba(e,R))}getMediaStatus(){return In(this.store.getState())}onWillClose(e){return this._actionEmitter.on("CLOSE_REQUESTED",t=>{e(t.cancel)})}onClose(e){return this._actionEmitter.on("CLOSE_WINAMP",e)}close(){this.store.dispatch(e=>{let t=!1;e({type:"CLOSE_REQUESTED",cancel:()=>{t=!0}}),t||(e({type:"STOP"}),e({type:"CLOSE_WINAMP"}))})}reopen(){this.store.dispatch({type:"OPEN_WINAMP"})}onTrackDidChange(e){let t=null;return this.store.subscribe(()=>{const n=this.store.getState(),r=Cn(n);r!==t&&(t=r,e(null==r?null:xn(n)))})}onMinimize(e){return this._actionEmitter.on("MINIMIZE_WINAMP",e)}setSkinFromUrl(e){this.store.dispatch(ka(e))}async skinIsLoaded(){var e,t;await(e=this.store,t=e=>!e.display.loading,new Promise(n=>{if(t(e.getState()))return void n();const r=e.subscribe(()=>{t(e.getState())&&(n(),r())})})),await Promise.all([kr(this.store.getState()),Sr(this.store.getState())])}__loadSerializedState(e){this.store.dispatch(function(e){return t=>{t({type:"LOAD_SERIALIZED_STATE",serializedState:e}),t(ti())}}(e))}__getSerializedState(){return{version:1,media:Qe((e=this.store.getState()).media),equalizer:e.equalizer,display:qe(e.display),windows:Le(e.windows)};var e}__onStateChange(e){return this.store.subscribe(e)}async renderWhenReady(e){var t;if(this.store.dispatch((t=e,(e,n)=>{if(!n().windows.positionsAreRelative)return;const{left:r,top:i}=t.getBoundingClientRect(),{scrollWidth:a,scrollHeight:o}=t;e(Xr({left:r,top:i,width:a,height:o}))})),await this.skinIsLoaded(),null!=this._node)throw new Error("Cannot render a Webamp instance twice");this._node=e,this._disposable.add(()=>{null!=this._node&&(l.a.unmountComponentAtNode(this._node),this._node=null)}),l.a.render(Object(a.jsx)(p,{store:this.store,children:Object(a.jsx)(sl,{media:this.media,filePickers:this.options.filePickers||[]})}),e)}dispose(){this.media.dispose(),this._actionEmitter.dispose(),this._disposable.dispose()}}i()(pl,"VERSION","1.5.0");t.default=pl},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8),a=n(14),o=n(6),A=n(20),s=i("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 l={len:128,get:(e,t)=>{const n=new u(3).get(e,t);return"TAG"===n?{header:n,title:new u(30).get(e,t+3),artist:new u(30).get(e,t+33),album:new u(30).get(e,t+63),year:new u(4).get(e,t+93),comment:new u(28).get(e,t+97),zeroByte:o.UINT8.get(e,t+127),track:o.UINT8.get(e,t+126),genre:o.UINT8.get(e,t+127)}:null}};class u extends o.StringType{constructor(e){super(e,"binary")}get(e,t){let n=super.get(e,t);return n=a.default.trimRightNull(n),n=n.trim(),n.length>0?n:void 0}}class c extends A.BasicParser{static getGenre(e){if(ee)return void s("Already consumed the last 128 bytes");const t=yield this.tokenizer.readToken(l,e);if(t){s("ID3v1 header found at: pos=%s",this.tokenizer.fileSize-l.len);for(const e of["title","artist","album","comment","track","year"])t[e]&&""!==t[e]&&this.addTag(e,t[e]);const e=c.getGenre(t.genre);e&&this.addTag("genre",e)}else s("ID3v1 header not found at: pos=%s",this.tokenizer.fileSize-l.len)}))}addTag(e,t){this.metadata.addTag("ID3v1",e,t)}}t.ID3v1Parser=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(106);class i extends r.Readable{constructor(e){super(),this.buf=e}_read(){this.push(this.buf),this.push(null)}}t.ID3Stream=i},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function A(){A.init.call(this)}e.exports=A,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._eventsCount=0,A.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?A.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,a,o,A;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,A=s,console&&console.warn&&console.warn(A)}return e}function d(){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 h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var A=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw A.context=o,A}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)a(s,this,t);else{var l=s.length,u=g(s,l);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},A.prototype.listeners=function(e){return f(this,e,!0)},A.prototype.rawListeners=function(e){return f(this,e,!1)},A.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},A.prototype.listenerCount=p,A.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(107)).Stream=t,t.Readable=t,t.Writable=n(53),t.Duplex=n(24),t.Transform=n(111),t.PassThrough=n(154)},function(e,t,n){var r=n(9),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";(function(t,r,i){var a=n(44);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=b;var A,s=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;b.WritableState=m;var l=Object.create(n(34));l.inherits=n(31);var u={deprecate:n(152)},c=n(108),d=n(52).Buffer,h=i.Uint8Array||function(){};var f,p=n(109);function g(){}function m(e,t){A=A||n(24),e=e||{};var r=t instanceof A;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===e.decodeStrings;this.decodeStrings=!c,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 n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,i);else{var o=v(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||y(e,n),r?s(w,e,n,o,i):w(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(e){if(A=A||n(24),!(f.call(b,this)||this instanceof A))return new b(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function E(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var A=0,s=!0;n;)i[A]=n,n.isBuf||(s=!1),n=n.next,A+=1;i.allBuffers=s,E(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,u=n.encoding,c=n.callback;if(E(e,t,!1,t.objectMode?1:l.length,l,u,c),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var n=v(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(b,c),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:u.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]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===b&&(e&&e._writableState instanceof m)}})):f=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,A=!i.objectMode&&(r=e,d.isBuffer(r)||r instanceof h);return A&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(n=t,t=null),A?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(A||function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(r,o),i=!1),i}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var A=t.objectMode?1:r.length;t.length+=A;var s=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=p.destroy,b.prototype._undestroy=p.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(30),n(104).setImmediate,n(17))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const r=n(6),i=n(8),a=n(113),o=i("music-metadata:parser:ogg:vorbis1");t.VorbisParser=class{constructor(e,t){this.metadata=e,this.options=t,this.codecName="Vorbis I",this.pageSegments=[]}parsePage(t,n){if(t.headerType.firstPage)this.parseFirstPage(t,n);else{if(t.headerType.continued){if(0===this.pageSegments.length)throw new Error("Cannot continue on previous page");this.pageSegments.push(n)}if(t.headerType.lastPage||!t.headerType.continued){if(this.pageSegments.length>0){const t=e.concat(this.pageSegments);this.parseFullPage(t)}this.pageSegments=t.headerType.lastPage?[]:[n]}}t.headerType.lastPage&&this.calculateDuration(t)}flush(){this.parseFullPage(e.concat(this.pageSegments))}parseFirstPage(e,t){o("Parse first page");const n=a.CommonHeader.get(t,0);if("vorbis"!==n.vorbis)throw new Error("Metadata does not look like Vorbis");if(1!==n.packetType)throw new Error("First Ogg page should be type 1: the identification header");{const e=a.IdentificationHeader.get(t,a.CommonHeader.len);this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("bitrate",e.bitrateNominal),this.metadata.setFormat("numberOfChannels",e.channelMode),o("sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s",e.sampleRate,e.bitrateNominal,e.channelMode)}}parseFullPage(e){const t=a.CommonHeader.get(e,0);switch(o("Parse full page: type=%s, byteLength=%s",t.packetType,e.byteLength),t.packetType){case 3:return this.parseUserCommentList(e,a.CommonHeader.len)}}calculateDuration(e){this.metadata.format.sampleRate&&e.absoluteGranulePosition>=0&&(this.metadata.setFormat("numberOfSamples",e.absoluteGranulePosition),this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate))}parseUserCommentList(e,t){const n=r.UINT32_LE.get(e,t);t+=4;new r.StringType(n,"utf-8").get(e,t);t+=n;let i=r.UINT32_LE.get(e,t);for(t+=4;i-- >0;)t+=this.parseUserComment(e,t)}parseUserComment(e,t){const n=r.UINT32_LE.get(e,t),i=new r.StringType(n,"utf-8").get(e,t+4),A=i.indexOf("="),s=i.slice(0,A).toUpperCase();let l=i.slice(A+1);return"METADATA_BLOCK_PICTURE"===s&&(l=this.options.skipCovers?null:a.VorbisPictureToken.fromBase64(l)),null!==l&&(o("Push tag: id=%s, value=%s",s,l),this.metadata.addTag("vorbis",s,l)),r.UINT32_LE.len+n}}}).call(this,n(9).Buffer)},function(e,t,n){"use strict"; /** @license React v17.0.1 * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */n(23);var r=n(1),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var a=Symbol.for;i=a("react.element"),t.Fragment=a("react.fragment")}var o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,A=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,a={},l=null,u=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)A.call(t,r)&&!s.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:l,ref:u,props:a,_owner:o.current}}t.jsx=l,t.jsxs=l},function(e,t,n){"use strict"; /** @license React v17.0.1 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var r=n(23),i=60103,a=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,A=60110,s=60112;t.Suspense=60113;var l=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var c=Symbol.for;i=c("react.element"),a=c("react.portal"),t.Fragment=c("react.fragment"),t.StrictMode=c("react.strict_mode"),t.Profiler=c("react.profiler"),o=c("react.provider"),A=c("react.context"),s=c("react.forward_ref"),t.Suspense=c("react.suspense"),l=c("react.memo"),u=c("react.lazy")}var d="function"==typeof Symbol&&Symbol.iterator;function h(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n