!function(e,A){"object"==typeof exports&&"object"==typeof module?module.exports=A():"function"==typeof define&&define.amd?define([],A):"object"==typeof exports?exports.Webamp=A():e.Webamp=A()}(window,(function(){return function(e){var A={};function t(n){if(A[n])return A[n].exports;var r=A[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=e,t.c=A,t.d=function(e,A,n){t.o(e,A)||Object.defineProperty(e,A,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,A){if(1&A&&(e=t(e)),8&A)return e;if(4&A&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&A&&"string"!=typeof e)for(var r in e)t.d(n,r,function(A){return e[A]}.bind(null,r));return n},t.n=function(e){var A=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(A,"a",A),A},t.o=function(e,A){return Object.prototype.hasOwnProperty.call(e,A)},t.p="",t(t.s=47)}([function(e,A,t){"use strict";e.exports=t(55)},function(e,A,t){"use strict";e.exports=t(56)},function(e,A){e.exports=function(e,A,t){return A in e?Object.defineProperty(e,A,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[A]=t,e}},function(e,A,t){"use strict";function n(e,A){return e===A}function r(e,A,t){if(null===A||null===t||A.length!==t.length)return!1;for(var n=A.length,r=0;r1&&void 0!==arguments[1]?arguments[1]:n,t=null,a=null;return function(){return r(A,t,arguments)||(a=e.apply(null,arguments)),t=arguments,a}}function i(e){var A=Array.isArray(e[0])?e[0]:e;if(!A.every((function(e){return"function"==typeof e}))){var t=A.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+t+"]")}return A}function o(e){for(var A=arguments.length,t=Array(A>1?A-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:l;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 t=Object.keys(e);return A(t.map((function(A){return e[A]})),(function(){for(var e=arguments.length,A=Array(e),n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}},,,function(e,A){e.exports=function(e){var A=[];return A.toString=function(){return this.map((function(A){var t=function(e,A){var t=e[1]||"",n=e[3];if(!n)return t;if(A&&"function"==typeof btoa){var r=(i=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),a=n.sources.map((function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"}));return[t].concat(a).concat([r]).join("\n")}var i;return[t].join("\n")}(A,e);return A[2]?"@media "+A[2]+"{"+t+"}":t})).join("")},A.i=function(e,t){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},r=0;r=0&&u.splice(A,1)}function m(e){var A=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var n=function(){0;return t.nc}();n&&(e.attrs.nonce=n)}return E(A,e.attrs),h(e,A),A}function E(e,A){Object.keys(A).forEach((function(t){e.setAttribute(t,A[t])}))}function b(e,A){var t,n,r,a;if(A.transform&&e.css){if(!(a="function"==typeof A.transform?A.transform(e.css):A.transform.default(e.css)))return function(){};e.css=a}if(A.singleton){var i=c++;t=s||(s=m(A)),n=O.bind(null,t,i,!1),r=O.bind(null,t,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(t=function(e){var A=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",E(A,e.attrs),h(e,A),A}(A),n=I.bind(null,t,A),r=function(){f(t),t.href&&URL.revokeObjectURL(t.href)}):(t=m(A),n=k.bind(null,t),r=function(){f(t)});return n(e),function(A){if(A){if(A.css===e.css&&A.media===e.media&&A.sourceMap===e.sourceMap)return;n(e=A)}else r()}}e.exports=function(e,A){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(A=A||{}).attrs="object"==typeof A.attrs?A.attrs:{},A.singleton||"boolean"==typeof A.singleton||(A.singleton=i()),A.insertInto||(A.insertInto="head"),A.insertAt||(A.insertAt="bottom");var t=p(e,A);return g(t,A),function(e){for(var n=[],r=0;r>6*e)+a,t++;e>0;)A[t]=128|r>>6*(e-1)&63,t++,e--}}return t}t.r(A),t.d(A,"unpackString",(function(){return s})),t.d(A,"packString",(function(){return c})),t.d(A,"packStringTo",(function(){return u})),t.d(A,"packArrayTo",(function(){return d})),t.d(A,"unpackArrayTo",(function(){return g})),t.d(A,"packTo",(function(){return p})),t.d(A,"pack",(function(){return h})),t.d(A,"packArray",(function(){return f})),t.d(A,"unpackArray",(function(){return m})),t.d(A,"unpack",(function(){return E}));class i{constructor(e,A=!1,t=!1){this.bits=e,this.bytes=e<8?1:Math.ceil(e/8),this.max=Math.pow(2,e)-1,this.min=0;let n=8-(1+(e-1|7)-e);this.lastByteMask_=Math.pow(2,n>0?n:8)-1,this.unpack=this.unpackUnsigned_,A&&(this.max=Math.pow(2,e)/2-1,this.min=-this.max-1,this.unpack=this.unpackSigned_),t&&(this.overflow_=this.overflowClamp_)}pack(e,A,t=0){if(A!=A||A.constructor!=Number)throw new TypeError;A=this.overflow_(A),e[t]=255&(A<0?A+Math.pow(2,this.bits):A),t++;for(let n=2,r=this.bytes;n8&&(e[t]=Math.floor(A/Math.pow(2,8*(this.bytes-1)))&this.lastByteMask_,t++),t}unpack_(e,A=0){let t=0;for(let n=0;nthis.max||ethis.max?this.max:ethis.max&&(e-=2*this.max+2),e}}class o{constructor(e,A){this.ebits=e,this.fbits=A,this.bias=(1<this.biasP2-2*this.ebitsFbits&&(A=A<0?-1/0:1/0);let n=((A=+A)||1/A)<0||A<0?1:0;A=Math.abs(A);let r=Math.min(Math.floor(Math.log(A)/Math.LN2),1023),a=l(A/Math.pow(2,r)*Math.pow(2,this.fbits));return A!=A?(a=Math.pow(2,this.fbits-1),r=(1<=Math.pow(2,1-this.bias)?(a/Math.pow(2,this.fbits)>=2&&(r+=1,a=1),r>this.bias?(r=(1<=0;t--){let n=e[t+A].toString(2);r+="00000000".substring(n.length)+n}let a="1"==r.charAt(0)?-1:1;r=r.substring(1);let i=parseInt(r.substring(0,this.ebits),2);return r=r.substring(this.ebits),i==n?0!==parseInt(r,2)?NaN:a*(1/0):(0===i?(i+=1,t=parseInt(r,2)):t=parseInt("1"+r,2),a*t*this.fbias*Math.pow(2,i-this.bias))}packFloatBits_(e,A,t,n,r){let a=[];a.push(t);for(let e=this.ebits;e>0;e-=1)a[e]=n%2?1:0,n=Math.floor(n/2);let i=a.length;for(let e=this.fbits;e>0;e-=1)a[i+e]=r%2?1:0,r=Math.floor(r/2);let o=a.join(""),l=this.numBytes+A-1,s=A;for(;l>=A;)e[l]=parseInt(o.substring(0,8),2),o=o.substring(8),l--,s++;return s}}function l(e){let A=Math.floor(e),t=e-A;return t<.5?A:t>.5||A%2?A+1:A}function s(e,A=0,t=e.length){return function(e,A=0,t=e.length){let n="";for(let r=A;r=0&&i<=127)n+=String.fromCharCode(i);else{let o=0;i>=194&&i<=223?o=1:i>=224&&i<=239?(o=2,224===e[r]&&(A=160),237===e[r]&&(t=159)):i>=240&&i<=244?(o=3,240===e[r]&&(A=144),244===e[r]&&(t=143)):a=!0,i&=(1<<8-o-1)-1;for(let n=0;nt)&&(a=!0),i=i<<6|63&e[r],r++;a?n+=String.fromCharCode(65533):i<=65535?n+=String.fromCharCode(i):(i-=65536,n+=String.fromCharCode(55296+(i>>10&1023),56320+(1023&i)))}}return n}(e,A,t)}function c(e){let A=[];return a(e,A,0),A}function u(e,A,t=0){return a(e,A,t)}function d(e,A,t,r=0,a=!1){let i=w((A=A||{}).bits,A.fp,A.signed,a),o=Math.ceil(A.bits/8),l=0,s=r;try{for(let A=e.length;l53)throw new Error("Unsupported type: int, bits: "+e)}(e),A&&16===e?new o(5,11):A&&32==e?new o(8,23):A&&64==e?new o(11,52):new i(e,t,n)}},function(e,A){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},,function(e,A,t){"use strict";e.exports=function(e,A,t,n,r,a,i,o){if(!e){var l;if(void 0===A)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[t,n,r,a,i,o],c=0;(l=new Error(A.replace(/%s/g,(function(){return s[c++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},,,,function(e,A,t){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function i(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 A={},t=0;t<10;t++)A["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(A).map((function(e){return A[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,A){for(var t,o,l=i(e),s=1;s0)for(var t=(this.length>>1)-1;t>=0;t--)this._down(t)}function r(e,A){return eA?1:0}e.exports=n,e.exports.default=n,n.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 A=this.data,t=this.compare,n=A[e];e>0;){var r=e-1>>1,a=A[r];if(t(n,a)>=0)break;A[e]=a,e=r}A[e]=n},_down:function(e){for(var A=this.data,t=this.compare,n=this.length>>1,r=A[e];e=0)break;A[e]=o,e=a}A[e]=r}}},function(e,A,t){var n=t(75),r=t(77),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=r(e))&&e.replace(a,n).replace(i,"")}},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,A,t){"use strict";var n=this&&this.__read||function(e,A){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,r,a=t.call(e),i=[];try{for(;(void 0===A||A-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(r)throw r.error}}return i},r=this&&this.__spread||function(){for(var e=[],A=0;A{const n=new Image;n.onload=()=>{A(n)},n.onerror=t,n.src=e})}const Ae=e=>{if(null==e)return{minutesFirstDigit:" ",minutesSecondDigit:" ",secondsFirstDigit:" ",secondsSecondDigit:" "};const A=Math.floor(e/60),t=e%60,n=null==e?[" "," "," "," "]:[String(Math.floor(A/10)),String(Math.floor(A%10)),String(Math.floor(t/10)),String(Math.floor(t%10))],[r,a,i,o]=n;return{minutesFirstDigit:r,minutesSecondDigit:a,secondsFirstDigit:i,secondsSecondDigit:o}},te=(e,A=!0)=>{if(null==e)return"";const{minutesFirstDigit:t,minutesSecondDigit:n,secondsFirstDigit:r,secondsSecondDigit:a}=Ae(e);return[A&&"0"===t?"":t,n,":",r,a].join("")},ne=/^\s*\[(.+?)\]\s*$/,re=/^\s*([^;][^=]*)\s*=\s*(.*)\s*$/,ae=e=>{let A,t;return e.split(/[\r\n]+/g).reduce((e,n)=>{if((t=n.match(re))&&null!=A){const n=t[1].trim().toLowerCase(),r=t[2].replace(/\=.*$/g,"").trim().replace(/(^")|("$)|(^')|('$)/g,"");e[A][n]=r}else(t=n.match(ne))&&(A=t[1].trim().toLowerCase(),e[A]={});return e},{})},ie=(e,A,t)=>Math.min(Math.max(e,A),t);function oe(e){return window.btoa(Array.from(e).map(e=>String.fromCharCode(e)).join(""))}function le(e,A){const t=document.createElement("a");t.download=A,t.href=e,window.document.body.appendChild(t),t.click(),window.document.body.removeChild(t)}const se=(e,A,t)=>(t-e)/(A-e),ce=(e,A,t)=>A+Math.round(e*(t-A)),ue=(e,A)=>ce(e,0,A-1),de=(e,A,t,n)=>r=>ce(se(e,A,r),t,n),ge=de(1,64,0,100),pe=de(0,100,1,64);function he(e,A,t,n){const r=se(e,A,t);return n[ue(r,n.length)]}function fe(e){const A=[...e];let t=A.length;for(;t;){const e=Math.floor(Math.random()*t--),n=A[t];A[t]=A[e],A[e]=n}return A}function me(e,A,t){const n=new Array(e.length);let r=0;for(let a=0;a=0&&iA(e[t],t))}function we(e,A){const t={};return Object.keys(e).forEach(n=>t[n]=A(e[n],n)),t}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,A)=>({left:Math.min(e.left,A.left),top:Math.min(e.top,A.top),bottom:Math.max(e.bottom,A.bottom),right:Math.max(e.right,A.right)}))};function Oe(){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 A;const t=null!==(A=e.targetTouches[0])&&void 0!==A?A:e.touches[0];if(null==t)throw new Error("Unexpected touch event with zero touch targets.");return t}case"mousedown":case"mousemove":return e;default:throw new Error("Unexpected event type: "+e.type)}}function Ie(e){return ke(e).clientX}function Se(e){return ke(e).clientY}function Ue(e){const A=new WeakMap;return t=>(A.has(t)||A.set(t,e(t)),A.get(t))}function ve(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Ce(e){for(var A=1;A{switch(A.type){case"CLICKED_TRACK":return Ce(Ce({},e),{},{selectedTracks:new Set([e.trackOrder[A.index]]),lastSelectedIndex:A.index});case"CTRL_CLICKED_TRACK":{const r=e.trackOrder[A.index],a=new Set(e.selectedTracks);return n=r,(t=a).has(n)?t.delete(n):t.add(n),Ce(Ce({},e),{},{selectedTracks:a,lastSelectedIndex:A.index})}case"SHIFT_CLICKED_TRACK":if(null==e.lastSelectedIndex)return e;const r=A.index,a=Math.min(r,e.lastSelectedIndex),i=Math.max(r,e.lastSelectedIndex),o=new Set(e.trackOrder.slice(a,i+1));return Ce(Ce({},e),{},{selectedTracks:o});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(A=>!e.selectedTracks.has(A)))});case"REMOVE_ALL_TRACKS":return Ce(Ce({},e),{},{trackOrder:[],currentTrack:null,selectedTracks:new Set,lastSelectedIndex:null});case"REMOVE_TRACKS":const l=new Set(A.ids.map(Number)),{currentTrack:s}=e;return Ce(Ce({},e),{},{trackOrder:e.trackOrder.filter(e=>!l.has(e)),currentTrack:l.has(Number(s))?null:s,selectedTracks:new Set(Array.from(e.selectedTracks).filter(e=>l.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:fe(e.trackOrder)});case"SET_TRACK_ORDER":const{trackOrder:c}=A;return Ce(Ce({},e),{},{trackOrder:c});case"ADD_TRACK_FROM_URL":const u=null==A.atIndex?e.trackOrder.length:A.atIndex;return Ce(Ce({},e),{},{trackOrder:[...e.trackOrder.slice(0,u),Number(A.id),...e.trackOrder.slice(u)],lastSelectedIndex:null});case"PLAY_TRACK":case"BUFFER_TRACK":return Ce(Ce({},e),{},{currentTrack:A.id});case"DRAG_SELECTED":return Ce(Ce({},e),{},{trackOrder:me(e.trackOrder,A=>e.selectedTracks.has(e.trackOrder[A]),A.offset),lastSelectedIndex:null});default:return e}var t,n},Me=t(7),Ne=t.n(Me);function Te(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Qe(e){for(var A=1;A({size:e.size,open:e.open,hidden:!1,shade:e.shade||!1,position:e.position})),focused:e.focused}}var De=(e=Le,A)=>{switch(A.type){case"ENABLE_MILKDROP":return Qe(Qe({},e),{},{genWindows:Qe(Qe({},e.genWindows),{},{[j]:{title:"Milkdrop",size:[0,0],open:A.open,shade:!1,canResize:!0,canShade:!1,canDouble:!1,position:{x:0,y:0}}})});case"SET_FOCUSED_WINDOW":let t=e.windowOrder;return null!=A.window&&(t=[...e.windowOrder.filter(e=>e!==A.window),A.window]),Qe(Qe({},e),{},{focused:A.window,windowOrder:t});case"TOGGLE_WINDOW_SHADE_MODE":const{canShade:n}=e.genWindows[A.windowId];if(!n)throw new Error("Tried to shade/unshade a window that cannot be shaded: "+A.windowId);return Qe(Qe({},e),{},{genWindows:Qe(Qe({},e.genWindows),{},{[A.windowId]:Qe(Qe({},e.genWindows[A.windowId]),{},{shade:!e.genWindows[A.windowId].shade})})});case"TOGGLE_WINDOW":const r=e.genWindows[A.windowId];return Qe(Qe({},e),{},{genWindows:Qe(Qe({},e.genWindows),{},{[A.windowId]:Qe(Qe({},r),{},{open:!r.open})})});case"CLOSE_WINDOW":return Qe(Qe({},e),{},{genWindows:Qe(Qe({},e.genWindows),{},{[A.windowId]:Qe(Qe({},e.genWindows[A.windowId]),{},{open:!1})})});case"WINDOW_SIZE_CHANGED":const{canResize:a}=e.genWindows[A.windowId];if(!a)throw new Error("Tried to resize a window that cannot be resized: "+A.windowId);return Qe(Qe({},e),{},{genWindows:Qe(Qe({},e.genWindows),{},{[A.windowId]:Qe(Qe({},e.genWindows[A.windowId]),{},{size:A.size})})});case"UPDATE_WINDOW_POSITIONS":return Qe(Qe({},e),{},{positionsAreRelative:!0!==A.absolute&&e.positionsAreRelative,genWindows:we(e.genWindows,(e,t)=>{const n=A.positions[t];return null==n?e:Qe(Qe({},e),{},{position:n})})});case"RESET_WINDOW_SIZES":return Qe(Qe({},e),{},{genWindows:we(e.genWindows,e=>Qe(Qe({},e),{},{size:[0,0]}))});case"LOAD_SERIALIZED_STATE":{const{genWindows:t,focused:n,positionsAreRelative:r}=A.serializedState.windows;return Qe(Qe({},e),{},{positionsAreRelative:r,genWindows:we(e.genWindows,(e,A)=>{const n=t[A];if(null==n)return e;const{hidden:r}=n,a=Ne()(n,["hidden"]);return Qe(Qe({},e),a)}),focused:n})}case"BROWSER_WINDOW_SIZE_CHANGED":return Qe(Qe({},e),{},{browserWindowSize:{height:A.height,width:A.width}});default:return e}};function Ve(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Re(e){for(var A=1;A{switch(A.type){case"PLAY":case"IS_PLAYING":return Re(Re({},e),{},{status:Z});case"PAUSE":return Re(Re({},e),{},{status:$});case"STOP":case"IS_STOPPED":return Re(Re({},e),{},{status:X});case"TOGGLE_TIME_MODE":const t=e.timeMode===W?q:W;return Re(Re({},e),{},{timeMode:t});case"UPDATE_TIME_ELAPSED":return Re(Re({},e),{},{timeElapsed:A.elapsed});case"SET_MEDIA":return Re({},e);case"SET_VOLUME":return Re(Re({},e),{},{volume:A.volume});case"SET_BALANCE":return Re(Re({},e),{},{balance:A.balance});case"TOGGLE_REPEAT":return Re(Re({},e),{},{repeat:!e.repeat});case"TOGGLE_SHUFFLE":return Re(Re({},e),{},{shuffle:!e.shuffle});case"LOAD_SERIALIZED_STATE":return Re(Re({},e),A.serializedState.media);default:return e}},Ke=t(3);function ze(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Ye(e){for(var A=1;A{switch(A.type){case"LOAD_DEFAULT_SKIN":{const{skinImages:A,skinColors:t,skinCursors:n,skinPlaylistStyle:r,skinRegion:a,skinGenLetterWidths:i,skinGenExColors:o}=He;return Ye(Ye({},e),{},{skinImages:A,skinColors:t,skinCursors:n,skinPlaylistStyle:r,skinRegion:a,skinGenLetterWidths:i,skinGenExColors:o})}case"TOGGLE_DOUBLESIZE_MODE":return Ye(Ye({},e),{},{doubled:!e.doubled});case"TOGGLE_LLAMA_MODE":return Ye(Ye({},e),{},{llama:!e.llama});case"STEP_MARQUEE":return e.disableMarquee?e:Ye(Ye({},e),{},{marqueeStep:e.marqueeStep+1});case"DISABLE_MARQUEE":return Ye(Ye({},e),{},{disableMarquee:!0});case"STOP_WORKING":return Ye(Ye({},e),{},{working:!1});case"START_WORKING":return Ye(Ye({},e),{},{working:!0});case"CLOSE_WINAMP":return Ye(Ye({},e),{},{closed:!0});case"OPEN_WINAMP":return Ye(Ye({},e),{},{closed:!1});case"LOADING":return Ye(Ye({},e),{},{loading:!0});case"LOADED":return Ye(Ye({},e),{},{loading:!1});case"SET_SKIN_DATA":const{data:t}=A;return Ye(Ye({},e),{},{loading:!1,skinImages:t.skinImages,skinColors:t.skinColors,skinPlaylistStyle:t.skinPlaylistStyle,skinCursors:t.skinCursors,skinRegion:t.skinRegion,skinGenLetterWidths:t.skinGenLetterWidths,skinGenExColors:t.skinGenExColors||Je});case"TOGGLE_VISUALIZER_STYLE":return Ye(Ye({},e),{},{visualizerStyle:(e.visualizerStyle+1)%_.length});case"SET_PLAYLIST_SCROLL_POSITION":return Ye(Ye({},e),{},{playlistScrollPosition:A.position});case"SET_Z_INDEX":return Ye(Ye({},e),{},{zIndex:A.zIndex});case"SET_DUMMY_VIZ_DATA":return Ye(Ye({},e),{},{dummyVizData:A.data});case"LOAD_SERIALIZED_STATE":{const t=A.serializedState.display,{skinCursors:n}=t,r=Ne()(t,["skinCursors"]),a=e=>({type:"cur",url:e}),i=null==n?null:we(n,a);return Ye(Ye({},e),{},{skinCursors:i},r)}default:return e}};const qe=e=>{const{visualizerStyle:A,doubled:t,llama:n,marqueeStep:r,skinImages:a,skinCursors:i,skinRegion:o,skinGenLetterWidths:l,skinColors:s,skinPlaylistStyle:c}=e;let u=null;return null!=i&&(u=we(i,e=>"cur"===e.type?e.url:void 0)),{visualizerStyle:A,doubled:t,llama:n,marqueeStep:r,skinImages:a,skinCursors:u,skinRegion:o,skinGenLetterWidths:l,skinColors:s,skinPlaylistStyle:c}},We=Object(Ke.createSelector)(e=>e.visualizerStyle,e=>_[e]);function Ze(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Xe(e){for(var A=1;A{switch(A.type){case"SET_FOCUS":return Xe(Xe({},e),{},{focus:A.input,bandFocused:null});case"SET_BAND_FOCUS":return Xe(Xe({},e),{},{focus:A.input,bandFocused:A.bandFocused});case"UNSET_FOCUS":return Xe(Xe({},e),{},{focus:null,bandFocused:null});case"SET_SCRUB_POSITION":return Xe(Xe({},e),{},{scrubPosition:A.position});case"SET_USER_MESSAGE":return Xe(Xe({},e),{},{userMessage:A.message});case"UNSET_USER_MESSAGE":return Xe(Xe({},e),{},{userMessage:null});default:return e}};function AA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function tA(e){for(var A=1;A{switch(A.type){case"SET_BAND_VALUE":const t=tA(tA({},e.sliders),{},{[A.band]:A.value});return tA(tA({},e),{},{sliders:t});case"SET_EQ_ON":return tA(tA({},e),{},{on:!0});case"SET_EQ_OFF":return tA(tA({},e),{},{on:!1});case"SET_EQ_AUTO":return tA(tA({},e),{},{auto:A.value});case"LOAD_SERIALIZED_STATE":return A.serializedState.equalizer||e;default:return e}};function aA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function iA(e){for(var A=1;A{switch(A.type){case"NETWORK_CONNECTED":return iA(iA({},e),{},{connected:!0});case"NETWORK_DISCONNECTED":return iA(iA({},e),{},{connected:!1});default:return e}};function lA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function sA(e){for(var A=1;A{switch(A.type){case"SET_AVAILABLE_SKINS":return sA(sA({},e),{},{availableSkins:A.skins});default:return e}},dA=t(19),gA=t.n(dA);async function pA(e){return new Promise((A,t)=>{const n=new FileReader;n.onload=()=>{A(n.result)},n.onerror=t,n.readAsText(e)})}async function hA({accept:e,directory:A=!1}={accept:null,directory:!1}){return new Promise(t=>{const n=document.createElement("input");e&&n.setAttribute("accept",e),n.type="file",n.multiple=!0,n.webkitdirectory=A,n.directory=A,n.mozdirectory=A,n.value=null,n.addEventListener("change",e=>{const A=e.target.files;t(A)}),n.click()})}function fA(e){return"data:image/x-win-bitmap;base64,"+oe(e)}function mA(e){if(function(e){return/^blob:/.test(e)}(e))return null;const A=e.split("/").pop();return null==A?null:A.split("#")[0].split("?")[0]}const EA=Ue(e=>{const{artist:A,title:t,defaultName:n,url:r}=e;if(A&&t)return`${A} - ${t}`;if(t)return t;if(n)return n;if(r){const e=mA(r);if(e)return e}return"???"});Ue(e=>{if(e.url){const A=mA(e.url);if(null!=A)return A}return e.defaultName?e.defaultName:"???"});function bA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function wA(e){for(var A=1;A{var t;switch(A.type){case"ADD_TRACK_FROM_URL":return wA(wA({},e),{},{[A.id]:{id:A.id,defaultName:A.defaultName||null,duration:null!==(t=A.duration)&&void 0!==t?t:null,url:A.url,mediaTagsRequestStatus:F}});case"SET_MEDIA":{const t=wA(wA({},e[A.id]),{},{duration:A.length});return wA(wA({},e),{},{[A.id]:t})}case"MEDIA_TAG_REQUEST_INITIALIZED":return wA(wA({},e),{},{[A.id]:wA(wA({},e[A.id]),{},{mediaTagsRequestStatus:F})});case"MEDIA_TAG_REQUEST_FAILED":return wA(wA({},e),{},{[A.id]:wA(wA({},e[A.id]),{},{mediaTagsRequestStatus:G})});case"SET_MEDIA_DURATION":return wA(wA({},e),{},{[A.id]:wA(wA({},e[A.id]),{},{duration:A.duration})});case"SET_MEDIA_TAGS":const n=e[A.id],{sampleRate:r,bitrate:a,numberOfChannels:i,title:o,artist:l,album:s,albumArtUrl:c}=A,{kbps:u,khz:d,channels:g}=n;return wA(wA({},e),{},{[A.id]:wA(wA({},n),{},{mediaTagsRequestStatus:P,title:o,artist:l,album:s,albumArtUrl:c,kbps:null!=a?String(Math.round(a/1e3)):u,khz:null!=r?String(Math.round(r/1e3)):d,channels:null!=i?i:g})});default:return e}};let kA;function IA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function SA(e){for(var A=1;A{switch(A.type){case"SET_MILKDROP_DESKTOP":return SA(SA({},e),{},{display:A.enabled?"DESKTOP":"WINDOW"});case"SET_MILKDROP_FULLSCREEN":return SA(SA({},e),{},{display:A.enabled?"FULLSCREEN":"WINDOW"});case"GOT_BUTTERCHURN":return SA(SA({},e),{},{butterchurn:A.butterchurn});case"GOT_BUTTERCHURN_PRESETS":return SA(SA({},e),{},{presets:e.presets.concat(A.presets)});case"PRESET_REQUESTED":return A.addToHistory?SA(SA({},e),{},{presetHistory:[...e.presetHistory,A.index]}):SA(SA({},e),{},{presetHistory:e.presetHistory.slice(0,-1)});case"RESOLVE_PRESET_AT_INDEX":const a=e.presets[A.index];return SA(SA({},e),{},{presets:(t=e.presets,n=A.index,r={type:"RESOLVED",name:a.name,preset:A.json},[...t.slice(0,n),r,...t.slice(n+1)])});case"SELECT_PRESET_AT_INDEX":return SA(SA({},e),{},{currentPresetIndex:A.index,transitionType:A.transitionType});case"TOGGLE_PRESET_OVERLAY":return SA(SA({},e),{},{overlay:!e.overlay});case"TOGGLE_RANDOMIZE_PRESETS":return SA(SA({},e),{},{randomize:!e.randomize});case"TOGGLE_PRESET_CYCLING":return SA(SA({},e),{},{cycling:!e.cycling});case"SCHEDULE_MILKDROP_MESSAGE":return SA(SA({},e),{},{message:{text:A.message,time:Date.now()}});default:return e}var t,n,r};var CA=Object(m.combineReducers)({userInput:eA,windows:De,display:_e,settings:uA,equalizer:rA,playlist:xe,media:Pe,network:oA,tracks:OA,milkdrop:vA});function BA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function xA(e){for(var A=1;AObject(a.jsx)("body",xA({},e)),TA=e=>Object(a.jsx)("font",xA({},e)),QA=e=>Object(a.jsx)("hr",xA({},e)),LA=e=>Object(a.jsx)("div",xA({},e)),jA=e=>Object(a.jsx)("table",xA({},e)),DA=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)(NA,{bgcolor:"#000080",topmargin:"0",leftmargin:"0",text:"#FFFFFF",children:[Object(a.jsxs)(LA,{align:"center",children:[Object(a.jsx)(LA,{className:"para2",align:"center",children:Object(a.jsx)("p",{children:"WINAMP"})}),Object(a.jsx)(LA,{className:"para1",align:"center",children:Object(a.jsx)("p",{children:"playlist"})})]}),Object(a.jsx)(QA,{align:"left",width:"90%",size:"1",color:"#FFBF00",style:MA}),Object(a.jsx)(LA,{align:"right",children:Object(a.jsx)(jA,{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)(TA,{face:"Arial",color:"#FFBF00",children:e.numberOfTracks}),Object(a.jsx)(TA,{color:"#409FFF",face:"Arial",children:" track in playlist, average track length: "}),Object(a.jsx)(TA,{face:"Arial",color:"#FFBF00",children:e.averageTrackLength})]})}),Object(a.jsx)("br",{}),Object(a.jsx)("small",{children:Object(a.jsxs)("small",{children:[Object(a.jsx)(TA,{color:"#409FFF",face:"Arial",children:"Playlist length: "}),Object(a.jsx)(TA,{face:"Arial",color:"#FFBF00",children:e.playlistLengthMinutes}),Object(a.jsx)(TA,{color:"#409FFF",face:"Arial",children:" minutes "}),Object(a.jsx)(TA,{face:"Arial",color:"#FFBF00",children:e.playlistLengthSeconds}),Object(a.jsx)(TA,{color:"#409FFF",face:"Arial",children:" second "}),Object(a.jsx)("br",{}),Object(a.jsxs)(TA,{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)(TA,{color:"#FFBF00",face:"Arial",children:Object(a.jsx)("big",{children:"Playlist files:"})})}),Object(a.jsx)("ul",{children:Object(a.jsx)(TA,{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)(QA,{align:"left",width:"90%",size:"1",color:"#FFBF00",style:MA})]})]}),VA=e=>{return A=(e=>{const A=document.createElement("div");return Object(l.render)(Object(a.jsx)(DA,xA({},e)),A),A.innerHTML})(e),"data:text/html;base64,"+window.btoa(A);var A},RA=(e,A)=>{const t=(n=(A-50)/50*12,(Math.round(10*n)/10).toFixed(1));var n;var r;return`EQ: ${"preamp"===e?"Preamp":(r=e)<1e3?r+"HZ":r/1e3+"KHZ"} ${(e=>e>0?"+"+e:e.toString())(t)} DB`};function FA(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function GA(e){for(var A=1;Ae.equalizer.sliders,KA=Object(Ke.createSelector)(PA,e=>{const A={name:"Entry1",preamp:pe(e.preamp)};return N.forEach(t=>{A["hz"+t]=pe(e[t])}),{presets:[A],type:"Winamp EQ library file v1.1"}}),zA=e=>e.tracks,YA=e=>A=>{var t;return null===(t=e.tracks[A])||void 0===t?void 0:t.url},JA=e=>e.playlist.trackOrder,HA=Object(Ke.createSelector)(JA,e=>e.length),_A=Object(Ke.createSelector)(zA,JA,(e,A)=>A.filter(A=>e[A])),qA=Object(Ke.createSelector)(zA,JA,(e,A)=>A.map(A=>{const t=e[A];return{url:t.url,metaData:{artist:t.artist||"",title:t.title||"",album:t.album,albumArtUrl:t.albumArtUrl||""}}})),WA=Object(Ke.createSelector)(zA,_A,(e,A)=>A.map(A=>e[A])),ZA=e=>e.playlist.selectedTracks,XA=Object(Ke.createSelector)(WA,ZA,(e,A)=>e.filter(e=>A.has(e.id))),$A=e=>e.reduce((e,A)=>e+Number(A.duration),0),et=Object(Ke.createSelector)(WA,$A),At=Object(Ke.createSelector)(XA,$A),tt=Object(Ke.createSelector)(et,At,(e,A)=>`${te(A)}/${te(e)}`),nt=e=>{const{playlist:A}=e;return null==A.currentTrack?-1:A.trackOrder.indexOf(A.currentTrack)},rt=Object(Ke.createSelector)(nt,e=>e+1),at=e=>e.playlist.currentTrack,it=(e,A=1)=>{const{playlist:{trackOrder:t},media:{repeat:n,shuffle:r}}=e;if(r)return(e=>{const{playlist:{trackOrder:A,currentTrack:t}}=e;if(0===A.length)return null;let n;do{n=A[Math.floor(A.length*Math.random())]}while(n===t&&A.length>1);return n})(e);const a=HA(e);if(0===a)return null;const i=nt(e);let o=i+A;return n?(o%=a,o<0&&(o+=a),t[o]):i===a-1&&A>0||0===i&&A<0?null:(o=ie(o,0,a-1),t[o])},ot=e=>e.windows.genWindows,lt=Object(Ke.createSelector)(ot,e=>A=>e[A].open),st=Object(Ke.createSelector)((function(e){return"WINDOW"===e.milkdrop.display}),e=>A=>A===j&&!e),ct=Object(Ke.createSelector)(ot,e=>A=>e[A].shade),ut=Object(Ke.createSelector)(ot,e=>A=>e[A].size),dt=Object(Ke.createSelector)(ot,e=>we(e,e=>e.position)),gt=Object(Ke.createSelector)(ut,e=>{const A=e("playlist");return Math.floor((58+29*A[1])/13)}),pt=Object(Ke.createSelector)(HA,gt,(e,A)=>Math.max(0,e-A)),ht=e=>e.display.playlistScrollPosition,ft=Object(Ke.createSelector)(pt,ht,(e,A)=>0===e?0:Math.round(Math.round(e*A/100)/e*100)),mt=Object(Ke.createSelector)(ht,HA,gt,(e,A,t)=>{const n=Math.max(0,A-t);return ue(e/100,n+1)}),Et=Object(Ke.createSelector)(mt,JA,gt,(e,A,t)=>A.slice(e,e+t));function bt(e){return Et(e).length===e.playlist.trackOrder.length}const wt=Object(Ke.createSelector)(Et,e=>A=>e.includes(A)),yt=(Object(Ke.createSelector)(Et,zA,(e,A)=>e.map(e=>A[e])),e=>{const{playlist:A,tracks:t}=e;if(null==A.currentTrack)return null;const n=t[A.currentTrack];return n&&n.duration}),Ot=Object(Ke.createSelector)(zA,e=>Object(Ke.defaultMemoize)(A=>((e,A=null)=>{if(null==A)return null;const t=e[A];return null==t?null:EA(t)})(e,A))),kt=Object(Ke.createSelector)(at,Ot,(e,A)=>A(e)),It=e=>e.media.status,St=e=>e.media.status===Z,Ut=Object(Ke.createSelector)(at,zA,(e,A)=>null==e?null:A[e]),vt=Object(Ke.createSelector)(St,Ut,(e,A)=>e&&A&&A.mediaTagsRequestStatus!==F?A.id:null),Ct=Object(Ke.createSelector)(Ut,e=>null==e?null:{url:e.url,metaData:{title:e.title||null,artist:e.artist||null,album:e.album||null,albumArtUrl:e.albumArtUrl||null}}),Bt=Object(Ke.createSelector)(rt,kt,(e,A)=>null==A?null:`${e}. ${A}`),xt=Object(Ke.createSelector)(Bt,yt,(e,A)=>null==e?null:`${e} (${te(A)})`),Mt=e=>JA(e).length,Nt=Object(Ke.createSelector)(zA,e=>Object.values(e).reduce((e,A)=>e+(A.duration||0),0)),Tt=Object(Ke.createSelector)(Mt,Nt,JA,zA,Ot,(e,A,t,n,r)=>VA({numberOfTracks:e,averageTrackLength:te(A/e),playlistLengthMinutes:Math.floor(A/60),playlistLengthSeconds:Math.floor(A%60),tracks:t.map((e,A)=>`${A+1}. ${r(e)} (${te(n[e].duration)})`)}));function Qt(e,A){const[t,n]=e.size,r=A&&e.canDouble?2:1,a=116+29*n,i=275+25*t;return{height:(e.shade?14:a)*r,width:i*r}}function Lt(e){return e.windows.focused}function jt(e){return e.display.doubled}function Dt(e){return e.display.llama}function Vt(e){return e.display.zIndex}const Rt=Object(Ke.createSelector)(ot,jt,(e,A)=>we(e,e=>Qt(e,A))),Ft=Object(Ke.createSelector)(Rt,e=>A=>e[A]),Gt=Object(Ke.createSelector)(e=>e.windows.windowOrder,ot,(e,A)=>[T,...e.filter(e=>e!==T&&null!=A[e])]),Pt=Object(Ke.createSelector)(Rt,dt,Gt,(e,A,t)=>t.map(t=>GA(GA({key:t},e[t]),A[t]))),Kt=Object(Ke.createSelector)(Pt,(function(e){const A={},t={};for(const n of e){const e=n.y+n.height;A[e]?A[e].push(n):A[e]=[n];const r=n.x+n.width;t[r]?t[r].push(n):t[r]=[n]}const n={};for(const r of e){const e={},a=r.y,i=r.x,o=A[a],l=t[i];if(o)for(const A of o){const t=A.x+A.widthr.x+r.width;if(!(t||n)){e.below=A.key;break}}if(l)for(const A of l){const t=A.y+A.heightr.y+r.height;if(!(t||n)){e.right=A.key;break}}n[r.key]=e}return n})),zt={normal:"#00FF00",current:"#FFFFFF",normalbg:"#000000",selectedbg:"#0000C6",font:"Arial"};function Yt(e){return e.display.skinColors}const Jt=e=>e.display.skinPlaylistStyle||zt,Ht=e=>{const A=e.windows.genWindows[j];return null!=A&&A.open?H:We(e.display)},_t=e=>e.media.volume,qt=e=>e.media.balance,Wt=e=>e.media.shuffle,Zt=e=>e.media.repeat,Xt=Object(Ke.createSelector)(Ut,e=>null!=e&&e.channels||null),$t=e=>e.media.timeElapsed;function en(e){return e.equalizer.on}function An(e){return e.windows.browserWindowSize}const tn=Object(Ke.createSelector)(ot,e=>{return A=e,t=e=>e.open,Object.keys(A).reduce((e,n)=>(t(A[n],n)&&(e[n]=A[n]),e),{});var A,t}),nn=Object(Ke.createSelector)(tn,jt,(e,A)=>{let t=0;return we(e,e=>{const n={x:0,y:t};return t+=Qt(e,A).height,n})}),rn=e=>e.userInput.focus,an=e=>e.userInput.scrubPosition,on=e=>{if(null!=e.userInput.userMessage)return e.userInput.userMessage;switch(rn(e)){case"balance":return(e=>{if(0===e)return"Balance: Center";const A=e>0?"Right":"Left";return`Balance: ${Math.abs(e)}% ${A}`})(e.media.balance);case"volume":return`Volume: ${e.media.volume}%`;case"position":const A=yt(e);return null==A?"Winamp 2.91":((e,A)=>`Seek to: ${te(e*A/100,!1)}/${te(e,!1)} (${A}%)`)(A,an(e));case"double":return(e.display.doubled?"Disable":"Enable")+" doublesize mode";case"eq":const t=e.userInput.bandFocused;return null==t?"Winamp 2.91":RA(t,e.equalizer.sliders[t])}if(null!=e.playlist.currentTrack){const A=xt(e);return null==A?"Winamp 2.91":A}return"Winamp 2.91"},ln=Object(Ke.createSelector)(Ut,e=>null!=e&&e.kbps||null),sn=Object(Ke.createSelector)(Ut,e=>null!=e&&e.khz||null);function cn(e){return e.milkdrop.message}function un(e){return"DESKTOP"===e.milkdrop.display}function dn(e){return"FULLSCREEN"===e.milkdrop.display}function gn(e){return e.milkdrop.butterchurn}function pn(e){return e.milkdrop.transitionType}function hn(e){return e.milkdrop.currentPresetIndex}function fn(e){const A=hn(e);if(null==A)return null;const t=e.milkdrop.presets[A];return null==t||"UNRESOLVED"===t.type?null:t.preset}function mn(e){return e.milkdrop.presets.map(e=>e.name)}function En(e){return e.milkdrop.overlay}function bn(e){return e.milkdrop.cycling}function wn(e){return e.milkdrop.randomize}function yn(e){return e.display.closed}function On(e){return e.display.skinRegion}const kn=Object(Ke.createSelector)((function(e){return e.display.skinImages.EQ_PREAMP_LINE}),async e=>null==e?null:ee(e)),In=Object(Ke.createSelector)((function(e){return e.display.skinImages.EQ_GRAPH_LINE_COLORS}),async e=>null==e?null:ee(e));function Sn(e){return e.display.dummyVizData}function Un(e){return e.display.marqueeStep}function vn(e){return e.network.connected}function Cn(e){return e.media.timeMode}function Bn(e){return e.display.loading}function xn(e){return e.display.working}function Mn(e){return e.settings.availableSkins}const Nn=e=>e.y,Tn=e=>e.y+e.height,Qn=e=>e.x,Ln=e=>e.x+e.width,jn=(e,A)=>Math.abs(e-A)<15,Dn=(e,A)=>{let t,n;var r,a;return a=A,Nn(r=e)<=Tn(a)+15&&Nn(a)<=Tn(r)+15&&(jn(Qn(e),Ln(A))?t=Ln(A):jn(Ln(e),Qn(A))?t=Qn(A)-e.width:jn(Qn(e),Qn(A))?t=Qn(A):jn(Ln(e),Ln(A))&&(t=Ln(A)-e.width)),((e,A)=>Qn(e)<=Ln(A)+15&&Qn(A)<=Ln(e)+15)(e,A)&&(jn(Nn(e),Tn(A))?n=Tn(A):jn(Tn(e),Nn(A))?n=Nn(A)-e.height:jn(Nn(e),Nn(A))?n=Nn(A):jn(Tn(e),Tn(A))&&(n=Tn(A)-e.height)),{x:t,y:n}},Vn=(e,A)=>{const t=Dn(e,A);return{x:void 0===t.x?0:t.x-e.x,y:void 0===t.y?0:t.y-e.y}};const Rn=(e,A)=>({x:e.x+A.x,y:e.y+A.y});function Fn(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Gn(e){for(var A=1;A{const n=t(),r=Kt(n),a=Rt(n);A(e);const i=Rt(t()),o={};for(const e of Object.keys(i)){const A=a[e],t=i[e];o[e]={height:t.height-A.height,width:t.width-A.width}}const l=function(e,A){const t={},n={};for(const A of Object.keys(e))t[A]={above:[],left:[]},n[A]={x:0,y:0};for(const[A,n]of Object.entries(e)){const{below:e,right:r}=n;null!=r&&t[r].left.push(A),null!=e&&t[e].above.push(A)}function r(e){const a=t[e],i=A[e];a.left.forEach(A=>{n[A].x+=i.width+n[e].x,r(A)})}function a(e){const r=t[e],i=A[e];r.above.forEach(A=>{n[A].y+=i.height+n[e].y,a(A)})}for(const[A,t]of Object.entries(e))null==t.below&&a(A),null==t.right&&r(A);return n}(r,o);A(Zn(we(dt(n),(e,A)=>Rn(e,l[A]))))}}function Kn(){return Pn({type:"TOGGLE_DOUBLESIZE_MODE"})}function zn(){return Pn({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"equalizer"})}function Yn(){return Pn({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"main"})}function Jn(){return Pn({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"playlist"})}function Hn(e){return{type:"CLOSE_WINDOW",windowId:e}}function _n(e){return{type:"SET_FOCUSED_WINDOW",window:e}}function qn(e,A){return{type:"WINDOW_SIZE_CHANGED",windowId:e,size:A}}function Wn(e){return{type:"TOGGLE_WINDOW",windowId:e}}function Zn(e,A){return{type:"UPDATE_WINDOW_POSITIONS",positions:e,absolute:A}}function Xn(e){return(A,t)=>{const n=t(),r=Pt(n),a=lt(n),{top:i,left:o,width:l,height:s}=e,c=o+window.scrollX,u=i+window.scrollY,d=ye(r.filter(e=>a(e.key)));if(null==d)return;const g=d.bottom-d.top,p=d.right-d.left,h=Math.ceil(c-d.left+(l-p)/2),f=Math.ceil(u-d.top+(s-g)/2);A(Zn(r.reduce((e,A)=>Gn(Gn({},e),{},{[A.key]:{x:h+A.x,y:f+A.y}}),{}),!0))}}function $n(e){return A=>{A(Gn({type:"BROWSER_WINDOW_SIZE_CHANGED"},e)),A(Ar())}}function er(){return(e,A)=>{e(Zn(nn(A())))}}function Ar(){return(e,A)=>{const t=A(),n=Pt(t),r=lt(t),{height:a,width:i}=Oe(),o=ye(n.filter(e=>r(e.key)));if(null==o)return;const l=dt(t);if(o.left>=0&&o.top>=0&&o.right<=i&&o.bottom<=a)return;const s=o.bottom-o.top;if(o.right-o.left<=i&&s<=a){let A=0,t=0;return o.top<=0?A=o.top:o.bottom>a&&(A=o.bottom-a),o.left<=0?t=o.left:o.right>i&&(t=o.right-i),void e(Zn(we(l,e=>({x:e.x-t,y:e.y-A}))))}e({type:"RESET_WINDOW_SIZES"}),e(er()),e(Xn({left:window.scrollX,top:window.scrollY,width:window.innerWidth,height:window.innerHeight}))}}function tr(e){return{type:"PLAY_TRACK",id:e}}function nr(){return(e,A)=>{const t=A();t.media.status===X&&null==t.playlist.currentTrack&&0===t.playlist.trackOrder.length?e(Ua()):e({type:"PLAY"})}}function rr(){return(e,A)=>{const{status:t}=A().media;e(t===Z?{type:"PAUSE"}:{type:"PLAY"})}}function ar(){return{type:"STOP"}}function ir(e){return(A,t)=>{const n=it(t(),e);var r;null!=n?A((r=n,(e,A)=>{const t=A();e(It(t)===X?{type:"BUFFER_TRACK",id:r}:{type:"PLAY_TRACK",id:r})})):A({type:"IS_STOPPED"})}}function or(){return ir(1)}function lr(){return ir(-1)}function sr(e){return function(A,t){const n=t(),r=yt(n);null!=r&&A({type:"SEEK_TO_PERCENT_COMPLETE",percent:e/r*100})}}function cr(e){return function(A,t){A(sr($t(t())+e))}}function ur(e){return cr(-e)}function dr(e){return{type:"SET_VOLUME",volume:ie(e,0,100)}}function gr(e){return(A,t)=>A(dr(t().media.volume+e))}function pr(e){return e.preventDefault(),(A,t)=>A(dr(t().media.volume+e.deltaY))}function hr(e){return e=ie(e,-100,100),Math.abs(e)<25&&(e=0),{type:"SET_BALANCE",balance:e}}function fr(){return{type:"TOGGLE_REPEAT"}}function mr(){return{type:"TOGGLE_SHUFFLE"}}function Er(){return{type:"TOGGLE_TIME_MODE"}}function br(e){return e<55&&e>45?50:e}function wr(e,A){return{type:"SET_BAND_VALUE",band:e,value:br(A)}}function yr(e){return A=>{Object.values(N).forEach(t=>{A({type:"SET_BAND_VALUE",value:e,band:t})})}}function Or(){return yr(100)}function kr(){return yr(50)}function Ir(){return yr(0)}function Sr(e){return{type:"SET_BAND_VALUE",band:"preamp",value:br(e)}}function Ur(){return(e,A)=>{A().equalizer.on?e({type:"SET_EQ_OFF"}):e({type:"SET_EQ_ON"})}}function vr(){return e=>{e({type:"SET_EQ_AUTO",value:!1})}}var Cr=t(29);const Br={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]},xr=e=>"CHARACTER_"+e.charCodeAt(0),Mr=[];for(const e in Br)if(Br.hasOwnProperty(e)){const A=Br[e];Mr.push({name:xr(e),y:6*A[0],x:5*A[1],width:5,height:6})}var Nr={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:Mr,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 Tr(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Qr(e){for(var A=1;A{t.height=A.height,t.width=A.width,n.drawImage(e,-A.x,-A.y);const a=t.toDataURL();r[A.name]=a}),r}async function Rr(e,A){const t=await jr(e,A,"(png|bmp)","blob");if(!t)return null;const n="image/"+((e=>{const A=/\.([a-z]{3,4})$/i.exec(e);return A?A[1].toLowerCase():null})(t.name)||"*");return Dr(new Blob([t.contents],{type:n}))}const Fr="RIFF".split("").map(e=>e.charCodeAt(0));async function Gr(e,A){const t=await jr(e,A,"CUR","uint8array");if(null==t)return null;const n=t.contents;return r=n,Fr.every((e,A)=>r[A]===e)?{type:"ani",aniData:n}:{type:"cur",url:fA(n)};var r}async function Pr(e){const A=e.file(Lr("PLEDIT","txt"))[0];if(null==A)return z.playlistStyle;const t=await A.async("text");if(null==t)return z.playlistStyle;const n=t&&ae(t).text;return n?(["normal","current","normalbg","selectedbg","mbFG","mbBG"].forEach(e=>{let A=n[e];A&&("#"!==A[0]&&(A="#"+A),n[e]=A.slice(0,7))}),Qr(Qr({},z.playlistStyle),n)):z.playlistStyle}async function Kr(e){const A=await Rr(e,"GENEX");if(null==A)return null;const t=document.createElement("canvas"),n=t.getContext("2d");if(null==n)return null;t.width=A.width,t.height=A.height,n.drawImage(A,0,0);const r=e=>`rgb(${n.getImageData(e,0,1,1).data.slice(0,3).join(",")})`;return{itemBackground:r(48),itemForeground:r(50),windowBackground:r(52),buttonText:r(54),windowText:r(56),divider:r(58),playlistSelection:r(60),listHeaderBackground:r(62),listHeaderText:r(64),listHeaderFrameTopAndLeft:r(66),listHeaderFrameBottomAndRight:r(68),listHeaderFramePressed:r(70),listHeaderDeadArea:r(72),scrollbarOne:r(74),scrollbarTwo:r(76),pressedScrollbarOne:r(78),pressedScrollbarTwo:r(80),scrollbarDeadArea:r(82),listTextHighlighted:r(84),listTextHighlightedBackground:r(86),listTextSelected:r(88),listTextSelectedBackground:r(90)}}function zr(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Yr(e){for(var A=1;Ae.reduce((e,A)=>Object.assign(e,A),{}),Hr=["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 _r(e){const A=await jr(e,"VISCOLOR","txt","text");return A?(e=>{const A=e.split("\n"),t=/^\s*(\d+)\s*,?\s*(\d+)\s*,?\s*(\d+)/,n=[...z.colors];return A.map(e=>t.exec(e)).filter(Boolean).map(e=>e.slice(1,4).join(",")).map((e,A)=>{n[A]=`rgb(${e})`}),n})(A.contents):z.colors}async function qr(e){const A=await Promise.all(Object.keys(Nr).map(A=>async function(e,A){const t=await Rr(e,A);return null==t?{}:Vr(t,Nr[A])}(e,A)));return Jr(A)}async function Wr(e){const A=await Promise.all(Hr.map(async A=>({[A]:await Gr(e,A)})));return Jr(A)}async function Zr(e){const A=await jr(e,"REGION","txt","text");return A?function(e){const A=ae(e),t={};return Object.keys(A).forEach(e=>{const{numpoints:n,pointlist:r}=A[e];if(!n||!r)return;const a=n.split(/\s*,\s*/).filter(e=>""!==e),i=function(e){const A=[];for(let t=0;t""!==e));let o=0;const l=a.map(e=>{const A=Number(e);if(A<3)return o+=A,null;const t=i.slice(o,o+A).join(" ");return t.length?(o+=A,t):null}).filter(e=>null!=e);l.length&&(t[e]=l)}),t}(A.contents):{}}async function Xr(e){const A=await Rr(e,"GEN");if(null==A)return null;const t=document.createElement("canvas"),n=t.getContext("2d");t.width=A.width,t.height=A.height,n.drawImage(A,0,0);const r=(e,A)=>{const r=A=>n.getImageData(A,e,1,1).data.join(",");let a=1;const i=r(0);return K.map(n=>{let o=a;for(;r(o)!==i&&o{a[e.name]=e.width}),[a,Vr(A,i)]}var $r=async function(e,A){const t=await A.loadAsync(e),[n,r,a,i,o,l,s]=await Promise.all([_r(t),Pr(t),qr(t),Wr(t),Zr(t),Xr(t),Kr(t)]),[c,u]=l||[null,{}];return{colors:n,playlistStyle:r,images:Yr(Yr({},a),u),genLetterWidths:c,cursors:i,region:o,genExColors:s}},ea=t(39),Aa=t.n(ea);function ta(){return(e,A)=>{const t=A();if(0===XA(t).length)return;const n=ZA(t),{playlist:{trackOrder:r}}=t;e({type:"REMOVE_TRACKS",ids:r.filter(e=>!n.has(e))})}}function na(){return(e,A)=>{e({type:"REMOVE_TRACKS",ids:Array.from(ZA(A()))})}}function ra(){return e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}}function aa(){return{type:"REVERSE_LIST"}}function ia(){return{type:"RANDOMIZE_LIST"}}function oa(){return(e,A)=>{const t=A(),n=zA(t);var r,a;return e({type:"SET_TRACK_ORDER",trackOrder:(r=JA(t),a=e=>(""+n[e].title).toLowerCase(),[...r].sort((e,A)=>{const t=a(e),n=a(A);return tn?1:0}))})}}function la(e){return{type:"SET_PLAYLIST_SCROLL_POSITION",position:e}}function sa(e){return(A,t)=>{const n=t(),r=pt(n),a=mt(n);return A({type:"SET_PLAYLIST_SCROLL_POSITION",position:100*(r?ie((a+e)/r,0,1):0)})}}function ca(e){return e.preventDefault(),(A,t)=>{const n=t();pt(n)&&e.stopPropagation();const r=13*n.playlist.trackOrder.length,a=e.deltaY/r*100;A({type:"SET_PLAYLIST_SCROLL_POSITION",position:ie(n.display.playlistScrollPosition+a,0,100)})}}function ua(){return sa(-4)}function da(){return sa(4)}function ga(e){return(A,t)=>{const n=t(),r=zA(n),a=JA(n),i=ZA(n),o=a.findIndex(e=>r[e]&&i.has(e));if(-1===o)return;const l=function(e,A){for(let t=e.length-1;t>=0;t--)if(A(e[t]))return t;return-1}(a,e=>r[e]&&i.has(e));if(-1===l)throw new Error("We found a first selected, but not a last selected.");const s=-o,c=a.length-1-l,u=ie(e,s,c);0!==u&&A({type:"DRAG_SELECTED",offset:u})}}function pa(){return{type:"INVERT_SELECTION"}}function ha(){return{type:"SELECT_ZERO"}}function fa(){return{type:"SELECT_ALL"}}const ma=new class{constructor({threads:e}){this._queue=new Aa.a([],(e,A)=>e.priority()-A.priority()),this._availableThreads=e}push(e,A){const t={task:e,priority:A};return this._queue.push(t),setTimeout(()=>{this._run()},0),()=>{this._queue=this._queue.filter(e=>e!==t)}}_run(){for(;this._availableThreads>0;){if(0===this._queue.length)return;this._availableThreads--;const e=this._queue.pop().task();gA()("function"==typeof e.then,"LoadQueue only supports loading Promises. Got "+e),e.then(()=>{this._availableThreads++,this._run()})}}}({threads:4});function Ea(e,A,t){return xa(Array.from(e).map(e=>({blob:e,defaultName:e.name})),A,t)}const ba=new RegExp("(wsz|zip)$","i"),wa=new RegExp("eqf$","i");function ya(e,A=V,t){return n=>{if(!(e.length<1)){if(1===e.length){const A=e[0];if(ba.test(A.name))return void n(Oa(A));if(wa.test(A.name))return void n(function(e){return async A=>{const t=await async function(e){return gA()(null!=e,"Attempt to get an ArrayBuffer without assigning a fileReference"),new Promise((A,t)=>{const n=new FileReader;n.onload=()=>{A(n.result)},n.onerror=t,n.readAsArrayBuffer(e)})}(e);A(Na(Object(Cr.parser)(t).presets[0]))}}(A))}n(Ea(e,A,t))}}}function Oa(e){return async(A,t,{requireJSZip:n})=>{if(!n)return void alert("Webamp has not been configured to support custom skins.");let r;A({type:"LOADING"});try{r=await n()}catch(e){return console.error(e),A({type:"LOADED"}),void alert("Failed to load the skin parser.")}try{const t=await $r(e,r);A({type:"SET_SKIN_DATA",data:{skinImages:t.images,skinColors:t.colors,skinPlaylistStyle:t.playlistStyle,skinCursors:t.cursors,skinRegion:t.region,skinGenLetterWidths:t.genLetterWidths,skinGenExColors:t.genExColors}})}catch(e){console.error(e),A({type:"LOADED"}),alert("Failed to parse skin")}}}function ka(e){return async A=>{A({type:"LOADING"});try{const t=await fetch(e);if(!t.ok)throw new Error(t.statusText);A(Oa(t.blob()))}catch(t){console.error(t),A({type:"LOADED"}),alert("Failed to download skin from "+e)}}}function Ia(e,A){return async t=>{var n;const r=await hA({accept:e});t({type:"OPENED_FILES",expectedType:A,count:r.length,firstFileName:null===(n=r[0])||void 0===n?void 0:n.name}),t(ya(r))}}function Sa(){return Ia(".eqf","EQ")}function Ua(){return Ia(null,"MEDIA")}function va(){return Ia(".zip, .wsz","SKIN")}function Ca(e,A){return(t,n)=>{ma.push(async()=>{try{const n=await function(e){return gA()("string"==typeof e,"Attempted to get the duration of media file without passing a url"),new Promise((A,t)=>{const n=document.createElement("audio");n.crossOrigin="anonymous";const r=()=>{A(n.duration),n.removeEventListener("durationchange",r),n.src=""};n.addEventListener("durationchange",r),n.addEventListener("error",e=>{t(e)}),n.src=e})}(e);t({type:"SET_MEDIA_DURATION",duration:n,id:A})}catch(e){}},()=>wt(n())(A)?5:15)}}function Ba(e,A=R,t=0){const{files:n}=e.dataTransfer;return async(r,a,{handleTrackDropEvent:i})=>{if(i){const n=await i(e);if(null!=n)return void r(xa(n,A,t))}r(ya(n,A,t))}}function xa(e,A=R,t=0){return n=>{A===V&&n(e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}),e.forEach((e,r)=>{n(function(e,A=R,t=0){return n=>{const r=Ee++,{defaultName:a,metaData:i,duration:o}=e;let l;if("url"in e)l=e.url.toString();else{if(!("blob"in e))throw new Error("Expected track to have either a blob or a url");l=URL.createObjectURL(e.blob)}switch(n({type:"ADD_TRACK_FROM_URL",url:l,duration:e.duration,defaultName:a,id:r,atIndex:t}),A){case D:n({type:"BUFFER_TRACK",id:r});break;case V:n({type:"PLAY_TRACK",id:r});break;case R:default:n(null!=o?{type:"SET_MEDIA_DURATION",duration:o,id:r}:Ca(l,r))}if(null!=i){const{artist:e,title:A,album:t}=i;n({type:"SET_MEDIA_TAGS",artist:e,title:A,album:t,sampleRate:44e3,bitrate:192e3,numberOfChannels:2,id:r})}else n("blob"in e?Ma(e.blob,r):function(e){return(A,t)=>{const n=zA(t())[e];ma.push(()=>A(Ma(n.url,e)),()=>wt(t())(e)?10:20)}}(r))}}(e,0===r?A:R,t+r))})}}function Ma(e,A){return async(t,n,{requireMusicMetadata:r})=>{t({type:"MEDIA_TAG_REQUEST_INITIALIZED",id:A});try{const n=await function(e,A){gA()(null!=e,"Attempted to get the tags of media file without passing a file");const t={duration:!0,skipPostHeaders:!0};return"string"==typeof e?A.fetchFromUrl(e,t):A.parseBlob(e,t)}(e,await r()),{artist:a,title:i,album:o,picture:l}=n.common,{numberOfChannels:s,bitrate:c,sampleRate:u}=n.format;let d=null;if(l&&l.length>=1){const e=new Uint8Array(l[0].data),A=new Blob([e],{type:l[0].format});d=URL.createObjectURL(A)}t({type:"SET_MEDIA_TAGS",artist:a||"",title:i||"",album:o,albumArtUrl:d,numberOfChannels:s,bitrate:c,sampleRate:u,id:A})}catch(e){t({type:"MEDIA_TAG_REQUEST_FAILED",id:A})}}}function Na(e){return A=>{A(Sr(ge(e.preamp))),N.forEach(t=>{A(wr(t,ge(e["hz"+t])))})}}function Ta(){return(e,A)=>{const t=A(),n=KA(t);le("data:application/zip;base64,"+(e=>oe(new Uint8Array(e)))(Object(Cr.creator)(n)),"entry.eqf")}}function Qa(){return(e,A)=>{le(Tt(A()),"Winamp Playlist.html")}}let La=document.createElement("input");La.type="file";const ja=void 0!==La.webkitdirectory||void 0!==La.mozdirectory||void 0!==La.directory;function Da(e){return async A=>{A(Ea(await hA(),R,e))}}function Va(e){return async A=>{if(!ja)return void alert("Not supported in your browser");A(Ea(await hA({directory:!0}),R,e))}}function Ra(e=0){return async(A,t,{handleAddUrlEvent:n})=>{if(n){const t=await n();if(null!=t)return void A(xa(t,R,e))}else alert("Not supported in Webamp")}}function Fa(){return async(e,A,{handleLoadListEvent:t})=>{if(t){const A=await t();if(null!=A)return e(e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}),void e(xa(A,R,0))}else alert("Not supported in Webamp")}}function Ga(){return(e,A,{handleSaveListEvent:t})=>{t?t(qA(A())):alert("Not supported in Webamp")}}function Pa(e,A){return t=>{var n;return t({type:"DROPPED_FILES",count:e.dataTransfer.files.length,firstFileName:null===(n=e.dataTransfer.files[0])||void 0===n?void 0:n.name,windowId:A})}}function Ka(e){const{name:A}=e;if("butterchurnPresetObject"in e)return{type:"RESOLVED",name:A,preset:e.butterchurnPresetObject};if("getButterchrunPresetObject"in e)return{type:"UNRESOLVED",name:A,getPreset:e.getButterchrunPresetObject};if("butterchurnPresetUrl"in e)return{type:"UNRESOLVED",name:A,getPreset:async()=>(await fetch(e.butterchurnPresetUrl)).json()};throw new Error("Invalid preset object")}function za(e){return(A,t)=>{const n=t(),r=n.milkdrop.presets.length;A({type:"GOT_BUTTERCHURN_PRESETS",presets:e}),0===r&&wn(n)?A(_a()):A(qa(r,kA.IMMEDIATE,!0))}}function Ya(e){return async(A,t,{convertPreset:n})=>{A(za(Array.from(e).map(e=>{const A=e.name.toLowerCase();if(A.endsWith(".milk")){if(null==n)throw new Error("Invalid type");return{type:"UNRESOLVED",name:e.name.slice(0,e.name.length-".milk".length),getPreset:()=>n(e)}}return A.endsWith(".json")?{type:"UNRESOLVED",name:e.name.slice(0,e.name.length-".json".length),getPreset:async()=>{const A=await pA(e);return JSON.parse(A)}}:(console.error("Invalid type preset when loading directory"),null)}).filter(Boolean)))}}function Ja(e=kA.DEFAULT){return(A,t)=>{const n=t();if(wn(n))return A(_a(e));const r=hn(n);null!=r&&A(qa(r+1,e,!0))}}function Ha(e=kA.DEFAULT){return(A,t)=>{const n=t(),{presetHistory:r}=n.milkdrop;r.length<1||A(qa(r[r.length-2],e,!1))}}function _a(e=kA.DEFAULT){return(A,t)=>{const n=t();A(qa(Math.floor(Math.random()*n.milkdrop.presets.length),e,!0))}}function qa(e,A,t){return async(n,r)=>{const a=r().milkdrop.presets[e];if(null!=a)switch(n({type:"PRESET_REQUESTED",index:e,addToHistory:t}),a.type){case"RESOLVED":return void n({type:"SELECT_PRESET_AT_INDEX",index:e,transitionType:A});case"UNRESOLVED":const t=await a.getPreset();return n({type:"RESOLVE_PRESET_AT_INDEX",index:e,json:t}),void n({type:"SELECT_PRESET_AT_INDEX",index:e,transitionType:A})}}}function Wa(e){return Ya(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 ei(){return e=>{let A=!1;e({type:"CLOSE_REQUESTED",cancel:()=>{A=!0}}),A||(e({type:"STOP"}),e({type:"CLOSE_WINAMP"}))}}function Ai(){return{type:"TOGGLE_VISUALIZER_STYLE"}}function ti(){return{type:"MINIMIZE_WINAMP"}}function ni(e){return{type:"SET_FOCUS",input:e}}function ri(){return{type:"UNSET_FOCUS"}}function ai(e){return{type:"SET_BAND_FOCUS",input:"eq",bandFocused:e}}function ii(){return{type:"LOAD_DEFAULT_SKIN"}}function oi(){return(e,A)=>{un(A())?e({type:"SET_MILKDROP_DESKTOP",enabled:!1}):e({type:"SET_MILKDROP_DESKTOP",enabled:!0})}}function li(e){return{type:"SET_MILKDROP_FULLSCREEN",enabled:e}}function si(){return(e,A)=>{e(li(!dn(A())))}}function ci(){return(e,A)=>{En(A())&&e(_n(j)),e({type:"TOGGLE_PRESET_OVERLAY"})}}function ui(){return{type:"STEP_MARQUEE"}}La=null;var di=e=>A=>{const{media:{volume:t,balance:n},equalizer:{sliders:r}}=A.getState();return e.setVolume(t),e.setBalance(n),e.setPreamp(r.preamp),e.on("timeupdate",()=>{A.dispatch({type:"UPDATE_TIME_ELAPSED",elapsed:e.timeElapsed()})}),e.on("ended",()=>{A.dispatch(or())}),e.on("playing",()=>{A.dispatch({type:"IS_PLAYING"})}),e.on("waiting",()=>{A.dispatch({type:"START_WORKING"})}),e.on("stopWaiting",()=>{A.dispatch({type:"STOP_WORKING"})}),e.on("fileLoaded",()=>{const t=at(A.getState());null!=t&&A.dispatch({id:t,type:"SET_MEDIA",kbps:"128",khz:"44",channels:2,length:e.duration()})}),t=>n=>{const r=t(n),a=A.getState();switch(n.type){case"PLAY":e.play();break;case"PAUSE":e.pause();break;case"STOP":e.stop();break;case"SET_VOLUME":e.setVolume(_t(a));break;case"SET_BALANCE":e.setBalance(qt(a));break;case"SEEK_TO_PERCENT_COMPLETE":e.seekToPercentComplete(n.percent);break;case"PLAY_TRACK":{const t=YA(A.getState())(n.id);null!=t&&e.loadFromUrl(t,!0);break}case"BUFFER_TRACK":{const t=YA(A.getState())(n.id);null!=t&&e.loadFromUrl(t,!1);break}case"SET_BAND_VALUE":"preamp"===n.band?e.setPreamp(n.value):e.setEqBand(n.band,n.value);break;case"SET_EQ_OFF":e.disableEq();break;case"SET_EQ_ON":e.enableEq();break;case"LOAD_SERIALIZED_STATE":en(a)?e.enableEq():e.disableEq(),e.setVolume(_t(a)),e.setBalance(qt(a)),be(a.equalizer.sliders,(A,t)=>{"preamp"===t?e.setPreamp(A):e.setEqBand(t,A)})}return r}};const gi=Object(x.composeWithDevTools)({actionsBlacklist:["UPDATE_TIME_ELAPSED","STEP_MARQUEE"]});var pi=function(e,A,t=[],n,r){let a;n&&(a=function e(A,t){const n=t,r=A;for(const A of Object.keys(n))n[A]instanceof Object&&Object.assign(n[A],e(r[A],n[A]));return Object.assign(A||{},t),A}(CA(void 0,{type:"@@init"}),n));const i=gi(Object(m.applyMiddleware)(...[B.withExtraArgument(r),di(e),()=>e=>t=>(A.trigger(t.type,t),e(t)),...t].filter(Boolean)));return a?Object(m.createStore)(CA,a,i):Object(m.createStore)(CA,i)},hi=t(13),fi=t.n(hi);var mi=function(e){const{onChange:A,enabled:t}=e,n=Object(i.useRef)(null);return Object(i.useEffect)(()=>{function e(){A&&A(fi.a.fullscreenElement===n.current)}return fi.a.addEventListener("fullscreenchange",e),()=>{fi.a.removeEventListener("fullscreenchange",e)}},[A]),Object(i.useLayoutEffect)(()=>{const e=fi.a.fullscreenElement===n.current;var A;e&&!t?fi.a.fullscreenEnabled&&fi.a.exitFullscreen():!e&&t&&null!=n.current&&(A=n.current,fi.a.fullscreenEnabled&&fi.a.requestFullscreen(A))},[t]),Object(a.jsx)("div",{ref:n,style:e.enabled?{height:"100%",width:"100%"}:void 0,children:e.children})};function Ei(e){const[A,t]=Object(i.useState)(null);return Object(i.useEffect)(()=>{let A=!1;return e.then(e=>{A||t(e)}),()=>{A=!0}},[e]),A}function bi(){const[e]=Object(i.useState)({width:window.screen.width,height:window.screen.height});return e}function wi(){const[e,A]=Object(i.useState)(Oe()),t=Object(i.useCallback)(function(e,A){let t=null,n=[];return function(r,...a){n=a,t||(t=window.setTimeout(()=>{e.apply(r,n),t=null},A))}}(()=>{A(Oe())},100),[]);return Object(i.useEffect)(()=>(window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}),[t]),e}const yi={current:{pageX:0,pageY:0}};function Oi(){const e=yi,[A,t]=Object(i.useState)(!1),[n,r]=Object(i.useState)(null);return Object(i.useLayoutEffect)(()=>{if(null==n)return void t(!1);const A=n.getBoundingClientRect(),{pageX:r,pageY:a}=e.current;t(r>=A.left&&r<=A.right&&a>=A.top&&a<=A.bottom);const i=()=>t(!0),o=()=>t(!1);return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",o),()=>{n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",o)}},[n,e]),{ref:r,hover:A}}function ki(e){return U(e)}function Ii(e){const A=O();return Object(i.useCallback)((...t)=>A(e(...t)),[A,e])}function Si(){return O()}window.document.addEventListener("mousemove",({pageX:e,pageY:A})=>{yi.current={pageX:e,pageY:A}});var Ui=t(4),vi=t.n(Ui);t(68);function Ci(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}var Bi=Object(i.memo)((function(e){const{currentSize:A,setWindowSize:t,widthOnly:n}=e,o=Ne()(e,["currentSize","setWindowSize","widthOnly"]),[l,s]=Object(i.useState)(!1),[c,u]=Object(i.useState)(null);Object(i.useEffect)(()=>{if(!1===l||null==c)return;const[t,r]=A,a=A=>{const a=Ie(A)-c.x,i=Se(A)-c.y,o=[Math.max(0,t+Math.round(a/25)),n?t:Math.max(0,r+Math.round(i/29))];e.setWindowSize(o)};window.addEventListener("mousemove",a),window.addEventListener("touchmove",a);const i=()=>s(!1);return window.addEventListener("mouseup",i),window.addEventListener("touchend",i),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("touchmove",a),window.removeEventListener("mouseup",i),window.removeEventListener("touchend",i)}},[c,l]);const d=e=>{u({x:Ie(e),y:Se(e)}),s(!0)};return Object(a.jsx)("div",function(e){for(var A=1;A{A!==n&&r(A)},[A,n,r]),[l,s]=Object(i.useState)(null);return Object(i.useEffect)(()=>{if(null!=l&&null!=e)return l.addEventListener("keydown",e),()=>l.removeEventListener("keydown",e)},[e,A,n,l]),Object(i.useEffect)(()=>{if(null==l||A!==n)return;const e=new MutationObserver(e=>{document.activeElement===document.body&&e.some(e=>e.removedNodes.length>0)&&l.focus()});return e.observe(l,{subtree:!0,attributes:!1,childList:!0}),()=>e.disconnect()},[A,n,l]),Object(a.jsx)("div",{ref:s,onMouseDown:o,onTouchStart:o,onFocus:o,tabIndex:-1,style:{height:"100%",width:"100%"},children:t})};const Mi=({children:e})=>{const A=e.split("");return Object(a.jsx)(i.Fragment,{children:A.map((e,A)=>Object(a.jsx)("div",{className:"draggable gen-text-letter gen-text-"+(" "===e?"space":e.toLowerCase())},A))})};var Ni=({children:e,title:A,windowId:t,onKeyDown:n})=>{const r=Ii(qn),i=Ii(Hn),o=ki(Ft),l=ki(Lt),s=ki(ut)(t),c=l===t,{width:u,height:d}=o(t);return Object(a.jsx)(xi,{windowId:t,onKeyDown:n,children:Object(a.jsxs)("div",{className:vi()("gen-window","window",{selected:c}),style:{width:u,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)(Mi,{children:A})}),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:()=>i(t)})})]}),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:u-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)(Bi,{currentSize:s,setWindowSize:e=>r(t,e),id:"gen-resize-target"})})]})]})})};const Ti={[kA.DEFAULT]:2.7,[kA.IMMEDIATE]:0,[kA.USER_PRESET]:5.7};var Qi=function({analyser:e,width:A,height:t}){const n=ki(Ht),r=ki(St),o=ki(gn),l=ki(kt),s=ki(fn),c=ki(pn),u=ki(cn),d=n===H,g=Object(i.useRef)(null),[p,h]=Object(i.useState)(null);Object(i.useEffect)(()=>{if(null==g.current||null==o)return;if(null!=p)return;const n=o.createVisualizer(e.context,g.current,{width:A,height:t,meshWidth:32,meshHeight:24,pixelRatio:window.devicePixelRatio||1});n.connectAudio(e),h(n)},[o,e,t,A,p]),Object(i.useEffect)(()=>{null!=p&&p.setRendererSize(A,t)},[p,A,t]);const f=Object(i.useRef)(!1);Object(i.useEffect)(()=>{null!=p&&null!=s&&(f.current?p.loadPreset(s,Ti[c]):(p.loadPreset(s,Ti[kA.IMMEDIATE]),f.current=!0))},[p,s]),Object(i.useEffect)(()=>{null!=p&&l&&p.launchSongTitleAnim(l)},[p,l]);const m=Object(i.useRef)(null);Object(i.useEffect)(()=>{null!=p&&null!=u&&(null==m.current||u.time>m.current)&&(m.current=Date.now(),p.launchSongTitleAnim(u.text))},[p,u]);const E=r&&d;return Object(i.useEffect)(()=>{if(!E||null==p)return;let e=null;const A=()=>{p.render(),e=window.requestAnimationFrame(A)};return A(),()=>{null!=e&&window.cancelAnimationFrame(e)}},[p,E]),Object(a.jsx)("canvas",{height:t,width:A,style:{height:"100%",width:"100%",display:d?"block":"none"},ref:g})};t(71);var Li=e=>{const{innerRef:A}=e;return Object(a.jsx)("div",{ref:A,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 ji(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Di(e){for(var A=1;A()=>{e.current=!0},[]),e}(),[c,u]=Object(i.useState)(()=>null!=n?n+1:0),d=t.length,g=Object(i.useCallback)(()=>{const A=Math.floor((e-15)/14),r=Math.floor(.75*A),[i,o]=function(e,A,t){const n=Math.min(e,A),r=Math.floor(n/2),a=ie(t-r,0,e-n);return[a,a+n-1]}(d+1,r,c),l=[];for(let e=i;e<=o;e++){const A=Gi(e),r=A===n;let i;i=e===c?r?"#FFCC22":"#FF5050":r?"#CCFF03":"#CCCCCC",l.push(Object(a.jsx)("li",{style:{color:i,lineHeight:"14px"},children:0===e?"Load Local Directory":t[A]},e))}return l},[n,e,d,t,c]),p=Object(i.useCallback)(async()=>{const e=await hA({directory:!0});s.current||l(e)},[l,s]),h=Object(i.useCallback)(e=>{switch(e.keyCode){case 38:u(e=>Math.max(e-1,0)),e.stopPropagation();break;case 40:u(e=>Math.min(e+1,d)),e.stopPropagation();break;case 13:0===c?p():r(Gi(c),kA.DEFAULT,!0),e.stopPropagation();break;case 27:o(),e.stopPropagation()}},[p,d,r,c,o]),f=Object(i.useCallback)(e=>{null!=e&&document.activeElement!==e&&e.focus()},[]);return null==t?Object(a.jsx)("div",{style:Vi,children:Object(a.jsx)("span",{children:"Loading presets"})}):Object(a.jsx)("div",{ref:f,tabIndex:-1,style:Ri,onKeyDown:h,children:Object(a.jsx)("div",{style:Di(Di({},Fi),{},{width:A-20-20,maxHeight:e-15}),children:Object(a.jsx)("ul",{style:{listStyleType:"none",padding:0,margin:0},children:g()})})})};function Ki(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function zi(e){for(var A=1;A{const{handleDrop:A,windowId:t}=e,n=Ne()(e,["handleDrop","windowId"]),r=Ii(Pa),o=Object(i.useCallback)(e=>{Yi(e),r(e,t);const{currentTarget:n}=e;if(!(n instanceof Element))return;const{left:a,top:i}=n.getBoundingClientRect();A(e,{x:a,y:i})},[A,r,t]);return Object(a.jsx)("div",zi(zi({},n),{},{onDragStart:Yi,onDragEnter:Yi,onDragOver:Yi,onDrop:o}))};t(73);function Hi(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function _i(e){for(var A=1;A{const A=Object(i.useMemo)(()=>{const A=document.createElement("div");return A.id="webamp-context-menu",A.style.position="absolute",A.style.top="0",A.style.left="0",A.style.zIndex=String(e.zIndex+1),A},[e.zIndex]);Object(i.useEffect)(()=>(document.body.appendChild(A),()=>{document.body.removeChild(A)}),[A]);const t={top:e.top,left:e.left,position:"absolute"};return Object(l.createPortal)(Object(a.jsx)("div",{style:t,children:e.children}),A)},Wi=()=>Object(a.jsx)("li",{className:"hr",children:Object(a.jsx)("hr",{})}),Zi=({children:e,label:A})=>Object(a.jsxs)("li",{className:"parent",children:[Object(a.jsx)("ul",{children:e}),A]}),Xi=e=>Object(a.jsx)("li",{children:Object(a.jsx)("a",_i(_i({},e),{},{children:e.label}))}),$i=e=>{const{label:A,checked:t,className:n=""}=e,r=Ne()(e,["label","checked","className"]);return Object(a.jsx)("li",_i(_i({className:vi()(n,{checked:t})},r),{},{children:A}))};function eo({children:e,offsetTop:A,offsetLeft:t,top:n,bottom:r,selected:i}){const o=ki(Vt);return i?Object(a.jsx)(qi,{top:A,left:t,zIndex:o,children:Object(a.jsx)("ul",{className:vi()("context-menu",{top:n,bottom:r}),children:e})}):null}function Ao(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function to(e){for(var A=1;A{s(null)},[]),u=Object(i.useCallback)(e=>{2!==e.button&&c()},[c]),d=Object(i.useCallback)(e=>{const{pageX:A,pageY:t}=e;s({x:A,y:t}),e.preventDefault(),e.stopPropagation()},[]);return Object(i.useEffect)(()=>{if(null!=l)return document.addEventListener("click",u),document.body.addEventListener("contextmenu",c),()=>{document.removeEventListener("click",u),document.body.removeEventListener("contextmenu",c)}},[l,c,u]),Object(a.jsxs)("div",to(to({onContextMenu:d,style:{width:"100%",height:"100%"}},o),{},{children:[Object(a.jsx)(eo,{selected:null!=l,offsetTop:null!==(A=null==l?void 0:l.y)&&void 0!==A?A:0,offsetLeft:null!==(t=null==l?void 0:l.x)&&void 0!==t?t:0,children:r()}),n]}))}var ro=e=>{const A=ki(un),t=Ii(Hn),n=Ii(oi),r=Ii(si);return Object(a.jsx)(no,{renderContents:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)($i,{onClick:r,label:"Fullscreen",hotkey:"Alt+Enter"}),Object(a.jsx)($i,{onClick:n,checked:A,label:"Desktop Mode",hotkey:"Alt+D"}),Object(a.jsx)(Wi,{}),Object(a.jsx)($i,{onClick:()=>t(j),label:"Quit"})]}),children:e.children})};var ao=i.memo(({children:e})=>{const[A]=i.useState(()=>document.createElement("div"));return i.useEffect(()=>(A.classList.add("webamp-desktop"),document.body.appendChild(A),()=>{document.body.removeChild(A)}),[A]),s.a.createPortal(e,A)});function io(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function oo(e){for(var A=1;A{switch(i.keyCode){case 32:A();break;case 8:t(kA.IMMEDIATE);break;case 72:A(kA.IMMEDIATE);break;case 82:n();break;case 76:r(),i.stopPropagation();break;case 84:null!=e&&a(e),i.stopPropagation();break;case 145:case 125:o()}},[a,A,t,o,r,n,e])}();Object(i.useEffect)(()=>{if(!r||!l)return;const e=setInterval(c,15e3);return()=>clearInterval(e)},[r,o,l,c]);const p=bi(),h=wi();return A?Object(a.jsx)(ao,{children:Object(a.jsx)(ro,{children:Object(a.jsx)(Qi,oo(oo({},h),{},{analyser:e}))})}):Object(a.jsx)(Ni,{title:"Milkdrop",windowId:j,onKeyDown:g,children:A=>{const r=t?p:A;return Object(a.jsx)(ro,{children:Object(a.jsx)(Li,{children:Object(a.jsxs)(Ji,{windowId:j,handleDrop:u,children:[n&&Object(a.jsx)(Pi,oo({},r)),Object(a.jsx)(mi,{enabled:t,onChange:d,children:Object(a.jsx)("div",{onDoubleClick:s,children:Object(a.jsx)(Qi,oo(oo({},r),{},{analyser:e}))})})]})})})}})};var so=()=>{const e=Ii(lr),A=Ii(nr),t=Ii(rr),n=Ii(ar),r=Ii(or),o=Ii(cr),l=Ii(ur),s=Ii(ir);return Object(a.jsxs)(i.Fragment,{children:[Object(a.jsx)($i,{label:"Previous",hotkey:"Z",onClick:e}),Object(a.jsx)($i,{label:"Play",hotkey:"X",onClick:A}),Object(a.jsx)($i,{label:"Pause",hotkey:"C",onClick:t}),Object(a.jsx)($i,{label:"Stop",hotkey:"V",onClick:n}),Object(a.jsx)($i,{label:"Next",hotkey:"B",onClick:r}),Object(a.jsx)(Wi,{}),Object(a.jsx)($i,{label:"Back 5 seconds",hotkey:"Left",onClick:()=>l(5)}),Object(a.jsx)($i,{label:"Fwd 5 seconds",hotkey:"Right",onClick:()=>o(5)}),Object(a.jsx)($i,{label:"10 tracks back",hotkey:"Num. 1",onClick:()=>s(-10)}),Object(a.jsx)($i,{label:"10 tracks fwd",hotkey:"Num. 3",onClick:()=>s(10)})]})};var co=()=>{const e=Ii(ii),A=Ii(va),t=Ii(ka),n=ki(Mn);return Object(a.jsxs)(Zi,{label:"Skins",children:[Object(a.jsx)($i,{onClick:A,label:"Load Skin..."}),Object(a.jsx)(Wi,{}),Object(a.jsx)($i,{onClick:e,label:""}),n.map(e=>Object(a.jsx)($i,{onClick:()=>t(e.url),label:e.name},e.url))]})};var uo=()=>{const e=Ii(Er),A=Ii(Kn),t=Ii(fr),n=Ii(mr),r=ki(jt),i=ki(Cn),o=ki(Zt),l=ki(Wt);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(co,{}),Object(a.jsx)(Wi,{}),Object(a.jsx)($i,{label:"Time elapsed",hotkey:"(Ctrl+T toggles)",onClick:e,checked:i===q}),Object(a.jsx)($i,{label:"Time remaining",hotkey:"(Ctrl+T toggles)",onClick:e,checked:i===W}),Object(a.jsx)($i,{label:"Double Size",hotkey:"Ctrl+D",onClick:A,checked:r}),Object(a.jsx)(Wi,{}),Object(a.jsx)($i,{label:"Repeat",hotkey:"R",onClick:t,checked:o}),Object(a.jsx)($i,{label:"Shuffle",hotkey:"S",onClick:n,checked:l})]})};var go=Object(i.memo)(({filePickers:e})=>{const A=ki(vn),t=ki(ot),n=Ii(ei),r=Ii(Ua),o=Ii(xa),l=Ii(Wn),s=Ii(()=>({type:"MAIN_CONTEXT_MENU_OPENED"}));return Object(i.useEffect)(()=>{s()},[s]),Object(a.jsxs)(i.Fragment,{children:[Object(a.jsx)(Xi,{href:"https://webamp.org/about",target:"_blank",label:"Webamp..."}),Object(a.jsx)(Wi,{}),Object(a.jsxs)(Zi,{label:"Play",children:[Object(a.jsx)($i,{onClick:r,label:"File...",hotkey:"L"}),null!=e&&e.map((e,t)=>(A||!e.requiresNetwork)&&Object(a.jsx)($i,{onClick:async()=>{let A;try{A=await e.filePicker()}catch(e){console.error("Error loading from file picker",e)}o(A||[],V)},label:e.contextMenuName},t))]}),Object(a.jsx)(Wi,{}),Object.keys(t).map(e=>Object(a.jsx)($i,{label:t[e].title,checked:t[e].open,onClick:()=>l(e),hotkey:t[e].hotkey},e)),Object(a.jsx)(Wi,{}),Object(a.jsx)(co,{}),Object(a.jsx)(Wi,{}),Object(a.jsx)(Zi,{label:"Options",children:Object(a.jsx)(uo,{})}),Object(a.jsx)(Zi,{label:"Playback",children:Object(a.jsx)(so,{})}),Object(a.jsx)(Wi,{}),Object(a.jsx)($i,{onClick:n,label:"Exit"})]})});function po(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function ho(e){for(var A=1;A{const t=Dn(e,A);return void 0!==t.x||void 0!==t.y};function mo(e){const A=ki(Pt),t=ki(st),n=ki(An),r=Ii(Zn),[a,o]=Object(i.useState)(null);return Object(i.useEffect)(()=>{if(null==a)return;const{boundingBox:e,moving:A,stationary:t,mouseStart:i}=a,l=a=>{const o={x:Ie(a)-i.x,y:Se(a)-i.y},l=A.map(e=>ho(ho({},e),Rn(e,o))),s=ho(ho({},e),Rn(e,o)),c=((e,A)=>{let t=0,n=0;for(const r of e)for(const e of A){const A=Vn(r,e);if(t=t||A.x,n=n||A.y,void 0!==t&&t>0&&void 0!==n&&n>0)break}return{x:t,y:n}})(l,t),u=((e,A)=>{const t=((e,A)=>{let t,n;return e.x-15<0?t=0:e.x+e.width+15>A.width&&(t=A.width-e.width),e.y-15<0?n=0:e.y+e.height+15>A.height&&(n=A.height-e.height),{x:t,y:n}})(e,A);return{x:void 0===t.x?0:t.x-e.x,y:void 0===t.y?0:t.y-e.y}})(s,n),d=((e,...A)=>{const t=A.reduce((e,A)=>({x:0===e.x||0===A.x?e.x+A.x:Math.min(e.x,A.x),y:0===e.y||0===A.y?e.y+A.y:Math.min(e.y,A.y)}));return Rn(e,t)})(o,c,u),g={};A.forEach(e=>{g[e.key]=Rn(e,d)}),r(g,!1)};function s(){o(null)}return window.addEventListener("mouseup",s),window.addEventListener("touchend",s),window.addEventListener("mousemove",l,{passive:!1}),window.addEventListener("touchmove",l,{passive:!1}),()=>{window.removeEventListener("mousemove",l),window.removeEventListener("touchmove",l),window.removeEventListener("mouseup",s),window.removeEventListener("touchend",s)}},[n,a,r]),Object(i.useCallback)((n,r)=>{if(!r.target.classList.contains("draggable"))return;const a=Ie(r),i=Se(r);if(t(n))return;const l=A.filter(A=>null!=e[A.key]&&!t(A.key)),s=l.find(e=>e.key===n);if(null==s)throw new Error("Tried to move a node that does not exist: "+n);let c=new Set([s]);if("main"===n){const e=(u=fo,(e,A)=>{const t=new Set,n=A=>{for(const r of e)!t.has(r)&&u(r,A)&&(t.add(r),n(r))};return n(A),t});c=e(l,s)}var u;const d=l.filter(e=>!c.has(e)),g=Array.from(c),p={x:a,y:i},h=(e=>{const A=e.slice(),t=A.pop();if(null==t)throw new Error("boundingBox must be called with at least one node");const n={top:Nn(t),right:Ln(t),bottom:Tn(t),left:Qn(t)};return A.forEach(e=>{n.top=Math.min(n.top,Nn(e)),n.right=Math.max(n.right,Ln(e)),n.bottom=Math.max(n.bottom,Tn(e)),n.left=Math.min(n.left,Qn(e))}),{x:n.left,y:n.top,width:n.right-n.left,height:n.bottom-n.top}})(g);o({boundingBox:h,moving:g,stationary:d,mouseStart:p})},[t,e,A])}function Eo({windows:e}){const A=ki(Pt),t=Ii(_n),n=mo(e),r=A.filter(A=>e[A.key]),o=Object(i.useCallback)(e=>{const{currentTarget:A,relatedTarget:n}=e;A===n||A.contains(n)||t(null)},[t]);return Object(a.jsx)(a.Fragment,{children:r.map(A=>Object(a.jsx)("div",{onBlur:o,onMouseDown:e=>{n(A.key,e)},onTouchStart:e=>{n(A.key,e)},style:{position:"absolute",top:0,left:0,transform:`translate(${A.x}px, ${A.y}px)`,touchAction:"none"},children:e[A.key]},A.key))})}var bo=t(40),wo=t.n(bo);function yo(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Oo(e){for(var A=1;A"character-"+wo()(e.toString()).toLowerCase().charCodeAt(0);var Io=i.memo(e=>{let{children:A,className:t}=e,n=Ne()(e,["children","className"]);return Object(a.jsx)("span",Oo(Oo({},n),{},{className:`${t||""} character ${ko(A)}`,children:A}))});t(88);const So=()=>Object(a.jsx)(i.Fragment,{children:[1,7,12,20,25].map((e,A)=>Object(a.jsx)(Io,{style:{left:e},className:"background-character",children:" "},A))});var Uo=()=>{const e=ki(It),A=ki(yt),t=ki($t),n=ki(Cn),r=Ii(Er);let i=null;e!==X&&null!=A&&(i=n===q?t:A-t);const o=Ae(i),l=n===W&&e!==X;return Object(a.jsxs)("div",{onClick:r,className:vi()("mini-time","countdown",{blinking:e===$}),children:[Object(a.jsx)(So,{}),Object(a.jsx)(Io,{style:{left:1},children:l?"-":" "}),Object(a.jsx)(Io,{style:{left:7},children:o.minutesFirstDigit}),Object(a.jsx)(Io,{style:{left:12},children:o.minutesSecondDigit}),Object(a.jsx)(Io,{style:{left:20},children:o.secondsFirstDigit}),Object(a.jsx)(Io,{style:{left:25},children:o.secondsSecondDigit})]})};function vo(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Co(e){for(var A=1;A{if(t)return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)};function e(e){t&&e.target instanceof Element&&t&&A.current&&!A.current.contains(e.target)&&n(!1)}},[t]);const r=Object(i.useMemo)(()=>t?function(e){if(null==e)return{top:0,left:0};const A=e.getBoundingClientRect(),t=window.pageXOffset||document.documentElement.scrollLeft,n=window.pageYOffset||document.documentElement.scrollTop;return{top:A.top+n,left:A.left+t}}(A.current):{top:0,left:0},[t]),{renderMenu:o,children:l,top:s,bottom:c}=e,u=Ne()(e,["renderMenu","children","top","bottom"]);return Object(a.jsxs)("div",Mo(Mo({},u),{},{children:[Object(a.jsx)("div",{className:"handle",style:{width:"100%",height:"100%"},ref:A,onClick:()=>n(!t),children:l}),Object(a.jsx)(eo,{selected:t,offsetTop:r.top,offsetLeft:r.left,top:s,bottom:c,children:o()})]}))};function To(e,A,t){const n=A*t,r=n+A;let a=0;for(let A=n;Afunction(e,A,t){const n=document.createElement("canvas");n.width=6,n.height=e;const r=A.slice(2,18),a=n.getContext("2d");if(null==a)throw new Error("Could not construct canvas context");const i=16/t;for(let A=0;A{if(i=2*Math.ceil(i),o=2*Math.ceil(o),i>0||o>0){const l=A-i,s=6;if(A>0&&e.drawImage(r,0,l,s,A,a,l,s,A),!n){const n=A-o;e.fillStyle=t[23],e.fillRect(a,n,s,2)}}},[r,t,A,n])}function Lo({renderHeight:e,height:A,analyser:t}){const[n]=Object(i.useState)(()=>new Array(20).fill(0)),[r]=Object(i.useState)(()=>new Array(20).fill(0)),a=t.frequencyBinCount,o=Object(i.useMemo)(()=>function(e){const A=new Array(20).fill(0),t=Math.pow(110.25,.05);A[0]=0,A[1]=200;for(let e=2;e<19;e++)A[e]=A[e-1]*t;A[19]=22050;for(let t=0;t<20;t++){const n=Math.floor(A[t]/22050*e);A[t]=n}return A}(a),[a]),l=Object(i.useMemo)(()=>new Uint8Array(a),[a]),s=Qo({height:A,renderHeight:e});return Object(i.useCallback)(A=>{t.getByteFrequencyData(l);const a=e/256;for(let e=0;e<19;e++){const t=o[e],i=o[e+1];let c=0;for(let e=t;e{e.fftSize=2048},[e.fftSize]);const A=ki(Yt),t=ki(Ht),n=ki(It),r=ki(ct),o=ki(Sn),l=Ii(Ai),s=r("main"),c=s?38:76,u=s?5:16,d=2*c,g=2*u,p=Object(i.useMemo)(()=>function(e,A,t,n,r){const a=document.createElement("canvas");a.width=e,a.height=A;const i=a.getContext("2d");if(null==i)throw new Error("Could not construct canvas context");if(i.fillStyle=t,i.fillRect(0,0,e,A),!r){i.fillStyle=n;for(let t=0;tnew Uint8Array(a),[a]);return Object(i.useCallback)(i=>{e.getByteTimeDomainData(o),i.lineWidth=2,i.strokeStyle=r[18];const l=2*Math.floor(a/t),s=A;i.beginPath();for(let e=0;e<=n;e++){const A=(1-To(o,l,e)/255)*s,t=2*e;0===t?i.moveTo(t,A):i.lineTo(t,A)}i.stroke()},[e,a,r,o,A,n,t])}({analyser:e,height:g,width:d,renderWidth:c}),f=Lo({analyser:e,height:g,renderHeight:u}),m=Qo({height:g,renderHeight:u}),E=Object(i.useCallback)(e=>{if(n===Z){if(o)return e.drawImage(p,0,0),void Object.entries(o).forEach(([A,t])=>{m(e,Number(A),t,-1)});switch(t){case Y:e.drawImage(p,0,0),h(e);break;case J:e.drawImage(p,0,0),f(e);break;default:e.clearRect(0,0,d,g)}}},[p,o,g,m,f,h,n,t,d]),[b,w]=Object(i.useState)(null);return Object(i.useLayoutEffect)(()=>{if(null==b)return;const e=b.getContext("2d");if(null==e)return;e.imageSmoothingEnabled=!1;let A=null;const t=()=>{E(e),A=window.requestAnimationFrame(t)};return t(),()=>{null!=A&&window.cancelAnimationFrame(A)}},[b,E]),n===X?null:Object(a.jsx)("canvas",{id:"visualizer",ref:w,style:{width:c,height:u},width:d,height:g,onClick:l})};var Do=Object(i.memo)(()=>{const e=Ii(lr),A=Ii(nr),t=Ii(rr),n=Ii(or),r=Ii(ar);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:A,title:"Play"}),Object(a.jsx)("div",{id:"pause",onClick:t,title:"Pause"}),Object(a.jsx)("div",{id:"stop",onClick:r,title:"Stop"}),Object(a.jsx)("div",{id:"next",onClick:n,title:"Next Track"})]})});function Vo(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function Ro(e){for(var A=1;Ar(Number(e.target.value)),onMouseDown:()=>i("balance"),onMouseUp:o,title:"Balance"})}const Go=e=>{const A=Math.abs(e)/100;return 15*Math.floor(27*A)};var Po=Object(i.memo)(()=>{const e=ki(qt);return Object(a.jsx)(Fo,{id:"balance",style:{backgroundPosition:`0 -${Go(e)}px`}})});var Ko=Object(i.memo)(()=>{const e=Ii(ei);return Object(a.jsx)(Bo,{id:"close",onClick:e,title:"Close"})});function zo(){return ni("double")}function Yo(){return e=>{e(Kn()),e({type:"UNSET_FOCUS"})}}var Jo=Object(i.memo)(()=>{const e=Ii(zo),A=Ii(Yo),t=ki(jt);return Object(a.jsxs)("div",{id:"clutter-bar",children:[Object(a.jsx)(No,{bottom:!0,renderMenu:()=>Object(a.jsx)(uo,{}),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:vi()({selected:t}),onMouseUp:A,onMouseDown:e}),Object(a.jsx)("div",{id:"button-v"})]})});var Ho=Object(i.memo)(()=>{const e=Ii(Ua);return Object(a.jsx)("div",{id:"eject",onClick:e,title:"Open File(s)"})});function _o(){return Wn("equalizer")}var qo=Object(i.memo)(()=>{const e=Ii(_o),A=ki(lt)("equalizer");return Object(a.jsx)("div",{id:"equalizer-button",className:vi()({selected:A}),onClick:e,title:"Toggle Graphical Equalizer"})});function Wo(){return Wn("playlist")}var Zo=Object(i.memo)(()=>{const e=ki(lt)("playlist"),A=Ii(Wo);return Object(a.jsx)("div",{id:"playlist-button",className:vi()({selected:e}),onClick:A,title:"Toggle Playlist Editor"})});var Xo=Object(i.memo)(e=>{const A=(""+e.children||"").split("");return Object(a.jsx)(i.Fragment,{children:A.map((e,A)=>Object(a.jsx)(Io,{children:e},A+e))})});var $o=Object(i.memo)(()=>{const e=ki(ln);return Object(a.jsx)("div",{id:"kbps",children:Object(a.jsx)(Xo,{children:e||""})})});var el=Object(i.memo)(()=>{const e=ki(sn);return Object(a.jsx)("div",{id:"khz",children:Object(a.jsx)(Xo,{children:e||""})})});const Al=e=>e.length>=31,tl=e=>Al(e)?`${e} *** ${e}`:e.padEnd(31," ");var nl=i.memo(()=>{const e=ki(on),A=ki(jt),t=ki(Un),n=Ii(ui),{handleMouseDown:r,dragOffset:o,dragging:l}=function(){const[e,A]=i.useState(null),[t,n]=i.useState(0);return i.useEffect(()=>{if(null==e)return;const t=e,r=e=>{const A=Ie(e)-t;n(-A)};let a=!1;const i=()=>{a||(document.removeEventListener("mousemove",r),document.removeEventListener("touchmove",r),document.removeEventListener("mouseup",i),document.removeEventListener("touchend",i),A(null),a=!0)};return document.addEventListener("mousemove",r),document.addEventListener("touchmove",r),document.addEventListener("touseup",i),document.addEventListener("touchend",i),i},[e]),{handleMouseDown:i.useCallback(e=>{A(Ie(e))},[]),dragOffset:t,dragging:null!=e}}(),s=((e,A,t)=>{if(!Al(e))return 0;const n=5*A+t,r=5*(e.length+" *** ".length);return(n%(a=r)+a)%a;var a})(e,t,o),c=-s+"px";return function({step:e,dragging:A}){const[t,n]=i.useState(!0);i.useEffect(()=>{if(!1===t)return;const A=setInterval(e,220);return()=>clearInterval(A)},[e,t]),i.useEffect(()=>{if(A)return void n(!1);const e=window.setTimeout(()=>{n(!0)},1e3);return()=>{window.clearTimeout(e)}},[A])}({step:n,dragging:l}),Object(a.jsx)("div",{id:"marquee",className:"text",onMouseDown:r,onTouchStart:r,title:"Song Title",children:Object(a.jsx)("div",{style:{whiteSpace:"nowrap",willChange:"transform",transform:`translateX(${c})`},children:Object(a.jsx)(Xo,{children:tl(e)})},A?"doubled":"not-doubled")})});var rl=Object(i.memo)(()=>{const e=ki(Xt);return Object(a.jsxs)("div",{className:"mono-stereo",children:[Object(a.jsx)("div",{id:"stereo",className:vi()({selected:2===e})}),Object(a.jsx)("div",{id:"mono",className:vi()({selected:1===e})})]})});var al=Object(i.memo)(()=>{const[e,A]=function(){const e=ki(yt),A=ki($t),t=e?Math.floor(A)/e*100:0,n=ki(an);return[t,"position"===ki(rn)?n:t]}(),t=Si(),n=Object(i.useCallback)(e=>{t({type:"SEEK_TO_PERCENT_COMPLETE",percent:Number(e.target.value)}),t({type:"UNSET_FOCUS"})},[t]),r=Object(i.useCallback)(e=>{t({type:"SET_FOCUS",input:"position"}),t({type:"SET_SCRUB_POSITION",position:Number(e.target.value)})},[t]);let o="";return e<=33?o="left":e>=66&&(o="right"),Object(a.jsx)("input",{id:"position",className:o,type:"range",min:"0",max:"100",step:"1",style:{touchAction:"none"},value:A,onInput:r,onChange:()=>{},onMouseUp:n,onMouseDown:r,title:"Seeking Bar"})});var il=Object(i.memo)(()=>{const e=ki(Zt),A=Ii(fr);return Object(a.jsx)(no,{renderContents:()=>Object(a.jsx)($i,{checked:e,label:"Repeat",onClick:A,hotkey:"(R)"}),children:Object(a.jsx)("div",{id:"repeat",className:vi()({selected:e}),onClick:A,title:"Toggle Repeat"})})});var ol=Object(i.memo)(()=>{const e=Ii(Yn);return Object(a.jsx)(Bo,{id:"shade",onMouseDown:e,onDoubleClick:e=>e.stopPropagation(),title:"Toggle Windowshade Mode"})});var ll=Object(i.memo)(()=>{const e=Ii(ti);return Object(a.jsx)(Bo,{id:"minimize",title:"Minimize",onClick:e})});var sl=Object(i.memo)(()=>{const e=ki(Wt),A=Ii(mr);return Object(a.jsx)(no,{renderContents:()=>Object(a.jsx)($i,{checked:e,label:"Shuffle",onClick:A,hotkey:"(S)"}),children:Object(a.jsx)("div",{id:"shuffle",className:vi()({selected:e}),onClick:A,title:"Toggle Shuffle"})})});var cl=Object(i.memo)(()=>{const e=Ii(Er),A=ki($t),t=ki(yt)||0,n=ki(Cn),r=Ae(n===q?A:t-A);return Object(a.jsxs)("div",{id:"time",onClick:e,className:"countdown",children:[n===W&&Object(a.jsx)("div",{id:"minus-sign"}),Object(a.jsx)("div",{id:"minute-first-digit",className:"digit digit-"+r.minutesFirstDigit}),Object(a.jsx)("div",{id:"minute-second-digit",className:"digit digit-"+r.minutesSecondDigit}),Object(a.jsx)("div",{id:"second-first-digit",className:"digit digit-"+r.secondsFirstDigit}),Object(a.jsx)("div",{id:"second-second-digit",className:"digit digit-"+r.secondsSecondDigit})]})});function ul(e,A){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);A&&(n=n.filter((function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable}))),t.push.apply(t,n)}return t}function dl(e){for(var A=1;Ao(Number(e.target.value)),onMouseDown:()=>r("volume"),onTouchStart:()=>{r("volume")},onMouseUp:i,onTouchEnd:i,title:"Volume Bar"})}var pl=Object(i.memo)(()=>{const e=ki(_t)/100,A={backgroundPosition:`0 -${15*(Math.round(28*e)-1)}px`};return Object(a.jsx)("div",{id:"volume",style:A,children:Object(a.jsx)(gl,{})})});t(90);function hl(e){return Ba(e,V)}var fl=i.memo(({analyser:e,filePickers:A})=>{const t=ki(ct)("main"),n=ki(It),r=ki(Lt),i=ki(Bn),o=ki(jt),l=ki(Dt),s=ki(xn),c=vi()({window:!0,play:n===Z,stop:n===X,pause:n===$,selected:r===T,shade:t,draggable:!0,loading:i,doubled:o,llama:l}),u=Ii(Yn),d=Ii(pr),g=Ii(hl);return Object(a.jsx)(Ji,{id:"main-window",windowId:T,className:c,handleDrop:g,onWheel:d,children:Object(a.jsxs)(xi,{windowId:T,children:[Object(a.jsxs)("div",{id:"title-bar",className:"selected draggable",onDoubleClick:u,children:[Object(a.jsx)(No,{id:"option-context",bottom:!0,renderMenu:()=>Object(a.jsx)(go,{filePickers:A}),children:Object(a.jsx)(Bo,{id:"option",title:"Winamp Menu"})}),t&&Object(a.jsx)(Uo,{}),Object(a.jsx)(ll,{}),Object(a.jsx)(ol,{}),Object(a.jsx)(Ko,{})]}),Object(a.jsxs)("div",{className:"webamp-status",children:[Object(a.jsx)(Jo,{}),!s&&Object(a.jsx)("div",{id:"play-pause"}),Object(a.jsx)("div",{id:"work-indicator",className:vi()({selected:s})}),Object(a.jsx)(cl,{})]}),Object(a.jsx)(jo,{analyser:e}),Object(a.jsxs)("div",{className:"media-info",children:[Object(a.jsx)(nl,{}),Object(a.jsx)($o,{}),Object(a.jsx)(el,{}),Object(a.jsx)(rl,{})]}),Object(a.jsx)(pl,{}),Object(a.jsx)(Po,{}),Object(a.jsxs)("div",{className:"windows",children:[Object(a.jsx)(qo,{}),Object(a.jsx)(Zo,{})]}),Object(a.jsx)(al,{}),Object(a.jsx)(Do,{}),Object(a.jsx)(Ho,{}),Object(a.jsxs)("div",{className:"shuffle-repeat",children:[Object(a.jsx)(sl,{}),Object(a.jsx)(il,{})]}),Object(a.jsx)("a",{id:"about",target:"_blank",href:"https://webamp.org/about",title:"About"})]})})});var ml=function({widthOnly:e}){const A=ki(ut),t=Ii(qn),n=A("playlist");return Object(a.jsx)(Bi,{currentSize:n,id:"playlist-resize-target",setWindowSize:e=>{t("playlist",e)},widthOnly:e})};var El=function(){const e=ki(Lt),A=ki(ut)("playlist"),t=ki(yt),n=ki(Bt),r=Ii(Hn),o=Ii(Jn),l=Ii(_n),s=25*A[0],c=Object(i.useMemo)(()=>{if(null==n)return"[No file]";const e=(205+s)/5;return n.length>e?n.slice(0,e-1)+"…":n},[s,n]),u=Object(i.useMemo)(()=>null==n?"":te(t),[t,n]);return Object(a.jsx)("div",{id:"playlist-window-shade",className:vi()("window","draggable",{selected:e===Q}),style:{width:275+s+"px"},onMouseDown:()=>l("playlist"),onDoubleClick:o,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)(Xo,{children:c})}),Object(a.jsx)("div",{id:"playlist-shade-time",children:Object(a.jsx)(Xo,{children:u})}),Object(a.jsx)(ml,{widthOnly:!0}),Object(a.jsx)("div",{id:"playlist-shade-button",onClick:o}),Object(a.jsx)("div",{id:"playlist-close-button",onClick:()=>r("playlist")})]})})})};var bl=Object(i.memo)((function({children:e}){const{ref:A,hover:t}=Oi();return Object(a.jsx)("li",{ref:A,className:vi()({hover:t}),children:e})}));var wl=Object(i.memo)((function(e){const[A,t]=Object(i.useState)(!1),[n,r]=Object(i.useState)(null),o=Object(i.useCallback)(()=>{setTimeout(()=>{t(!1)},0)},[]);return function(e,A){Object(i.useEffect)(()=>{if(null==e||null==A)return;const t=n=>{const r=n.target;r instanceof Element&&(e.contains(r)||(A(),window.document.removeEventListener("click",t,{capture:!0})))};return window.document.addEventListener("click",t,{capture:!0}),()=>{window.document.removeEventListener("click",t,{capture:!0})}},[e,A])}(n,A?o:null),Object(a.jsxs)("div",{id:e.id,className:vi()("playlist-menu",{selected:A}),ref:r,onClick:()=>t(e=>!e),children:[Object(a.jsx)("div",{className:"bar"}),A&&Object(a.jsx)("ul",{children:i.Children.map(e.children,(e,A)=>Object(a.jsx)(bl,{children:e},A))})]})}));var yl=()=>{const e=ki(HA),A=Ii(Va),t=Ii(Da),n=Ii(Ra);return Object(a.jsxs)(wl,{id:"playlist-add-menu",children:[Object(a.jsx)("div",{className:"add-url",onClick:()=>n(e)}),Object(a.jsx)("div",{className:"add-dir",onClick:()=>A(e)}),Object(a.jsx)("div",{className:"add-file",onClick:()=>t(e)})]})};var Ol=()=>{const e=Ii(na),A=Ii(ra),t=Ii(ta);return Object(a.jsxs)(wl,{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:A}),Object(a.jsx)("div",{className:"crop",onClick:t}),Object(a.jsx)("div",{className:"remove-selected",onClick:e})]})};function kl(){const e=Ii(pa),A=Ii(ha),t=Ii(fa);return Object(a.jsxs)(wl,{id:"playlist-selection-menu",children:[Object(a.jsx)("div",{className:"invert-selection",onClick:e}),Object(a.jsx)("div",{className:"select-zero",onClick:A}),Object(a.jsx)("div",{className:"select-all",onClick:t})]})}function Il(){const e=Ii(aa),A=Ii(ia),t=Ii(oa);return Object(a.jsx)(No,{style:{width:"100%",height:"100%"},top:!0,renderMenu:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)($i,{label:"Sort list by title",onClick:t}),Object(a.jsx)(Wi,{}),Object(a.jsx)($i,{label:"Reverse list",onClick:e}),Object(a.jsx)($i,{label:"Randomize list",onClick:A})]}),children:Object(a.jsx)("div",{})})}var Sl=()=>{const e=Ii(Qa);return Object(a.jsx)(No,{style:{width:"100%",height:"100%"},top:!0,renderMenu:()=>Object(a.jsx)($i,{onClick:e,label:"Generate HTML playlist"}),children:Object(a.jsx)("div",{})})};var Ul=()=>Object(a.jsxs)(wl,{id:"playlist-misc-menu",children:[Object(a.jsx)("div",{className:"sort-list",onClick:e=>e.stopPropagation(),children:Object(a.jsx)(Il,{})}),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)(Sl,{})})]});function vl(){const e=Ii(ra),A=Ii(Fa),t=Ii(Ga);return Object(a.jsxs)(wl,{id:"playlist-list-menu",children:[Object(a.jsx)("div",{className:"new-list",onClick:e}),Object(a.jsx)("div",{className:"save-list",onClick:t}),Object(a.jsx)("div",{className:"load-list",onClick:A})]})}var Cl=()=>{const e=ki(tt),A=Object(i.useMemo)(()=>function(e,A,t){for(;e.length{const e=Ii(nr),A=Ii(rr),t=Ii(ar),n=Ii(Ua),r=Ii(or),o=Ii(lr);return Object(a.jsxs)(i.Fragment,{children:[Object(a.jsx)(Cl,{}),Object(a.jsxs)("div",{className:"playlist-action-buttons",children:[Object(a.jsx)("div",{className:"playlist-previous-button",onClick:o}),Object(a.jsx)("div",{className:"playlist-play-button",onClick:e}),Object(a.jsx)("div",{className:"playlist-pause-button",onClick:A}),Object(a.jsx)("div",{className:"playlist-stop-button",onClick:t}),Object(a.jsx)("div",{className:"playlist-next-button",onClick:r}),Object(a.jsx)("div",{className:"playlist-eject-button",onClick:n})]}),Object(a.jsx)(Uo,{})]})};var xl=function({children:e,handleMoveClick:A,index:t,id:n}){const r=ki(Jt),o=ki(ZA),l=ki(at),s=o.has(n),c=l===n,u=Si(),d=Ii(tr),g=Object(i.useCallback)(e=>e.shiftKey?(e.preventDefault(),void u({type:"SHIFT_CLICKED_TRACK",index:t})):e.metaKey||e.ctrlKey?(e.preventDefault(),void u({type:"CTRL_CLICKED_TRACK",index:t})):(s||u({type:"CLICKED_TRACK",index:t}),void A(e)),[u,A,t,s]),p=Object(i.useCallback)(e=>{function r(){d(n)}s||u({type:"CLICKED_TRACK",index:t}),A(e),e.target.addEventListener("touchstart",r),setTimeout(()=>{e.target.removeEventListener("touchstart",r)},250)},[u,A,n,t,d,s]),h={backgroundColor:s?r.selectedbg:void 0,color:c?r.current:void 0};return Object(a.jsx)("div",{className:vi()("track-cell",{selected:s,current:c}),style:h,onClick:e=>e.stopPropagation(),onMouseDown:g,onTouchStart:p,onContextMenu:e=>e.preventDefault(),onDoubleClick:()=>d(n),children:e})};var Ml=({id:e,paddedTrackNumber:A})=>{const t=ki(Ot)(e);return Object(a.jsxs)("span",{children:[A,". ",t]})};var Nl=function(){const e=ki(mt),A=ki(Et),t=ki(zA),n=ki(Mt),r=Ii(ha),o=Ii(ga),l=Ii(ca),[s,c]=Object(i.useState)(null),[u,d]=Object(i.useState)(!1),[g,p]=Object(i.useState)(null),h=e=>{d(!0),p(Se(e))};function f(t){return A.map((A,n)=>Object(a.jsx)(xl,{id:A,index:e+n,handleMoveClick:h,children:t(A,n)},A))}Object(i.useEffect)(()=>{if(null==s||null==g||!1===u)return;const{top:e,bottom:A,left:t,right:n}=s.getBoundingClientRect();let r=0;const a=a=>{const i=Ie(a),l=Se(a);if(lA||in)return;const s=Math.floor((l-g)/13);if(s!==r){o(s-r),r=s}},i=()=>d(!1);return window.addEventListener("mouseup",i),window.addEventListener("mousemove",a),window.addEventListener("touchend",i),window.addEventListener("touchmove",a),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("touchmove",a),window.removeEventListener("mouseup",i),window.removeEventListener("touchend",i)}},[u]);const m=n.toString().length,E=A=>(A+1+e).toString().padStart(m," ");return Object(i.useEffect)(()=>{if(null!=s)return s.addEventListener("wheel",l,{passive:!1}),()=>{s.removeEventListener("wheel",l)}},[s,l]),Object(a.jsxs)("div",{ref:c,className:"playlist-tracks",style:{height:"100%",userSelect:"none"},onClick:r,children:[Object(a.jsx)("div",{className:"playlist-track-titles",children:f((e,A)=>Object(a.jsx)(Ml,{id:e,paddedTrackNumber:E(A)}))}),Object(a.jsx)("div",{className:"playlist-track-durations",children:f(e=>te(t[e].duration))})]})};function Tl({value:e,height:A,width:t,handle:n,handleHeight:r,onBeforeChange:o,onChange:l,onAfterChange:s,disabled:c}){const u=Object(i.useRef)(null),d=Object(i.useRef)(null);function g({target:e,clientY:A,touch:t}){const n=u.current,r=d.current;if(null==n||null==r)return null;const a=n.getBoundingClientRect(),i=r.getBoundingClientRect(),{top:c,height:g}=a,{top:p,height:h}=i,f=c+(r.contains(e)?A-p:h/2),m=g-h;function E(e){l(ie((e-f)/m,0,1))}if(t){const e=e=>{e.cancelable&&e.preventDefault(),E(e.touches[0].clientY)},A=()=>{null!=s&&s(),document.removeEventListener("touchmove",e),document.removeEventListener("touchend",A)};document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchend",A)}else{const e=e=>{e.preventDefault(),E(e.clientY)},A=()=>{null!=s&&s(),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",A)};document.addEventListener("mousemove",e),document.addEventListener("mouseup",A)}null!=o&&o(),E(A)}const p=Math.floor((A-r)*e);return Object(a.jsx)("div",{style:{height:A,width:t},onMouseDown:c?void 0:function(e){e.preventDefault(),g({target:e.target,clientY:e.clientY,touch:!1})},onTouchStart:c?void 0:function(e){g({target:e.target,clientY:e.touches[0].clientY,touch:!0})},ref:u,children:Object(a.jsx)("div",{style:{transform:`translateY(${p}px)`},ref:d,children:n})})}const Ql=()=>Object(a.jsx)("div",{className:"playlist-scrollbar-handle",style:{height:18}});function Ll(){const e=ki(Ft)(Q).height,A=ki(ft),t=ki(bt),n=Ii(la);return Object(a.jsx)("div",{className:"playlist-scrollbar",style:{marginLeft:5},children:Object(a.jsx)(Tl,{height:e-58,handleHeight:18,width:8,value:A/100,onChange:e=>n(100*e),handle:Object(a.jsx)(Ql,{}),disabled:t})})}t(92);function jl(e){return e.playlist.trackOrder.length-1}var Dl=function({analyser:e}){const A=ki(mt),t=ki(ut),n=ki(Lt),r=ki(ct),o=ki(lt),l=ki(jl),s=ki(Jt),c=ki(Ft),u=n===Q,d=Boolean(r(Q)),g=t(Q),p=c(Q),h=Ii(Hn),f=Ii(Jn),m=Ii(ua),E=Ii(da),b=Ii(pr),w=Ii(Ba),y=g[0]>2,O=!o(T),k=Object(i.useCallback)((e,t)=>{const n=e.clientY-t.y,r=ie(A+Math.round((n-23)/13),0,l+1);w(e,R,r)},[w,l,A]);if(d)return Object(a.jsx)(El,{});const I={color:s.normal,backgroundColor:s.normalbg,fontFamily:s.font+", Arial, sans-serif",height:p.height+"px",width:p.width+"px"},S=vi()("window","draggable",{selected:u}),U=g[0]%2==0;return Object(a.jsx)(xi,{windowId:Q,children:Object(a.jsxs)(Ji,{id:"playlist-window",windowId:Q,className:S,style:I,handleDrop:k,onWheel:b,children:[Object(a.jsxs)("div",{className:"playlist-top draggable",onDoubleClick:f,children:[Object(a.jsx)("div",{className:"playlist-top-left draggable"}),U&&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"}),U&&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:f}),Object(a.jsx)("div",{id:"playlist-close-button",onClick:()=>h(Q)})]})]}),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)(Nl,{})}),Object(a.jsx)("div",{className:"playlist-middle-right draggable",children:Object(a.jsx)(Ll,{})})]}),Object(a.jsxs)("div",{className:"playlist-bottom draggable",children:[Object(a.jsxs)("div",{className:"playlist-bottom-left draggable",children:[Object(a.jsx)(yl,{}),Object(a.jsx)(Ol,{}),Object(a.jsx)(kl,{}),Object(a.jsx)(Ul,{})]}),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:O&&Object(a.jsx)("div",{className:"visualizer-wrapper",children:Object(a.jsx)(jo,{analyser:e})})}),Object(a.jsx)(Bl,{}),Object(a.jsx)(vl,{}),Object(a.jsx)("div",{id:"playlist-scroll-up-button",onClick:m}),Object(a.jsx)("div",{id:"playlist-scroll-down-button",onClick:E}),Object(a.jsx)(ml,{})]})]})]})})};const Vl=()=>Object(a.jsx)("div",{style:{width:11,height:11,marginLeft:1},className:"slider-handle"});function Rl({id:e,onChange:A,band:t}){const n=ki(PA)[t],r=Object(i.useMemo)(()=>{const{x:e,y:A}={x:(t=(e=>{const A=e/100;return Math.round(27*A)})(n))%14,y:Math.floor(t/14)};var t;return`-${15*e}px -${65*A}px`},[n]),o=Ii(ai),l=Ii(ri);return Object(a.jsx)("div",{id:e,className:"band",style:{backgroundPosition:r,height:63},children:Object(a.jsx)(Tl,{height:62,width:14,handleHeight:11,value:1-n/100,onBeforeChange:()=>o(t),onChange:e=>A(100*(1-e)),onAfterChange:l,handle:Object(a.jsx)(Vl,{})})})}var Fl=()=>{const e=Ii(Ur),A=ki(en);return Object(a.jsx)("div",{id:"on",className:vi()({selected:A}),onClick:e})};var Gl=Object(i.memo)(()=>{const e=ki(e=>e.equalizer.auto),A=Ii(vr);return Object(a.jsx)("div",{id:"auto",className:vi()({selected:e}),onClick:A})});function Pl(e,A){const t=function(e,A){const t=e.map(()=>0),n=e.length-1,r=function(e,A){const t=[];for(let n=0;nr&&(n=a,r=e[a][A]);Kl(e,A,n);for(let n=A+1;n=0;n--){const r=e[n][t]/e[n][n];A[n]=r;for(let A=n-1;A>=0;A--)e[A][t]-=e[A][n]*r,e[A][n]=0}return A}(r,t)}(e,A),n=e[e.length-1],r=[];let a=1;for(let i=0;i<=n;i++){for(;e[a]{var e;return null!==(e=null==t?void 0:t.getContext("2d"))&&void 0!==e?e:null},[t]),o=function(e){const A=Ei(ki(In));return Object(i.useMemo)(()=>null==e||null==A?null:e.createPattern(A,"repeat-x"),[e,A])}(r);return Object(i.useLayoutEffect)(()=>{if(null==r||null==t||null==A||null==o)return;const n=Number(t.width),a=Number(t.height);r.clearRect(0,0,n,a),function({colorPattern:e,sliders:A,canvasCtx:t,preampLineImage:n}){const r=ce(A.preamp/100,0,18);t.drawImage(n,0,r,n.width,n.height);const a=N.map(e=>A[e]);t.fillStyle=e;const i=[],o=[];a.forEach((e,A)=>{const t=(100-e)/100;i.push(12*A),o.push(ce(t,0,18))});const l=Pl(i,o),s=i[i.length-1];let c=o[0];for(let e=0;e<=s;e++){const A=ie(Math.round(l[e]),0,18),n=Math.min(A,c),r=1+Math.abs(c-A);t.fillRect(2+e,n,1,r),c=A}}({colorPattern:o,sliders:e,canvasCtx:r,preampLineImage:A})},[r,t,o,A,e]),Object(a.jsx)("canvas",{id:"eqGraph",ref:n,width:113,height:19})},Yl=t(41);var Jl=()=>{const e=Ii(Sa),A=Ii(Ta),t=Ii(Na);return Object(a.jsx)(No,{top:!0,id:"presets-context",renderMenu:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsxs)(Zi,{label:"Load",children:[Yl.presets.map(e=>Object(a.jsx)($i,{onClick:()=>t(e),label:e.name},e.name)),Object(a.jsx)(Wi,{}),Object(a.jsx)($i,{onClick:e,label:"From Eqf..."})]}),Object(a.jsx)($i,{onClick:A,label:"Save"})]}),children:Object(a.jsx)("div",{id:"presets"})})};function Hl(){const e=ki(Lt)===L,A=Ii(Hn),t=Ii(zn);return Object(a.jsxs)(Bo,{id:"eq-buttons",children:[Object(a.jsx)("div",{id:"equalizer-shade",onClick:t}),Object(a.jsx)("div",{id:"equalizer-close",onClick:()=>A(L)})]},e?"selected":"unselected")}var _l=()=>{const e=ki(_t),A=ki(qt),t=Ii(zn),n=["left","center","right"],r=he(0,100,e,n),i=he(-100,100,A,n);return Object(a.jsxs)("div",{className:"draggable",onDoubleClick:t,style:{width:"100%",height:"100%"},children:[Object(a.jsx)(Hl,{}),Object(a.jsx)(gl,{id:"equalizer-volume",className:r}),Object(a.jsx)(Fo,{id:"equalizer-balance",className:i})]})};t(94);var ql=()=>{const e=ki(jt),A=ki(Lt),t=ki(ct),n=A===L,r=t(L),i=Ii(Sr),o=Ii(Ir),l=Ii(kr),s=Ii(Or),c=Ii(wr),u=Ii(zn),d=vi()({selected:n,doubled:e,shade:r,window:!0,draggable:!0});return Object(a.jsx)("div",{id:"equalizer-window",className:d,children:Object(a.jsx)(xi,{windowId:L,children:r?Object(a.jsx)(_l,{}):Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:"equalizer-top title-bar draggable",onDoubleClick:u,children:Object(a.jsx)(Hl,{})}),Object(a.jsx)(Fl,{}),Object(a.jsx)(Gl,{}),Object(a.jsx)(zl,{}),Object(a.jsx)(Jl,{}),Object(a.jsx)(Rl,{id:"preamp",band:"preamp",onChange:i}),Object(a.jsx)("div",{id:"plus12db",onClick:s}),Object(a.jsx)("div",{id:"zerodb",onClick:l}),Object(a.jsx)("div",{id:"minus12db",onClick:o}),N.map(e=>{return Object(a.jsx)(Rl,{id:(A=e,"band-"+A),band:e,onChange:A=>c(e,A)},e);var A})]})})})};const Wl={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(Br).forEach(e=>{const A=xr(e),t=e.charCodeAt(0);Wl[A]=[".character-"+t]}),K.forEach(e=>{Wl["GEN_TEXT_"+e]=[".gen-text-"+e.toLowerCase()],Wl["GEN_TEXT_SELECTED_"+e]=[".gen-window.selected .gen-text-"+e.toLowerCase()]});const Zl={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 Xl({children:e,id:A}){const t=Object(i.useMemo)(()=>{const e=document.createElement("style");return e.type="text/css",e.id=A,e},[A]);return Object(i.useLayoutEffect)(()=>(document.head.appendChild(t),()=>t.remove()),[t]),Object(l.createPortal)(e,t)}function $l({children:e}){const A=Object(i.useMemo)(()=>document.createElement("div"),[]);return Object(i.useLayoutEffect)(()=>(document.body.appendChild(A),()=>A.remove()),[A]),Object(l.createPortal)(Object(a.jsx)("svg",{height:0,width:0,children:Object(a.jsx)("defs",{children:Object.keys(e).map(A=>Object(a.jsx)("clipPath",{id:A,children:e[A].map((e,A)=>Object(a.jsx)("polygon",{points:e},A))},A))})}),A)}var es=t(42);const As={normal:"mainWindowClipPath",windowshade:"shadeMainWindowClipPath",equalizer:"equalizerWindowClipPath",equalizerws:"shadeEqualizerWindowClipPath"},ts={normal:"#main-window:not(.shade)",windowshade:"#main-window.shade",equalizer:"#equalizer-window:not(.shade)",equalizerws:"#equalizer-window.shade"},ns={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 rs(e){return`${e.startsWith("#webamp-context-menu")?"":"#webamp"} ${e}`}const as=Object(Ke.createSelector)((function(e){return e.display.skinImages}),(function(e){return e.display.skinCursors}),(function(e){return e.display.skinGenLetterWidths}),On,(e,A,t,n)=>{if(!e||!A)return null;const r=[];Object.keys(Wl).forEach(A=>{const t=e[A]||e[ns[A]];t&&Wl[A].forEach(e=>{r.push(`#webamp ${e} {background-image: url(${t})}`)})}),null!=t&&K.forEach(e=>{const A=t["GEN_TEXT_"+e],n=t["GEN_TEXT_SELECTED_"+e];r.push(`#webamp .gen-text-${e.toLowerCase()} {width: ${A}px;}`),r.push(`#webamp .selected .gen-text-${e.toLowerCase()} {width: ${n}px;}`)}),Object.entries(Zl).forEach(([e,t])=>{const n=A[e];if(null==n)return;const a=t.map(rs).map(e=>{switch(n.type){case"cur":return`${e} {cursor: url(${n.url}), auto}`;case"ani":try{return Object(es.convertAniBinaryToCSS)(e,n.aniData)}catch(e){return console.error(e),null}}}).filter(Boolean);r.push(...a)}),(e=>Boolean(e.DIGIT_0_EX))(e)&&r.push("#webamp .webamp-status #time #minus-sign { top: 0px; left: -1px; width: 9px; height: 13px; }");for(const[e,A]of Object.entries(n))if(A){const A=ts[e],t=As[e];r.push(`#webamp ${A} { clip-path: url(#${t}); }`)}return r.join("\n")}),is=Object(Ke.createSelector)(On,e=>{const A={};for(const[t,n]of Object.entries(e))if(n){A[As[t]]=n}return A});function os(){const e=ki(as),A=ki(is);return null==e?null:Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Xl,{id:"webamp-skin",children:e}),Object(a.jsx)($l,{children:A})]})}t(98);function ls({media:e,filePickers:A}){const t=ki(yn),n=ki(ot),r=ki(Vt),o=Ii($n),l=Ii(_n),[c]=Object(i.useState)(()=>{const e=document.createElement("div");return e.id="webamp",e.role="application",e});Object(i.useLayoutEffect)(()=>{c.style.zIndex=String(r)},[c,r]),Object(i.useLayoutEffect)(()=>(document.body.appendChild(c),()=>{document.body.removeChild(c)}),[c]),Object(i.useEffect)(()=>{const e=()=>{null!=c&&(c.style.right="0",c.style.bottom="0",c.style.overflow="hidden",o(Oe()),c.style.right="auto",c.style.bottom="auto",c.style.overflow="visible")};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[o,c]);const u=Object(i.useCallback)(()=>we(n,(t,n)=>{if(!t.open)return null;switch(n){case T:return Object(a.jsx)(fl,{analyser:e.getAnalyser(),filePickers:A});case L:return Object(a.jsx)(ql,{});case Q:return Object(a.jsx)(Dl,{analyser:e.getAnalyser()});case j:return Object(a.jsx)(lo,{analyser:e.getAnalyser()});default:throw new Error("Tried to render an unknown window: "+n)}}),[e,A,n]);return t?null:s.a.createPortal(Object(a.jsx)(i.StrictMode,{children:Object(a.jsxs)("div",{onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||l(null)},children:[Object(a.jsx)(os,{}),Object(a.jsx)(no,{renderContents:()=>Object(a.jsx)(go,{filePickers:A}),children:Object(a.jsx)(Eo,{windows:u()})})]})}),c)}const ss=new Set(["input","textarea","select"]);class cs{constructor(){r()(this,"_listeners",void 0),this._listeners={}}on(e,A){const t=this._listeners[e]||[];t.push(A),this._listeners[e]=t;return()=>{this._listeners[e]=t.filter(e=>e!==A)}}trigger(e,...A){const t=this._listeners[e];t&&t.forEach(e=>e(...A))}dispose(){this._listeners={}}}function us(e,A={balance:0}){let t=0;const n=e.createGain();n.channelCount=2,n.channelCountMode="explicit",n.channelInterpretation="speakers";const r=e.createChannelSplitter(2),a=e.createGain(),i=e.createGain(),o=e.createChannelMerger(2);function l(e){const A=Number(e);a.gain.value=A>0?1-A:1,i.gain.value=A>0?1:1+A,t=A}n.connect(r),r.connect(a,0),r.connect(i,1),a.connect(o,0,0),i.connect(o,0,1);const s={};return Object.defineProperties(s,{value:{get:function(){return t},set:l,enumerable:!0,configurable:!0}}),Object.defineProperties(n,{balance:{value:s,enumerable:!0,writable:!1,configurable:!0},connect:{value:AudioNode.prototype.connect.bind(o),enumerable:!1,writable:!1,configurable:!0},disconnect:{value:AudioNode.prototype.disconnect.bind(o),enumerable:!1,writable:!1,configurable:!0}}),t!==A.balance&&l(A.balance),n}class ds{on(e,A){return this._emitter.on(e,A)}constructor(e,A){r()(this,"_emitter",void 0),r()(this,"_context",void 0),r()(this,"_source",void 0),r()(this,"_destination",void 0),r()(this,"_audio",void 0),r()(this,"_stalled",void 0),r()(this,"_status",void 0),this._emitter=new cs,this._context=e,this._destination=A,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(A)}_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=ie(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 gs{constructor(){if(r()(this,"_emitter",void 0),r()(this,"_context",void 0),r()(this,"_balance",void 0),r()(this,"_staticSource",void 0),r()(this,"_preamp",void 0),r()(this,"_analyser",void 0),r()(this,"_gainNode",void 0),r()(this,"_source",void 0),r()(this,"_bands",void 0),this._emitter=new cs,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 us(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 ds(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={},N.forEach((A,t)=>{const n=this._context.createBiquadFilter();this._bands[A]=n,0===t?n.type="lowshelf":t===N.length-1?n.type="highshelf":n.type="peaking",n.frequency.value=A,n.gain.value=0,e.connect(n),e=n}),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 A=this.duration()*(e/100);this.seekToTime(A)}setVolume(e){this._gainNode.gain.value=e/100}setPreamp(e){const A=e/100*24-12;this._preamp.gain.value=Math.pow(10,A/20)}setBalance(e){this._balance.balance.value=e/100}setEqBand(e,A){const t=A/100*24-12;this._bands[e].gain.value=t}disableEq(){this._staticSource.disconnect(),this._staticSource.connect(this._balance)}enableEq(){this._staticSource.disconnect(),this._staticSource.connect(this._preamp)}on(e,A){this._emitter.on(e,A)}seekToTime(e){this._source.seekToTime(e)}async loadFromUrl(e,A){this._emitter.trigger("waiting"),await this._source.loadUrl(e),this._emitter.trigger("stopWaiting"),A&&this.play()}dispose(){this._source.dispose(),this._emitter.dispose()}}t(100);class ps{constructor(){r()(this,"_teardowns",[]),r()(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 hs{static browserIsSupported(){const e=!(!window.AudioContext&&!window.webkitAudioContext),A=!!window.document.createElement("canvas").getContext;return e&&A&&"undefined"!=typeof Promise}constructor(e){r()(this,"_actionEmitter",void 0),r()(this,"_node",void 0),r()(this,"_disposable",void 0),r()(this,"options",void 0),r()(this,"media",void 0),r()(this,"store",void 0),this._node=null,this._disposable=new ps,this._actionEmitter=new cs,this.options=e;const{initialTracks:A,initialSkin:t,avaliableSkins:n,availableSkins:a,enableHotkeys:i=!1,zIndex:o,requireJSZip:l,requireMusicMetadata:s,handleTrackDropEvent:c,handleAddUrlEvent:u,handleLoadListEvent:d,handleSaveListEvent:g,__butterchurnOptions:p,__customMediaClass:h}=this.options;let f=null;if(null!=p){const{importConvertPreset:e,presetConverterEndpoint:A}=p;null!=e&&null!=A&&(f=async t=>{const{convertPreset:n}=await e();return n(await pA(t),A)})}var m;this.media=new(h||gs),this.store=pi(this.media,this._actionEmitter,this.options.__customMiddlewares,this.options.__initialState,{requireJSZip:l,requireMusicMetadata:s,convertPreset:f,handleTrackDropEvent:c,handleAddUrlEvent:u,handleLoadListEvent:d,handleSaveListEvent:g}),navigator.onLine?this.store.dispatch({type:"NETWORK_CONNECTED"}):this.store.dispatch({type:"NETWORK_DISCONNECTED"}),null!=o&&this.store.dispatch({type:"SET_Z_INDEX",zIndex:o}),e.__butterchurnOptions&&(this.store.dispatch({type:"ENABLE_MILKDROP",open:e.__butterchurnOptions.butterchurnOpen}),this.store.dispatch((m=e.__butterchurnOptions,async e=>{const{getPresets:A,importButterchurn:t}=m;t().then(A=>{e({type:"GOT_BUTTERCHURN",butterchurn:A.default})});const n=(await A()).map(Ka);e(za(n))})));const E=()=>this.store.dispatch({type:"NETWORK_CONNECTED"}),b=()=>this.store.dispatch({type:"NETWORK_DISCONNECTED"});window.addEventListener("online",E),window.addEventListener("offline",b),this._disposable.add(()=>{window.removeEventListener("online",E),window.removeEventListener("offline",b)}),t?this.store.dispatch(ka(t.url)):this.store.dispatch({type:"LOADED"}),A&&this._bufferTracks(A),null!=n?(console.warn("The misspelled option `avaliableSkins` is deprecated. Please use `availableSkins` instead."),this.store.dispatch({type:"SET_AVAILABLE_SKINS",skins:n})):null!=a&&this.store.dispatch({type:"SET_AVAILABLE_SKINS",skins:a});const w=e.__initialWindowLayout;null==w?this.store.dispatch(er()):(be(w,(e,A)=>{null!=e.size&&this.store.dispatch(qn(A,e.size))}),this.store.dispatch(Zn(we(w,e=>e.position),!1))),i&&this._disposable.add(function(e){let A=0;const t=[78,85,76,76,83,79,70,84],n=n=>{if(!(n.target instanceof Element&&ss.has(n.target.tagName.toLowerCase()))){if(n.ctrlKey)switch(n.keyCode){case 68:e(Kn()),n.preventDefault();break;case 76:break;case 82:e({type:"REVERSE_LIST"});break;case 84:e({type:"TOGGLE_TIME_MODE"})}else if(n.altKey)switch(n.keyCode){case 87:e(Wn("main"));break;case 69:e(Wn("playlist"));break;case 71:e(Wn("equalizer"))}else switch(n.keyCode){case 37:e(ur(5));break;case 38:e(gr(1));break;case 39:e(cr(5));break;case 40:e(gr(-1));break;case 66:e(or());break;case 67:e(rr());break;case 76:e(Ua());break;case 82:e({type:"TOGGLE_REPEAT"});break;case 83:e({type:"TOGGLE_SHUFFLE"});break;case 86:e({type:"STOP"});break;case 88:e(nr());break;case 90:e(lr());break;case 96:e(Ua());break;case 97:e(ir(-10));break;case 98:e(gr(-1));break;case 99:e(ir(10));break;case 100:e(lr());break;case 101:e(nr());break;case 102:e(or());break;case 103:e(ur(5));break;case 104:e(gr(1));break;case 105:e(cr(5))}27!==n.keyCode&&(A=n.keyCode===t[A]?A+1:0,A===t.length&&e({type:"TOGGLE_LLAMA_MODE"}))}};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}}(this.store.dispatch))}play(){this.store.dispatch(nr())}pause(){this.store.dispatch(rr())}stop(){this.store.dispatch({type:"STOP"})}seekBackward(e){this.store.dispatch(ur(e))}seekForward(e){this.store.dispatch(cr(e))}seekToTime(e){this.store.dispatch(sr(e))}nextTrack(){this.store.dispatch(or())}previousTrack(){this.store.dispatch(lr())}_bufferTracks(e){const A=HA(this.store.getState());this.store.dispatch(xa(e,D,A))}appendTracks(e){const A=HA(this.store.getState());this.store.dispatch(xa(e,R,A))}setTracksToPlay(e){this.store.dispatch(xa(e,V))}getMediaStatus(){return It(this.store.getState())}onWillClose(e){return this._actionEmitter.on("CLOSE_REQUESTED",A=>{e(A.cancel)})}onClose(e){return this._actionEmitter.on("CLOSE_WINAMP",e)}close(){this.store.dispatch(e=>{let A=!1;e({type:"CLOSE_REQUESTED",cancel:()=>{A=!0}}),A||(e({type:"STOP"}),e({type:"CLOSE_WINAMP"}))})}reopen(){this.store.dispatch({type:"OPEN_WINAMP"})}onTrackDidChange(e){let A=null;return this.store.subscribe(()=>{const t=this.store.getState(),n=vt(t);n!==A&&(A=n,e(null==n?null:Ct(t)))})}onMinimize(e){return this._actionEmitter.on("MINIMIZE_WINAMP",e)}setSkinFromUrl(e){this.store.dispatch(ka(e))}async skinIsLoaded(){var e,A;await(e=this.store,A=e=>!e.display.loading,new Promise(t=>{if(A(e.getState()))return void t();const n=e.subscribe(()=>{A(e.getState())&&(t(),n())})})),await Promise.all([kn(this.store.getState()),In(this.store.getState())])}__loadSerializedState(e){this.store.dispatch(function(e){return A=>{A({type:"LOAD_SERIALIZED_STATE",serializedState:e}),A(Ar())}}(e))}__getSerializedState(){return{version:1,media:Ge((e=this.store.getState()).media),equalizer:e.equalizer,display:qe(e.display),windows:je(e.windows)};var e}__onStateChange(e){return this.store.subscribe(e)}async renderWhenReady(e){var A;if(this.store.dispatch((A=e,(e,t)=>{if(!t().windows.positionsAreRelative)return;const{left:n,top:r}=A.getBoundingClientRect(),{scrollWidth:a,scrollHeight:i}=A;e(Xn({left:n,top:r,width:a,height:i}))})),await this.skinIsLoaded(),null!=this._node)throw new Error("Cannot render a Webamp instance twice");this._node=e,this._disposable.add(()=>{null!=this._node&&(s.a.unmountComponentAtNode(this._node),this._node=null)}),s.a.render(Object(a.jsx)(h,{store:this.store,children:Object(a.jsx)(ls,{media:this.media,filePickers:this.options.filePickers||[]})}),e)}dispose(){this.media.dispose(),this._actionEmitter.dispose(),this._disposable.dispose()}}r()(hs,"VERSION","1.5.0");A.default=hs},,,,,,,,function(e,A,t){"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. */t(23);var n=t(1),r=60103;if(A.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var a=Symbol.for;r=a("react.element"),A.Fragment=a("react.fragment")}var i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function s(e,A,t){var n,a={},s=null,c=null;for(n in void 0!==t&&(s=""+t),void 0!==A.key&&(s=""+A.key),void 0!==A.ref&&(c=A.ref),A)o.call(A,n)&&!l.hasOwnProperty(n)&&(a[n]=A[n]);if(e&&e.defaultProps)for(n in A=e.defaultProps)void 0===a[n]&&(a[n]=A[n]);return{$$typeof:r,type:e,key:s,ref:c,props:a,_owner:i.current}}A.jsx=s,A.jsxs=s},function(e,A,t){"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 n=t(23),r=60103,a=60106;A.Fragment=60107,A.StrictMode=60108,A.Profiler=60114;var i=60109,o=60110,l=60112;A.Suspense=60113;var s=60115,c=60116;if("function"==typeof Symbol&&Symbol.for){var u=Symbol.for;r=u("react.element"),a=u("react.portal"),A.Fragment=u("react.fragment"),A.StrictMode=u("react.strict_mode"),A.Profiler=u("react.profiler"),i=u("react.provider"),o=u("react.context"),l=u("react.forward_ref"),A.Suspense=u("react.suspense"),s=u("react.memo"),c=u("react.lazy")}var d="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var A="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t