-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpages.h
3 lines (3 loc) · 88 KB
/
webpages.h
1
2
3
static const char index_html[] PROGMEM = R"rawliteral(<!DOCTYPE HTML><html> <head> <title>foogadgets SLink Tool</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style>* { box-sizing: border-box;}body { /*margin: 0;*/}.content { height: 100%; width: 490px; position: fixed; z-index: 1; padding-left: 5px; top: 0; left: 0; overflow-x: hidden;}.albuminfo { margin-left: 16px;}.graphics { margin-left: 490px; padding-top: 60px; padding-left: 10px;}.graphics img { width:400px; height:400px;}.bottomleft { position: absolute; bottom: 5px; right: 16px;} </style> </head> <body><div class="content"><h1>SLink Tool</h1><p> <form> <b>1. Select MD length:</b> <input type="radio" name="mdLen" value="60">60m <input type="radio" name="mdLen" value="74" checked>74m <input type="radio" name="mdLen" value="80">80m <input type="radio" name="mdLen" value="999">No limit </form> <form> <b>2. Select MD quality:</b> <input type="radio" name="mdLP" value="1" checked>SP <input type="radio" name="mdLP" value="2">LP2 <input type="radio" name="mdLP" value="4">LP4 </form><div class="albuminfo"> <b>Number of tracks: </b><label id="numberOfTracks"></label><br> <b>Total playtime: </b><label id="playTime"></label></div><p> <form> <b>3.</b> <button type=button id="populateToc">Populate TOC from Spotify</button><p> <b>4.</b> <button type=button id="recordSpotify">Auto record from Spotify</button> <input type="hidden" id="spoturi" size="42"> </form><p> <form> <b>Table of contents</b><br> <input type="text" id="album" size="64" required placeholder="Artist name - Album name"></input> <br> <textarea id="songs" cols="55" rows="15" required placeholder="Song titles" wrap="hard"></textarea> <br><br> <b>5.</b> <button type="button" id="writeTocMd">Write TOC to MiniDisc</button> <tr> <button type="button" id="clearToc">Clear TOC</button> </form> <br><br><div class="albuminfo"> <a href="http://slinktool.local/login">Spotify login</a> </div> <script>var wsUri = 'ws://' + location.hostname + ':81/';(()=>{var e={924:(e,t,r)=>{"use strict";var o=r(210),n=r(559),i=n(o("String.prototype.indexOf"));e.exports=function(e,t){var r=o(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?n(r):r}},559:(e,t,r)=>{"use strict";var o=r(612),n=r(210),i=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),a=n("%Reflect.apply%",!0)||o.call(s,i),c=n("%Object.getOwnPropertyDescriptor%",!0),u=n("%Object.defineProperty%",!0),l=n("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=a(o,s,arguments);if(c&&u){var r=c(t,"length");r.configurable&&u(t,"length",{value:1+l(0,e.length-(arguments.length-1))})}return t};var p=function(){return a(o,i,arguments)};u?u(e.exports,"apply",{value:p}):e.exports.apply=p},767:e=>{function t(e){if(e)return function(e){for(var r in t.prototype)e[r]=t.prototype[r];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n=0;n<o.length;n++)if((r=o[n])===t||r.fn===t){o.splice(n,1);break}return 0===o.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],o=1;o<arguments.length;o++)t[o-1]=arguments[o];if(r){o=0;for(var n=(r=r.slice(0)).length;o<n;++o)r[o].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},445:e=>{e.exports=s,s.default=s,s.stable=l,s.stableStringify=l;var t="[...]",r="[Circular]",o=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=i()),c(e,"",0,[],void 0,0,s);try{a=0===n.length?JSON.stringify(e,t,r):JSON.stringify(e,f(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==o.length;){var u=o.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function a(e,t,r,i){var s=Object.getOwnPropertyDescriptor(i,r);void 0!==s.get?s.configurable?(Object.defineProperty(i,r,{value:e}),o.push([i,r,t,s])):n.push([t,r,e]):(i[r]=e,o.push([i,r,t]))}function c(e,o,n,i,s,u,l){var p;if(u+=1,"object"==typeof e&&null!==e){for(p=0;p<i.length;p++)if(i[p]===e)return void a(r,e,o,s);if(void 0!==l.depthLimit&&u>l.depthLimit)return void a(t,e,o,s);if(void 0!==l.edgesLimit&&n+1>l.edgesLimit)return void a(t,e,o,s);if(i.push(e),Array.isArray(e))for(p=0;p<e.length;p++)c(e[p],p,p,i,e,u,l);else{var f=Object.keys(e);for(p=0;p<f.length;p++){var y=f[p];c(e[y],y,p,i,e,u,l)}}i.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function l(e,t,r,s){void 0===s&&(s=i());var a,c=p(e,"",0,[],void 0,0,s)||e;try{a=0===n.length?JSON.stringify(c,t,r):JSON.stringify(c,f(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==o.length;){var u=o.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function p(e,n,i,s,c,l,f){var y;if(l+=1,"object"==typeof e&&null!==e){for(y=0;y<s.length;y++)if(s[y]===e)return void a(r,e,n,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==f.depthLimit&&l>f.depthLimit)return void a(t,e,n,c);if(void 0!==f.edgesLimit&&i+1>f.edgesLimit)return void a(t,e,n,c);if(s.push(e),Array.isArray(e))for(y=0;y<e.length;y++)p(e[y],y,y,s,e,l,f);else{var d={},h=Object.keys(e).sort(u);for(y=0;y<h.length;y++){var m=h[y];p(e[m],m,y,s,e,l,f),d[m]=e[m]}if(void 0===c)return d;o.push([c,n,e]),c[n]=d}s.pop()}}function f(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var o=0;o<n.length;o++){var i=n[o];if(i[1]===t&&i[0]===r){r=i[2],n.splice(o,1);break}}return e.call(this,t,r)}}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,o=Object.prototype.toString,n="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||o.call(i)!==n)throw new TypeError(t+i);for(var s,a=r.call(arguments,1),c=function(){if(this instanceof s){var t=i.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return i.apply(e,a.concat(r.call(arguments)))},u=Math.max(0,i.length-a.length),l=[],p=0;p<u;p++)l.push("$"+p);if(s=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(c),i.prototype){var f=function(){};f.prototype=i.prototype,s.prototype=new f,f.prototype=null}return s}},612:(e,t,r)=>{"use strict";var o=r(648);e.exports=Function.prototype.bind||o},210:(e,t,r)=>{"use strict";var o,n=SyntaxError,i=Function,s=TypeError,a=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var u=function(){throw new s},l=c?function(){try{return u}catch(e){try{return c(arguments,"callee").get}catch(e){return u}}}():u,p=r(405)(),f=Object.getPrototypeOf||function(e){return e.__proto__},y={},d="undefined"==typeof Uint8Array?o:f(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":p?f([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p?f(f([][Symbol.iterator]())):o,"%JSON%":"object"==typeof JSON?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&p?f((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&p?f((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p?f(""[Symbol.iterator]()):o,"%Symbol%":p?Symbol:o,"%SyntaxError%":n,"%ThrowTypeError%":l,"%TypedArray%":d,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet},m=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var o=e("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&(r=f(n.prototype))}return h[t]=r,r},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(612),v=r(642),w=b.call(Function.call,Array.prototype.concat),P=b.call(Function.apply,Array.prototype.splice),T=b.call(Function.call,String.prototype.replace),k=b.call(Function.call,String.prototype.slice),A=b.call(Function.call,RegExp.prototype.exec),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_=/\\(\\)?/g,E=function(e){var t=k(e,0,1),r=k(e,-1);if("%"===t&&"%"!==r)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var o=[];return T(e,S,(function(e,t,r,n){o[o.length]=r?T(n,_,"$1"):t||e})),o},x=function(e,t){var r,o=e;if(v(g,o)&&(o="%"+(r=g[o])[0]+"%"),v(h,o)){var i=h[o];if(i===y&&(i=m(o)),void 0===i&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:i}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===A(/^%?[^%]*%?$/g,e))throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=E(e),o=r.length>0?r[0]:"",i=x("%"+o+"%",t),a=i.name,u=i.value,l=!1,p=i.alias;p&&(o=p[0],P(r,w([0,1],p)));for(var f=1,y=!0;f<r.length;f+=1){var d=r[f],m=k(d,0,1),g=k(d,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new n("property names with quotes must have matching quotes");if("constructor"!==d&&y||(l=!0),v(h,a="%"+(o+="."+d)+"%"))u=h[a];else if(null!=u){if(!(d in u)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&f+1>=r.length){var b=c(u,d);u=(y=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[d]}else y=v(u,d),u=u[d];y&&!l&&(h[a]=u)}}return u}},405:(e,t,r)=>{"use strict";var o="undefined"!=typeof Symbol&&Symbol,n=r(419);e.exports=function(){return"function"==typeof o&&"function"==typeof Symbol&&"symbol"==typeof o("foo")&&"symbol"==typeof Symbol("bar")&&n()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(e,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},642:(e,t,r)=>{"use strict";var o=r(612);e.exports=o.call(Function.call,Object.prototype.hasOwnProperty)},631:(e,t,r)=>{var o="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=o&&n&&"function"==typeof n.get?n.get:null,s=o&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,h=Object.prototype.toString,m=Function.prototype.toString,g=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,P=String.prototype.toLowerCase,T=RegExp.prototype.test,k=Array.prototype.concat,A=Array.prototype.join,S=Array.prototype.slice,_=Math.floor,E="function"==typeof BigInt?BigInt.prototype.valueOf:null,x=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,j="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,R=Object.prototype.propertyIsEnumerable,C=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function N(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||T.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var o=e<0?-_(-e):_(e);if(o!==e){var n=String(o),i=b.call(t,n.length+1);return v.call(n,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,r,"$&_")}var B=r(654),L=B.custom,M=Q(L)?L:null;function U(e,t,r){var o="double"===(r.quoteStyle||t)?'"':"'";return o+e+o}function D(e){return v.call(String(e),/"/g,""")}function H(e){return!("[object Array]"!==z(e)||I&&"object"==typeof e&&I in e)}function F(e){return!("[object RegExp]"!==z(e)||I&&"object"==typeof e&&I in e)}function Q(e){if(j)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,o,n){var a=r||{};if(W(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!W(a,"customInspect")||a.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var h=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return $(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return h?N(t,w):w}if("bigint"==typeof t){var T=String(t)+"n";return h?N(t,T):T}var _=void 0===a.depth?5:a.depth;if(void 0===o&&(o=0),o>=_&&_>0&&"object"==typeof t)return H(t)?"[Array]":"[Object]";var x,L=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=A.call(Array(e.indent+1)," ")}return{base:r,prev:A.call(Array(t+1),r)}}(a,o);if(void 0===n)n=[];else if(G(n,t)>=0)return"[Circular]";function q(t,r,i){if(r&&(n=S.call(n)).push(r),i){var s={depth:a.depth};return W(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),e(t,s,o+1,n)}return e(t,a,o+1,n)}if("function"==typeof t&&!F(t)){var J=function(e){if(e.name)return e.name;var t=g.call(m.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=Z(t,q);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(ee.length>0?" { "+A.call(ee,", ")+" }":"")}if(Q(t)){var te=j?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||j?te:X(te)}if((x=t)&&"object"==typeof x&&("undefined"!=typeof HTMLElement&&x instanceof HTMLElement||"string"==typeof x.nodeName&&"function"==typeof x.getAttribute)){for(var re="<"+P.call(String(t.nodeName)),oe=t.attributes||[],ne=0;ne<oe.length;ne++)re+=" "+oe[ne].name+"="+U(D(oe[ne].value),"double",a);return re+=">",t.childNodes&&t.childNodes.length&&(re+="..."),re+"</"+P.call(String(t.nodeName))+">"}if(H(t)){if(0===t.length)return"[]";var ie=Z(t,q);return L&&!function(e){for(var t=0;t<e.length;t++)if(G(e[t],"\n")>=0)return!1;return!0}(ie)?"["+Y(ie,L)+"]":"[ "+A.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==z(e)||I&&"object"==typeof e&&I in e)}(t)){var se=Z(t,q);return"cause"in Error.prototype||!("cause"in t)||R.call(t,"cause")?0===se.length?"["+String(t)+"]":"{ ["+String(t)+"] "+A.call(se,", ")+" }":"{ ["+String(t)+"] "+A.call(k.call("[cause]: "+q(t.cause),se),", ")+" }"}if("object"==typeof t&&c){if(M&&"function"==typeof t[M]&&B)return B(t,{depth:_-o});if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{u.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ae=[];return s.call(t,(function(e,r){ae.push(q(r,t,!0)+" => "+q(e,t))})),K("Map",i.call(t),ae,L)}if(function(e){if(!u||!e||"object"!=typeof e)return!1;try{u.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return l.call(t,(function(e){ce.push(q(e,t))})),K("Set",u.call(t),ce,L)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return V("WeakMap");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return V("WeakSet");if(function(e){if(!y||!e||"object"!=typeof e)return!1;try{return y.call(e),!0}catch(e){}return!1}(t))return V("WeakRef");if(function(e){return!("[object Number]"!==z(e)||I&&"object"==typeof e&&I in e)}(t))return X(q(Number(t)));if(function(e){if(!e||"object"!=typeof e||!E)return!1;try{return E.call(e),!0}catch(e){}return!1}(t))return X(q(E.call(t)));if(function(e){return!("[object Boolean]"!==z(e)||I&&"object"==typeof e&&I in e)}(t))return X(d.call(t));if(function(e){return!("[object String]"!==z(e)||I&&"object"==typeof e&&I in e)}(t))return X(q(String(t)));if(!function(e){return!("[object Date]"!==z(e)||I&&"object"==typeof e&&I in e)}(t)&&!F(t)){var ue=Z(t,q),le=C?C(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",fe=!le&&I&&Object(t)===t&&I in t?b.call(z(t),8,-1):pe?"Object":"",ye=(le||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fe||pe?"["+A.call(k.call([],fe||[],pe||[]),": ")+"] ":"");return 0===ue.length?ye+"{}":L?ye+"{"+Y(ue,L)+"}":ye+"{ "+A.call(ue,", ")+" }"}return String(t)};var q=Object.prototype.hasOwnProperty||function(e){return e in this};function W(e,t){return q.call(e,t)}function z(e){return h.call(e)}function G(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,o=e.length;r<o;r++)if(e[r]===t)return r;return-1}function $(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return $(b.call(e,0,t.maxStringLength),t)+o}return U(v.call(v.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",t)}function J(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function X(e){return"Object("+e+")"}function V(e){return e+" { ? }"}function K(e,t,r,o){return e+" ("+t+") {"+(o?Y(r,o):A.call(r,", "))+"}"}function Y(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+A.call(e,","+r)+"\n"+t.prev}function Z(e,t){var r=H(e),o=[];if(r){o.length=e.length;for(var n=0;n<e.length;n++)o[n]=W(e,n)?t(e[n],e):""}var i,s="function"==typeof x?x(e):[];if(j){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var c in e)W(e,c)&&(r&&String(Number(c))===c&&c<e.length||j&&i["$"+c]instanceof Symbol||(T.call(/[^\w$]/,c)?o.push(t(c,e)+": "+t(e[c],e)):o.push(c+": "+t(e[c],e))));if("function"==typeof x)for(var u=0;u<s.length;u++)R.call(e,s[u])&&o.push("["+t(s[u])+"]: "+t(e[s[u]],e));return o}},798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,o="RFC3986";e.exports={default:o,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:o}},129:(e,t,r)=>{"use strict";var o=r(261),n=r(235),i=r(798);e.exports={formats:i,parse:n,stringify:o}},235:(e,t,r)=>{"use strict";var o=r(769),n=Object.prototype.hasOwnProperty,i=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:o.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},u=function(e,t,r,o){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(i),u=a?i.slice(0,a.index):i,l=[];if(u){if(!r.plainObjects&&n.call(Object.prototype,u)&&!r.allowPrototypes)return;l.push(u)}for(var p=0;r.depth>0&&null!==(a=s.exec(i))&&p<r.depth;){if(p+=1,!r.plainObjects&&n.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(a[1])}return a&&l.push("["+i.slice(a.index)+"]"),function(e,t,r,o){for(var n=o?t:c(t,r),i=e.length-1;i>=0;--i){var s,a=e[i];if("[]"===a&&r.parseArrays)s=[].concat(n);else{s=r.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(u,10);r.parseArrays||""!==u?!isNaN(l)&&a!==u&&String(l)===u&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(s=[])[l]=n:"__proto__"!==u&&(s[u]=n):s={0:n}}n=s}return n}(l,t,r,o)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||o.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,u={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,f=l.split(t.delimiter,p),y=-1,d=t.charset;if(t.charsetSentinel)for(r=0;r<f.length;++r)0===f[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[r]?d="utf-8":"utf8=%26%2310003%3B"===f[r]&&(d="iso-8859-1"),y=r,r=f.length);for(r=0;r<f.length;++r)if(r!==y){var h,m,g=f[r],b=g.indexOf("]="),v=-1===b?g.indexOf("="):b+1;-1===v?(h=t.decoder(g,s.decoder,d,"key"),m=t.strictNullHandling?null:""):(h=t.decoder(g.slice(0,v),s.decoder,d,"key"),m=o.maybeMap(c(g.slice(v+1),t),(function(e){return t.decoder(e,s.decoder,d,"value")}))),m&&t.interpretNumericEntities&&"iso-8859-1"===d&&(m=a(m)),g.indexOf("[]=")>-1&&(m=i(m)?[m]:m),n.call(u,h)?u[h]=o.combine(u[h],m):u[h]=m}return u}(e,r):e,p=r.plainObjects?Object.create(null):{},f=Object.keys(l),y=0;y<f.length;++y){var d=f[y],h=u(d,l[d],r,"string"==typeof e);p=o.merge(p,h,r)}return!0===r.allowSparse?p:o.compact(p)}},261:(e,t,r)=>{"use strict";var o=r(478),n=r(769),i=r(798),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,u=String.prototype.split,l=Array.prototype.push,p=function(e,t){l.apply(e,c(t)?t:[t])},f=Date.prototype.toISOString,y=i.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:y,formatter:i.formatters[y],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},h={},m=function e(t,r,i,s,a,l,f,y,m,g,b,v,w,P,T,k){for(var A,S=t,_=k,E=0,x=!1;void 0!==(_=_.get(h))&&!x;){var O=_.get(t);if(E+=1,void 0!==O){if(O===E)throw new RangeError("Cyclic object value");x=!0}void 0===_.get(h)&&(E=0)}if("function"==typeof y?S=y(r,S):S instanceof Date?S=b(S):"comma"===i&&c(S)&&(S=n.maybeMap(S,(function(e){return e instanceof Date?b(e):e}))),null===S){if(a)return f&&!P?f(r,d.encoder,T,"key",v):r;S=""}if("string"==typeof(A=S)||"number"==typeof A||"boolean"==typeof A||"symbol"==typeof A||"bigint"==typeof A||n.isBuffer(S)){if(f){var j=P?r:f(r,d.encoder,T,"key",v);if("comma"===i&&P){for(var I=u.call(String(S),","),R="",C=0;C<I.length;++C)R+=(0===C?"":",")+w(f(I[C],d.encoder,T,"value",v));return[w(j)+(s&&c(S)&&1===I.length?"[]":"")+"="+R]}return[w(j)+"="+w(f(S,d.encoder,T,"value",v))]}return[w(r)+"="+w(String(S))]}var N,B=[];if(void 0===S)return B;if("comma"===i&&c(S))N=[{value:S.length>0?S.join(",")||null:void 0}];else if(c(y))N=y;else{var L=Object.keys(S);N=m?L.sort(m):L}for(var M=s&&c(S)&&1===S.length?r+"[]":r,U=0;U<N.length;++U){var D=N[U],H="object"==typeof D&&void 0!==D.value?D.value:S[D];if(!l||null!==H){var F=c(S)?"function"==typeof i?i(M,D):M:M+(g?"."+D:"["+D+"]");k.set(t,E);var Q=o();Q.set(h,k),p(B,e(H,F,i,s,a,l,f,y,m,g,b,v,w,P,T,Q))}}return B};e.exports=function(e,t){var r,n=e,u=function(e){if(!e)return d;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||d.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==e.format){if(!s.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var o=i.formatters[r],n=d.filter;return("function"==typeof e.filter||c(e.filter))&&(n=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:d.addQueryPrefix,allowDots:void 0===e.allowDots?d.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,delimiter:void 0===e.delimiter?d.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:d.encode,encoder:"function"==typeof e.encoder?e.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:d.encodeValuesOnly,filter:n,format:r,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:d.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling}}(t);"function"==typeof u.filter?n=(0,u.filter)("",n):c(u.filter)&&(r=u.filter);var l,f=[];if("object"!=typeof n||null===n)return"";l=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var y=a[l];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h="comma"===y&&t&&t.commaRoundTrip;r||(r=Object.keys(n)),u.sort&&r.sort(u.sort);for(var g=o(),b=0;b<r.length;++b){var v=r[b];u.skipNulls&&null===n[v]||p(f,m(n[v],v,y,h,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.format,u.formatter,u.encodeValuesOnly,u.charset,g))}var w=f.join(u.delimiter),P=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?P+="utf8=%26%2310003%3B&":P+="utf8=%E2%9C%93&"),w.length>0?P+w:""}},769:(e,t,r)=>{"use strict";var o=r(798),n=Object.prototype.hasOwnProperty,i=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},o=0;o<e.length;++o)void 0!==e[o]&&(r[o]=e[o]);return r};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],o=0;o<t.length;++o)for(var n=t[o],s=n.obj[n.prop],a=Object.keys(s),c=0;c<a.length;++c){var u=a[c],l=s[u];"object"==typeof l&&null!==l&&-1===r.indexOf(l)&&(t.push({obj:s,prop:u}),r.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var o=[],n=0;n<r.length;++n)void 0!==r[n]&&o.push(r[n]);t.obj[t.prop]=o}}}(t),e},decode:function(e,t,r){var o=e.replace(/\+/g," ");if("iso-8859-1"===r)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(e){return o}},encode:function(e,t,r,n,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",u=0;u<a.length;++u){var l=a.charCodeAt(u);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===o.RFC1738&&(40===l||41===l)?c+=a.charAt(u):l<128?c+=s[l]:l<2048?c+=s[192|l>>6]+s[128|63&l]:l<55296||l>=57344?c+=s[224|l>>12]+s[128|l>>6&63]+s[128|63&l]:(u+=1,l=65536+((1023&l)<<10|1023&a.charCodeAt(u)),c+=s[240|l>>18]+s[128|l>>12&63]+s[128|l>>6&63]+s[128|63&l])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],o=0;o<e.length;o+=1)r.push(t(e[o]));return r}return t(e)},merge:function e(t,r,o){if(!r)return t;if("object"!=typeof r){if(i(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(o&&(o.plainObjects||o.allowPrototypes)||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return i(t)&&!i(r)&&(s=a(t,o)),i(t)&&i(r)?(r.forEach((function(r,i){if(n.call(t,i)){var s=t[i];s&&"object"==typeof s&&r&&"object"==typeof r?t[i]=e(s,r,o):t.push(r)}else t[i]=r})),t):Object.keys(r).reduce((function(t,i){var s=r[i];return n.call(t,i)?t[i]=e(t[i],s,o):t[i]=s,t}),s)}}},7:function(e,t){var r,o;void 0===(o="function"==typeof(r=function(){if("WebSocket"in window)return e.prototype.onopen=function(e){},e.prototype.onclose=function(e){},e.prototype.onconnecting=function(e){},e.prototype.onmessage=function(e){},e.prototype.onerror=function(e){},e.debugAll=!1,e.CONNECTING=WebSocket.CONNECTING,e.OPEN=WebSocket.OPEN,e.CLOSING=WebSocket.CLOSING,e.CLOSED=WebSocket.CLOSED,e;function e(t,r,o){var n={debug:!1,automaticOpen:!0,reconnectInterval:1e3,maxReconnectInterval:3e4,reconnectDecay:1.5,timeoutInterval:2e3,maxReconnectAttempts:null};for(var i in o||(o={}),n)void 0!==o[i]?this[i]=o[i]:this[i]=n[i];this.url=t,this.reconnectAttempts=0,this.readyState=WebSocket.CONNECTING,this.protocol=null;var s,a=this,c=!1,u=!1,l=document.createElement("div");function p(e,t){var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,!1,!1,t),r}l.addEventListener("open",(function(e){a.onopen(e)})),l.addEventListener("close",(function(e){a.onclose(e)})),l.addEventListener("connecting",(function(e){a.onconnecting(e)})),l.addEventListener("message",(function(e){a.onmessage(e)})),l.addEventListener("error",(function(e){a.onerror(e)})),this.addEventListener=l.addEventListener.bind(l),this.removeEventListener=l.removeEventListener.bind(l),this.dispatchEvent=l.dispatchEvent.bind(l),this.open=function(t){if(s=new WebSocket(a.url,r||[]),t){if(this.maxReconnectAttempts&&this.reconnectAttempts>this.maxReconnectAttempts)return}else l.dispatchEvent(p("connecting")),this.reconnectAttempts=0;(a.debug||e.debugAll)&&console.debug("ReconnectingWebSocket","attempt-connect",a.url);var o=s,n=setTimeout((function(){(a.debug||e.debugAll)&&console.debug("ReconnectingWebSocket","connection-timeout",a.url),u=!0,o.close(),u=!1}),a.timeoutInterval);s.onopen=function(r){clearTimeout(n),(a.debug||e.debugAll)&&console.debug("ReconnectingWebSocket","onopen",a.url),a.protocol=s.protocol,a.readyState=WebSocket.OPEN,a.reconnectAttempts=0;var o=p("open");o.isReconnect=t,t=!1,l.dispatchEvent(o)},s.onclose=function(r){if(clearTimeout(n),s=null,c)a.readyState=WebSocket.CLOSED,l.dispatchEvent(p("close"));else{a.readyState=WebSocket.CONNECTING;var o=p("connecting");o.code=r.code,o.reason=r.reason,o.wasClean=r.wasClean,l.dispatchEvent(o),t||u||((a.debug||e.debugAll)&&console.debug("ReconnectingWebSocket","onclose",a.url),l.dispatchEvent(p("close")));var n=a.reconnectInterval*Math.pow(a.reconnectDecay,a.reconnectAttempts);setTimeout((function(){a.reconnectAttempts++,a.open(!0)}),n>a.maxReconnectInterval?a.maxReconnectInterval:n)}},s.onmessage=function(t){(a.debug||e.debugAll)&&console.debug("ReconnectingWebSocket","onmessage",a.url,t.data);var r=p("message");r.data=t.data,l.dispatchEvent(r)},s.onerror=function(t){(a.debug||e.debugAll)&&console.debug("ReconnectingWebSocket","onerror",a.url,t),l.dispatchEvent(p("error"))}},1==this.automaticOpen&&this.open(!1),this.send=function(t){if(s)return(a.debug||e.debugAll)&&console.debug("ReconnectingWebSocket","send",a.url,t),s.send(t);throw"INVALID_STATE_ERR : Pausing to reconnect websocket"},this.close=function(e,t){void 0===e&&(e=1e3),c=!0,s&&s.close(e,t)},this.refresh=function(){s&&s.close()}}})?r.apply(t,[]):r)||(e.exports=o)},478:(e,t,r)=>{"use strict";var o=r(210),n=r(924),i=r(631),s=o("%TypeError%"),a=o("%WeakMap%",!0),c=o("%Map%",!0),u=n("WeakMap.prototype.get",!0),l=n("WeakMap.prototype.set",!0),p=n("WeakMap.prototype.has",!0),f=n("Map.prototype.get",!0),y=n("Map.prototype.set",!0),d=n("Map.prototype.has",!0),h=function(e,t){for(var r,o=e;null!==(r=o.next);o=r)if(r.key===t)return o.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,o={assert:function(e){if(!o.has(e))throw new s("Side channel does not contain "+i(e))},get:function(o){if(a&&o&&("object"==typeof o||"function"==typeof o)){if(e)return u(e,o)}else if(c){if(t)return f(t,o)}else if(r)return function(e,t){var r=h(e,t);return r&&r.value}(r,o)},has:function(o){if(a&&o&&("object"==typeof o||"function"==typeof o)){if(e)return p(e,o)}else if(c){if(t)return d(t,o)}else if(r)return function(e,t){return!!h(e,t)}(r,o);return!1},set:function(o,n){a&&o&&("object"==typeof o||"function"==typeof o)?(e||(e=new a),l(e,o,n)):c?(t||(t=new c),y(t,o,n)):(r||(r={key:{},next:null}),function(e,t,r){var o=h(e,t);o?o.value=r:e.next={key:t,next:e.next,value:r}}(r,o,n))}};return o}},392:(e,t,r)=>{"use strict";var o=r(528);e.exports.builder=function(){return o.builder().withHost("accounts.spotify.com").withPort(443).withScheme("https")}},528:e=>{"use strict";var t=function(e){if(!e)throw new Error("No builder supplied to constructor");this.host=e.host,this.port=e.port,this.scheme=e.scheme,this.queryParameters=e.queryParameters,this.bodyParameters=e.bodyParameters,this.headers=e.headers,this.path=e.path};t.prototype._getter=function(e){return function(){return this[e]}},t.prototype.getHost=t.prototype._getter("host"),t.prototype.getPort=t.prototype._getter("port"),t.prototype.getScheme=t.prototype._getter("scheme"),t.prototype.getPath=t.prototype._getter("path"),t.prototype.getQueryParameters=t.prototype._getter("queryParameters"),t.prototype.getBodyParameters=t.prototype._getter("bodyParameters"),t.prototype.getHeaders=t.prototype._getter("headers"),t.prototype.getURI=function(){if(!this.scheme||!this.host||!this.port)throw new Error("Missing components necessary to construct URI");var e=this.scheme+"://"+this.host;return("http"===this.scheme&&80!==this.port||"https"===this.scheme&&443!==this.port)&&(e+=":"+this.port),this.path&&(e+=this.path),e},t.prototype.getURL=function(){var e=this.getURI();return this.getQueryParameters()?e+this.getQueryParameterString(this.getQueryParameters()):e},t.prototype.getQueryParameterString=function(){var e=this.getQueryParameters();if(e)return"?"+Object.keys(e).filter((function(t){return void 0!==e[t]})).map((function(t){return t+"="+e[t]})).join("&")},t.prototype.execute=function(e,t){if(!t){var r=this;return new Promise((function(t,o){e(r,(function(e,r){e?o(e):t(r)}))}))}e(this,t)};var r=function(){};r.prototype._setter=function(e){return function(t){return this[e]=t,this}},r.prototype.withHost=r.prototype._setter("host"),r.prototype.withPort=r.prototype._setter("port"),r.prototype.withScheme=r.prototype._setter("scheme"),r.prototype.withPath=r.prototype._setter("path"),r.prototype._assigner=function(e){return function(){for(var t=0;t<arguments.length;t++)this[e]=this._assign(this[e],arguments[t]);return this}},r.prototype.withQueryParameters=r.prototype._assigner("queryParameters"),r.prototype.withBodyParameters=r.prototype._assigner("bodyParameters"),r.prototype.withHeaders=r.prototype._assigner("headers"),r.prototype.withAuth=function(e){return e&&this.withHeaders({Authorization:"Bearer "+e}),this},r.prototype._assign=function(e,t){return t&&Array.isArray(t)||t&&"string"==typeof t?t:t&&Object.keys(t).length>0?Object.assign(e||{},t):e},r.prototype.build=function(){return new t(this)},e.exports.builder=function(){return new r}},539:(e,t,r)=>{e.exports=r(646)},749:(e,t,r)=>{"use strict";var o=r(569),{TimeoutError:n,WebapiError:i,WebapiRegularError:s,WebapiAuthenticationError:a,WebapiPlayerError:c}=r(936),u={},l=function(e){var t={};return e.getQueryParameters()&&(t.query=e.getQueryParameters()),e.getHeaders()&&"application/json"===e.getHeaders()["Content-Type"]?t.data=JSON.stringify(e.getBodyParameters()):e.getBodyParameters()&&(t.data=e.getBodyParameters()),e.getHeaders()&&(t.headers=e.getHeaders()),t};u._makeRequest=function(e,t,r,u){var l=e.bind(o)(r);t.query&&l.query(t.query),t.headers&&l.set(t.headers),t.data&&l.send(t.data),l.end((function(e,t){return e?e.timeout?u(new n):e.response?u(function(e){return"object"==typeof e.body&&e.body.error&&"object"==typeof e.body.error&&e.body.error.reason?new c(e.body,e.headers,e.statusCode):"object"==typeof e.body&&e.body.error&&"object"==typeof e.body.error?new s(e.body,e.headers,e.statusCode):"object"==typeof e.body&&e.body.error&&"string"==typeof e.body.error?new a(e.body,e.headers,e.statusCode):new i(e.body,e.headers,e.statusCode,e.body)}(e.response)):u(e):u(null,{body:t.body,headers:t.headers,statusCode:t.statusCode})}))},u.get=function(e,t){var r=l(e),n=o.get;u._makeRequest(n,r,e.getURI(),t)},u.post=function(e,t){var r=l(e),n=o.post;u._makeRequest(n,r,e.getURI(),t)},u.del=function(e,t){var r=l(e),n=o.del;u._makeRequest(n,r,e.getURI(),t)},u.put=function(e,t){var r=l(e),n=o.put;u._makeRequest(n,r,e.getURI(),t)},e.exports=u},936:e=>{class t extends Error{get name(){return this.constructor.name}}class r extends t{constructor(e,t,r,o){super(o),this.body=e,this.headers=t,this.statusCode=r}}e.exports={WebapiError:r,TimeoutError:class extends t{constructor(){super("A timeout occurred while communicating with Spotify's Web API.")}},WebapiRegularError:class extends r{constructor(e,t,r){super(e,t,r,"An error occurred while communicating with Spotify's Web API.\nDetails: "+e.error.message+".")}},WebapiAuthenticationError:class extends r{constructor(e,t,r){super(e,t,r,"An authentication error occurred while communicating with Spotify's Web API.\nDetails: "+e.error+(e.error_description?" "+e.error_description+".":"."))}},WebapiPlayerError:class extends r{constructor(e,t,r){super(e,t,r,"An error occurred while communicating with Spotify's Web API.\nDetails: "+e.error.message+(e.error.reason?" "+e.error.reason+".":"."))}}}},646:(e,t,r)=>{"use strict";r(392);var o=r(300),n=r(749);function i(e){this._credentials=e||{}}i.prototype={setCredentials:function(e){for(var t in e)e.hasOwnProperty(t)&&(this._credentials[t]=e[t])},getCredentials:function(){return this._credentials},resetCredentials:function(){this._credentials=null},setClientId:function(e){this._setCredential("clientId",e)},setClientSecret:function(e){this._setCredential("clientSecret",e)},setAccessToken:function(e){this._setCredential("accessToken",e)},setRefreshToken:function(e){this._setCredential("refreshToken",e)},setRedirectURI:function(e){this._setCredential("redirectUri",e)},getRedirectURI:function(){return this._getCredential("redirectUri")},getClientId:function(){return this._getCredential("clientId")},getClientSecret:function(){return this._getCredential("clientSecret")},getAccessToken:function(){return this._getCredential("accessToken")},getRefreshToken:function(){return this._getCredential("refreshToken")},resetClientId:function(){this._resetCredential("clientId")},resetClientSecret:function(){this._resetCredential("clientSecret")},resetAccessToken:function(){this._resetCredential("accessToken")},resetRefreshToken:function(){this._resetCredential("refreshToken")},resetRedirectURI:function(){this._resetCredential("redirectUri")},_setCredential:function(e,t){this._credentials=this._credentials||{},this._credentials[e]=t},_getCredential:function(e){return this._credentials?this._credentials[e]:void 0},_resetCredential:function(e){this._credentials&&(this._credentials[e]=null)},getTrack:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/tracks/"+e).withQueryParameters(t).build().execute(n.get,r)},getTracks:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/tracks").withQueryParameters({ids:e.join(",")},t).build().execute(n.get,r)},getAlbum:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/albums/"+e).withQueryParameters(t).build().execute(n.get,r)},getAlbums:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/albums").withQueryParameters({ids:e.join(",")},t).build().execute(n.get,r)},getArtist:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/artists/"+e).build().execute(n.get,t)},getArtists:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/artists").withQueryParameters({ids:e.join(",")}).build().execute(n.get,t)},search:function(e,t,r,i){return o.builder(this.getAccessToken()).withPath("/v1/search/").withQueryParameters({type:t.join(","),q:e},r).build().execute(n.get,i)},searchAlbums:function(e,t,r){return this.search(e,["album"],t,r)},searchArtists:function(e,t,r){return this.search(e,["artist"],t,r)},searchTracks:function(e,t,r){return this.search(e,["track"],t,r)},searchPlaylists:function(e,t,r){return this.search(e,["playlist"],t,r)},getArtistAlbums:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/artists/"+e+"/albums").withQueryParameters(t).build().execute(n.get,r)},getAlbumTracks:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/albums/"+e+"/tracks").withQueryParameters(t).build().execute(n.get,r)},getArtistTopTracks:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/artists/"+e+"/top-tracks").withQueryParameters({country:t}).build().execute(n.get,r)},getArtistRelatedArtists:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/artists/"+e+"/related-artists").build().execute(n.get,t)},getUser:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/users/"+encodeURIComponent(e)).build().execute(n.get,t)},getMe:function(e){return o.builder(this.getAccessToken()).withPath("/v1/me").build().execute(n.get,e)},getUserPlaylists:function(e,t,r){var i;return"string"==typeof e?i="/v1/users/"+encodeURIComponent(e)+"/playlists":"object"==typeof e?(r=t,t=e,i="/v1/me/playlists"):i="/v1/me/playlists",o.builder(this.getAccessToken()).withPath(i).withQueryParameters(t).build().execute(n.get,r)},getPlaylist:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e).withQueryParameters(t).build().execute(n.get,r)},getPlaylistTracks:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e+"/tracks").withQueryParameters(t).build().execute(n.get,r)},createPlaylist:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/me/playlists").withHeaders({"Content-Type":"application/json"}).withBodyParameters({name:e},t).build().execute(n.post,r)},followPlaylist:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e+"/followers").withHeaders({"Content-Type":"application/json"}).withBodyParameters(t).build().execute(n.put,r)},unfollowPlaylist:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e+"/followers").build().execute(n.del,t)},changePlaylistDetails:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e).withHeaders({"Content-Type":"application/json"}).withBodyParameters(t).build().execute(n.put,r)},uploadCustomPlaylistCoverImage:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e+"/images").withHeaders({"Content-Type":"image/jpeg"}).withBodyParameters(t).build().execute(n.put,r)},addTracksToPlaylist:function(e,t,r,i){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e+"/tracks").withHeaders({"Content-Type":"application/json"}).withQueryParameters(r).withBodyParameters({uris:t}).build().execute(n.post,i)},removeTracksFromPlaylist:function(e,t,r,i){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e+"/tracks").withHeaders({"Content-Type":"application/json"}).withBodyParameters({tracks:t},r).build().execute(n.del,i)},removeTracksFromPlaylistByPosition:function(e,t,r,i){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e+"/tracks").withHeaders({"Content-Type":"application/json"}).withBodyParameters({positions:t,snapshot_id:r}).build().execute(n.del,i)},replaceTracksInPlaylist:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e+"/tracks").withHeaders({"Content-Type":"application/json"}).withBodyParameters({uris:t}).build().execute(n.put,r)},reorderTracksInPlaylist:function(e,t,r,i,s){return o.builder(this.getAccessToken()).withPath("/v1/playlists/"+e+"/tracks").withHeaders({"Content-Type":"application/json"}).withBodyParameters({range_start:t,insert_before:r},i).build().execute(n.put,s)},getAudioFeaturesForTrack:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/audio-features/"+e).build().execute(n.get,t)},getAudioAnalysisForTrack:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/audio-analysis/"+e).build().execute(n.get,t)},getAudioFeaturesForTracks:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/audio-features").withQueryParameters({ids:e.join(",")}).build().execute(n.get,t)},getRecommendations:function(e,t){var r={},i=["seed_artists","seed_genres","seed_tracks"];for(var s in e)e.hasOwnProperty(s)&&(-1!==i.indexOf(s)&&"[object Array]"===Object.prototype.toString.call(e[s])?r[s]=e[s].join(","):r[s]=e[s]);return o.builder(this.getAccessToken()).withPath("/v1/recommendations").withQueryParameters(r).build().execute(n.get,t)},getAvailableGenreSeeds:function(e){return o.builder(this.getAccessToken()).withPath("/v1/recommendations/available-genre-seeds").build().execute(n.get,e)},getMySavedTracks:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/tracks").withQueryParameters(e).build().execute(n.get,t)},containsMySavedTracks:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/tracks/contains").withQueryParameters({ids:e.join(",")}).build().execute(n.get,t)},removeFromMySavedTracks:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/tracks").withHeaders({"Content-Type":"application/json"}).withBodyParameters({ids:e}).build().execute(n.del,t)},addToMySavedTracks:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/tracks").withHeaders({"Content-Type":"application/json"}).withBodyParameters({ids:e}).build().execute(n.put,t)},removeFromMySavedAlbums:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/albums").withHeaders({"Content-Type":"application/json"}).withBodyParameters(e).build().execute(n.del,t)},addToMySavedAlbums:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/albums").withHeaders({"Content-Type":"application/json"}).withBodyParameters(e).build().execute(n.put,t)},getMySavedAlbums:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/albums").withQueryParameters(e).build().execute(n.get,t)},containsMySavedAlbums:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/albums/contains").withQueryParameters({ids:e.join(",")}).build().execute(n.get,t)},getMyTopArtists:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/top/artists").withQueryParameters(e).build().execute(n.get,t)},getMyTopTracks:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/top/tracks").withQueryParameters(e).build().execute(n.get,t)},getMyRecentlyPlayedTracks:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/player/recently-played").withQueryParameters(e).build().execute(n.get,t)},addToQueue:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/me/player/queue").withQueryParameters({uri:e},t).build().execute(n.post,r)},getMyDevices:function(e){return o.builder(this.getAccessToken()).withPath("/v1/me/player/devices").build().execute(n.get,e)},getMyCurrentPlayingTrack:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/player/currently-playing").withQueryParameters(e).build().execute(n.get,t)},getMyCurrentPlaybackState:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/player").withQueryParameters(e).build().execute(n.get,t)},transferMyPlayback:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/me/player").withHeaders({"Content-Type":"application/json"}).withBodyParameters({device_ids:e},t).build().execute(n.put,r)},play:function(e,t){var r=e||{},i=r.device_id?{device_id:r.device_id}:null,s={};return["context_uri","uris","offset","position_ms"].forEach((function(e){e in r&&(s[e]=r[e])})),o.builder(this.getAccessToken()).withPath("/v1/me/player/play").withQueryParameters(i).withHeaders({"Content-Type":"application/json"}).withBodyParameters(s).build().execute(n.put,t)},pause:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/player/pause").withQueryParameters(e&&e.device_id?{device_id:e.device_id}:null).withHeaders({"Content-Type":"application/json"}).build().execute(n.put,t)},skipToPrevious:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/player/previous").withQueryParameters(e&&e.device_id?{device_id:e.device_id}:null).build().execute(n.post,t)},skipToNext:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/player/next").withQueryParameters(e&&e.device_id?{device_id:e.device_id}:null).build().execute(n.post,t)},seek:function(e,t,r){var i={position_ms:e};return t&&"device_id"in t&&(i.device_id=t.device_id),o.builder(this.getAccessToken()).withPath("/v1/me/player/seek").withQueryParameters(i).build().execute(n.put,r)},setRepeat:function(e,t,r){var i={state:e};return t&&"device_id"in t&&(i.device_id=t.device_id),o.builder(this.getAccessToken()).withPath("/v1/me/player/repeat").withQueryParameters(i).build().execute(n.put,r)},setShuffle:function(e,t,r){var i={state:e};return t&&"device_id"in t&&(i.device_id=t.device_id),o.builder(this.getAccessToken()).withPath("/v1/me/player/shuffle").withQueryParameters(i).build().execute(n.put,r)},setVolume:function(e,t,r){var i={volume_percent:e};return t&&"device_id"in t&&(i.device_id=t.device_id),o.builder(this.getAccessToken()).withPath("/v1/me/player/volume").withQueryParameters(i).build().execute(n.put,r)},followUsers:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/following").withQueryParameters({ids:e.join(","),type:"user"}).build().execute(n.put,t)},followArtists:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/following").withQueryParameters({ids:e.join(","),type:"artist"}).build().execute(n.put,t)},unfollowUsers:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/following").withQueryParameters({ids:e.join(","),type:"user"}).build().execute(n.del,t)},unfollowArtists:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/following").withQueryParameters({ids:e.join(","),type:"artist"}).build().execute(n.del,t)},isFollowingUsers:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/following/contains").withQueryParameters({ids:e.join(","),type:"user"}).build().execute(n.get,t)},getFollowedArtists:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/following").withQueryParameters({type:"artist"},e).build().execute(n.get,t)},areFollowingPlaylist:function(e,t,r,i){return o.builder(this.getAccessToken()).withPath("/v1/users/"+encodeURIComponent(e)+"/playlists/"+t+"/followers/contains").withQueryParameters({ids:r.join(",")}).build().execute(n.get,i)},isFollowingArtists:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/following/contains").withQueryParameters({ids:e.join(","),type:"artist"}).build().execute(n.get,t)},getNewReleases:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/browse/new-releases").withQueryParameters(e).build().execute(n.get,t)},getFeaturedPlaylists:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/browse/featured-playlists").withQueryParameters(e).build().execute(n.get,t)},getCategories:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/browse/categories").withQueryParameters(e).build().execute(n.get,t)},getCategory:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/browse/categories/"+e).withQueryParameters(t).build().execute(n.get,r)},getPlaylistsForCategory:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/browse/categories/"+e+"/playlists").withQueryParameters(t).build().execute(n.get,r)},getShow:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/shows/"+e).withQueryParameters(t).build().execute(n.get,r)},getShows:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/shows").withQueryParameters({ids:e.join(",")},t).build().execute(n.get,r)},containsMySavedShows:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/shows/contains").withQueryParameters({ids:e.join(",")}).build().execute(n.get,t)},removeFromMySavedShows:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/shows").withHeaders({"Content-Type":"application/json"}).withBodyParameters(e).build().execute(n.del,t)},addToMySavedShows:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/shows").withHeaders({"Content-Type":"application/json"}).withBodyParameters(e).build().execute(n.put,t)},getMySavedShows:function(e,t){return o.builder(this.getAccessToken()).withPath("/v1/me/shows").withQueryParameters(e).build().execute(n.get,t)},getShowEpisodes:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/shows/"+e+"/episodes").withQueryParameters(t).build().execute(n.get,r)},searchShows:function(e,t,r){return this.search(e,["show"],t,r)},searchEpisodes:function(e,t,r){return this.search(e,["episode"],t,r)},getEpisode:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/episodes/"+e).withQueryParameters(t).build().execute(n.get,r)},getEpisodes:function(e,t,r){return o.builder(this.getAccessToken()).withPath("/v1/episodes").withQueryParameters({ids:e.join(",")},t).build().execute(n.get,r)}},i._addMethods=function(e){for(var t in e)e.hasOwnProperty(t)&&(this.prototype[t]=e[t])},e.exports=i},300:(e,t,r)=>{"use strict";var o=r(528);e.exports.builder=function(e){return o.builder().withHost("api.spotify.com").withPort(443).withScheme("https").withAuth(e)}},903:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function r(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(e){r.prototype[e]=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return this._defaults.push({fn:e,args:r}),this}})),r.prototype._setDefaults=function(e){this._defaults.forEach((function(r){var o;e[r.fn].apply(e,function(e){if(Array.isArray(e))return t(e)}(o=r.args)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(o)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,r):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}))},e.exports=r},569:(e,t,r)=>{"use strict";function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var n;"undefined"!=typeof window?n=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),n=void 0):n=self;var i=r(767),s=r(445),a=r(129),c=r(899),u=r(960),l=r(97),p=r(903);function f(){}e.exports=function(e,r){return"function"==typeof r?new t.Request("GET",e).end(r):1===arguments.length?new t.Request("GET",e):new t.Request(e,r)};var y=t=e.exports;t.Request=w,y.getXHR=function(){if(n.XMLHttpRequest&&(!n.location||"file:"!==n.location.protocol||!n.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw new Error("Browser-only version of superagent could not find XHR")};var d="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function h(e){if(!u(e))return e;var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&m(t,r,e[r]);return t.join("&")}function m(e,t,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach((function(r){m(e,t,r)}));else if(u(r))for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&m(e,"".concat(t,"[").concat(o,"]"),r[o]);else e.push(encodeURI(t)+"="+encodeURIComponent(r));else e.push(encodeURI(t))}function g(e){for(var t,r,o={},n=e.split("&"),i=0,s=n.length;i<s;++i)-1===(r=(t=n[i]).indexOf("="))?o[decodeURIComponent(t)]="":o[decodeURIComponent(t.slice(0,r))]=decodeURIComponent(t.slice(r+1));return o}function b(e){return/[/+]json($|[^-\w])/i.test(e)}function v(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){for(var t,r,o,n,i=e.split(/\r?\n/),s={},a=0,c=i.length;a<c;++a)-1!==(t=(r=i[a]).indexOf(":"))&&(o=r.slice(0,t).toLowerCase(),n=d(r.slice(t+1)),s[o]=n);return s}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function w(e,t){var r=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(function(){var e,t=null,o=null;try{o=new v(r)}catch(e){return(t=new Error("Parser is unable to parse the response")).parse=!0,t.original=e,r.xhr?(t.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,t.status=r.xhr.status?r.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),r.callback(t)}r.emit("response",o);try{r._isResponseOK(o)||(e=new Error(o.statusText||o.text||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=o,e.status=o.status,r.callback(e,o)):r.callback(null,o)}))}function P(e,t,r){var o=y("DELETE",e);return"function"==typeof t&&(r=t,t=null),t&&o.send(t),r&&o.end(r),o}y.serializeObject=h,y.parseString=g,y.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},y.serialize={"application/x-www-form-urlencoded":a.stringify,"application/json":s},y.parse={"application/x-www-form-urlencoded":g,"application/json":JSON.parse},l(v.prototype),v.prototype._parseBody=function(e){var t=y.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&b(this.type)&&(t=y.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},v.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,o="cannot ".concat(t," ").concat(r," (").concat(this.status,")"),n=new Error(o);return n.status=this.status,n.method=t,n.url=r,n},y.Response=v,i(w.prototype),c(w.prototype),w.prototype.type=function(e){return this.set("Content-Type",y.types[e]||e),this},w.prototype.accept=function(e){return this.set("Accept",y.types[e]||e),this},w.prototype.auth=function(e,t,r){1===arguments.length&&(t=""),"object"===o(t)&&null!==t&&(r=t,t=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var n=function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,r,n)},w.prototype.query=function(e){return"string"!=typeof e&&(e=h(e)),e&&this._query.push(e),this},w.prototype.attach=function(e,t,r){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,r||t.name)}return this},w.prototype._getFormData=function(){return this._formData||(this._formData=new n.FormData),this._formData},w.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var r=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),r(e,t)},w.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},w.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},w.prototype.ca=w.prototype.agent,w.prototype.buffer=w.prototype.ca,w.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},w.prototype.pipe=w.prototype.write,w.prototype._isHost=function(e){return e&&"object"===o(e)&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},w.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||f,this._finalizeQueryString(),this._end()},w.prototype._setUploadTimeout=function(){var e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},w.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var e=this;this.xhr=y.getXHR();var t=this.xhr,r=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var r=t.readyState;if(r>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4===r){var o;try{o=t.status}catch(e){o=0}if(!o){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var o=function(t,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(e._uploadTimeoutTimer)),r.direction=t,e.emit("progress",r)};if(this.hasListeners("progress"))try{t.addEventListener("progress",o.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",o.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var n=this._header["content-type"],i=this._serializer||y.serialize[n?n.split(";")[0]:""];!i&&b(n)&&(i=y.serialize["application/json"]),i&&(r=i(r))}for(var s in this.header)null!==this.header[s]&&Object.prototype.hasOwnProperty.call(this.header,s)&&t.setRequestHeader(s,this.header[s]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===r?null:r)},y.agent=function(){return new p},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(e){p.prototype[e.toLowerCase()]=function(t,r){var o=new y.Request(e,t);return this._setDefaults(o),r&&o.end(r),o}})),p.prototype.del=p.prototype.delete,y.get=function(e,t,r){var o=y("GET",e);return"function"==typeof t&&(r=t,t=null),t&&o.query(t),r&&o.end(r),o},y.head=function(e,t,r){var o=y("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&o.query(t),r&&o.end(r),o},y.options=function(e,t,r){var o=y("OPTIONS",e);return"function"==typeof t&&(r=t,t=null),t&&o.send(t),r&&o.end(r),o},y.del=P,y.delete=P,y.patch=function(e,t,r){var o=y("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&o.send(t),r&&o.end(r),o},y.post=function(e,t,r){var o=y("POST",e);return"function"==typeof t&&(r=t,t=null),t&&o.send(t),r&&o.end(r),o},y.put=function(e,t,r){var o=y("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&o.send(t),r&&o.end(r),o}},960:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.exports=function(e){return null!==e&&"object"===t(e)}},899:(e,t,r)=>{"use strict";function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var n=r(960);function i(e){if(e)return function(e){for(var t in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,t)&&(e[t]=i.prototype[t]);return e}(e)}e.exports=i,i.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},i.prototype.parse=function(e){return this._parser=e,this},i.prototype.responseType=function(e){return this._responseType=e,this},i.prototype.serialize=function(e){return this._serializer=e,this},i.prototype.timeout=function(e){if(!e||"object"!==o(e))return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},i.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var s=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),a=new Set([408,413,429,500,502,503,504,521,522,524]);i.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(e,t);if(!0===r)return!0;if(!1===r)return!1}catch(e){console.error(e)}if(t&&t.status&&a.has(t.status))return!0;if(e){if(e.code&&s.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},i.prototype.then=function(e,t){var r=this;if(!this._fullfilledPromise){var o=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(e,t){o.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)t(r.timedoutError);else{var e=new Error("Aborted");e.code="ABORTED",e.status=r.status,e.method=r.method,e.url=r.url,t(e)}})),o.end((function(r,o){r?t(r):e(o)}))}))}return this._fullfilledPromise.then(e,t)},i.prototype.catch=function(e){return this.then(void 0,e)},i.prototype.use=function(e){return e(this),this},i.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},i.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},i.prototype.get=function(e){return this._header[e.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(e,t){if(n(e)){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},i.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},i.prototype.field=function(e,t){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(n(e)){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.field(r,e[r]);return this}if(Array.isArray(t)){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&this.field(e,t[o]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),this._getFormData().append(e,t),this},i.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},i.prototype._auth=function(e,t,r,o){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(o("".concat(e,":").concat(t))));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer ".concat(e))}return this},i.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},i.prototype.redirects=function(e){return this._maxRedirects=e,this},i.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(e){var t=n(e),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&n(this._data))for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(this._data[o]=e[o]);else"string"==typeof e?(r||this.type("form"),(r=this._header["content-type"])&&(r=r.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(e):e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||r||this.type("json"),this},i.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},i.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var r=this.url.slice(t+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,t)+"?"+r.join("&")}}},i.prototype._appendQueryString=function(){console.warn("Unsupported")},i.prototype._timeoutError=function(e,t,r){if(!this._aborted){var o=new Error("".concat(e+t,"ms exceeded"));o.timeout=t,o.code="ECONNABORTED",o.errno=r,this.timedout=!0,this.timedoutError=o,this.abort(),this.callback(o)}},i.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},97:(e,t,r)=>{"use strict";var o=r(506);function n(e){if(e)return function(e){for(var t in n.prototype)Object.prototype.hasOwnProperty.call(n.prototype,t)&&(e[t]=n.prototype[t]);return e}(e)}e.exports=n,n.prototype.get=function(e){return this.header[e.toLowerCase()]},n.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=o.type(t);var r=o.params(t);for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(this[n]=r[n]);this.links={};try{e.link&&(this.links=o.parseLinks(e.link))}catch(e){}},n.prototype._setStatusProperties=function(e){var t=e/100|0;this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e}},506:(e,t)=>{"use strict";function r(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){var t,o={},n=r(e.split(/ *; */));try{for(n.s();!(t=n.n()).done;){var i=t.value.split(/ *= */),s=i.shift(),a=i.shift();s&&a&&(o[s]=a)}}catch(e){n.e(e)}finally{n.f()}return o},t.parseLinks=function(e){var t,o={},n=r(e.split(/ *, */));try{for(n.s();!(t=n.n()).done;){var i=t.value.split(/ *; */),s=i[0].slice(1,-1);o[i[1].split(/ *= */)[1].slice(1,-1)]=s}}catch(e){n.e(e)}finally{n.f()}return o},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},654:()=>{}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,r),i.exports}(()=>{let e=r(539),t=r(7),o=new e({clientId:sessionStorage.clientId,clientSecret:sessionStorage.clientSecret});o.setAccessToken(sessionStorage.accessToken),document.getElementById("album").value=localStorage.slinktoolAlbum,document.getElementById("songs").value=localStorage.slinktoolTracks,document.getElementById("numberOfTracks").innerHTML=localStorage.slinktoolNumberOfTracks,document.getElementById("playTime").innerHTML=localStorage.slinktoolPlayTime;let n=0;function s(e){var t=(e=(e-e%1e3)/1e3)%60;return(e-t)/60+":"+t.toLocaleString(void 0,{minimumIntegerDigits:2})}function a(){connection.send("7")}function c(){localStorage.slinktoolTracks=document.getElementById("songs").value,localStorage.slinktoolNumberOfTracks=document.getElementById("numberOfTracks").innerHTML,localStorage.slinktoolPlayTime=document.getElementById("playTime").innerHTML}function u(){connection.send("0"+document.getElementById("album").value),setTimeout((function(){connection.send("1"+document.getElementById("songs").value)}),500),setTimeout((function(){connection.send("2"+localStorage.albumTimes),console.log("Sent Album, tracks and track duration.")}),1500)}connection=new t(wsUri,["arduino"]),connection.onopen=function(){connection.send("Connect "+new Date)},connection.onerror=function(e){console.log("WebSocket Error ",e)},connection.onmessage=function(e){!function(e){let t=e.split(":")[0],r=e.split(":")[1];switch(t){case"p":console.log("spotify.play"),o.play({context_uri:document.getElementById("spoturi").value,offset:{position:0},position_ms:0}).then((function(){console.log("Spotify Play requested -------")}),(function(e){console.log("Something went wrong!",e)}));break;case"t":sessionStorage.accessToken=r,o.setAccessToken(sessionStorage.accessToken),console.log("Got access token"),o.getMyCurrentPlayingTrack().then((function(e){localStorage.albumTimes="",document.getElementById("songs").value="","playlist"===e.body.context.type?(document.getElementById("spoturi").value=e.body.context.uri,spotifyURI=document.getElementById("spoturi").value.split(":")[document.getElementById("spoturi").value.split(":").length-1],o.getPlaylist(spotifyURI,{limit:100,offset:0}).then((function(e){var t=0,r=0,o=(60*document.querySelector('input[name="mdLen"]:checked').value+59)*document.querySelector('input[name="mdLP"]:checked').value*1e3;for(document.getElementById("album").value=e.body.name,localStorage.slinktoolAlbum=document.getElementById("album").value,document.getElementById("imageUrl").src=e.body.images[0].url,(r=e.body.tracks.total)>100&&(r=100),i=0;i<r;i++)if(document.getElementById("songs").value+=e.body.tracks.items[i].track.name,1==document.querySelector('input[name="mdLP"]:checked').value&&(document.getElementById("songs").value+=" - "+e.body.tracks.items[i].track.artists[0].name),document.getElementById("songs").value+="\n",t+=e.body.tracks.items[i].track.duration_ms,localStorage.albumTimes+=e.body.tracks.items[i].track.duration_ms.toString()+";",t>o){r=i+1;break}document.getElementById("playTime").innerHTML=s(t),document.getElementById("numberOfTracks").innerHTML=r,c()}),(function(e){console.error(e)}))):(document.getElementById("spoturi").value=e.body.item.album.uri,spotifyURI=document.getElementById("spoturi").value.split(":")[document.getElementById("spoturi").value.split(":").length-1],o.getAlbum(spotifyURI,{limit:50,offset:0}).then((function(e){var t=0,r=0,o=(60*document.querySelector('input[name="mdLen"]:checked').value+59)*document.querySelector('input[name="mdLP"]:checked').value*1e3;for(document.getElementById("album").value=e.body.artists[0].name+" - "+e.body.name,localStorage.slinktoolAlbum=document.getElementById("album").value,document.getElementById("imageUrl").src=e.body.images[0].url,r=e.body.total_tracks,i=0;i<r;i++)if(document.getElementById("songs").value+=e.body.tracks.items[i].name+"\n",t+=e.body.tracks.items[i].duration_ms,localStorage.albumTimes+=e.body.tracks.items[i].duration_ms.toString()+";",t>o){r=i+1;break}document.getElementById("playTime").innerHTML=s(t),document.getElementById("numberOfTracks").innerHTML=r,c()}),(function(e){console.error(e)}))),u()}),(function(e){console.log("Something went wrong!",e)}));break;case"m":switch(n){case 1:connection.send("3"),n=0;break;case 2:connection.send("4"),n=0}break;default:console.log("handleRequest function: Default")}}(e.data)},connection.reconnectInterval=2e3,document.getElementById("writeTocMd").addEventListener("click",(function(){""!==document.getElementById("album").value&&""!==document.getElementById("songs").value&&(n=2,u())}),!1),document.getElementById("recordSpotify").addEventListener("click",(function(){n=1,a()}),!1),document.getElementById("populateToc").addEventListener("click",a,!1),document.getElementById("clearToc").addEventListener("click",(function(){document.getElementById("album").value="",document.getElementById("songs").value="",localStorage.slinktoolAlbum="",localStorage.slinktoolTracks="",document.getElementById("playTime").innerHTML="",localStorage.slinktoolPlayTime=document.getElementById("playTime").innerHTML,document.getElementById("numberOfTracks").innerHTML="",localStorage.slinktoolNumberOfTracks=document.getElementById("numberOfTracks").innerHTML,console.log("TOC cleared")}),!1)})()})(); </script></div><div class="graphics"> <b>Album/Playlist image: </b><br><img id="imageUrl" src=""> <div class=bottomleft> <b>© foogadgets 2021</b> </div></div> </body></html>)rawliteral";
static const char login_template[] PROGMEM = R"rawliteral(<!DOCTYPE html><html> <head> <title>foogadgets SLink tool</title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible"> <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" /> <style>* { box-sizing: border-box;}body { /*margin: 0;*/}.content { height: 100%; width: 490px; position: fixed; z-index: 1; padding-left: 5px; top: 0; left: 0; overflow-x: hidden;}.albuminfo { margin-left: 16px;}.graphics { margin-left: 490px; padding-top: 60px; padding-left: 10px;}.graphics img { width:400px; height:400px;}.bottomleft { position: absolute; bottom: 5px; right: 16px;} </style> </head> <body> <b>Client ID</b><input type="text" id="clid" size="34"><br> <b>Client Secret</b><input type="text" id="clse" size="34"><br> <button type=button id="loginButton">Login</button> <br> <br><label id="redirectUrl"></label> <br> <div class=bottomleft> <b>© foogadgets 2021</b> </div> <script>var wsUri = 'ws://' + location.hostname + ':81/';connection = new WebSocket(wsUri, ['arduino']);connection.onopen = function () { connection.send('Connect ' + new Date());};connection.onerror = function (error) { console.log('WebSocket Error ', error);};connection.onmessage = function (e) { var state = e.data.split(':')[0]; var payload = e.data.split(':')[1]; switch(state) { case 'r': sessionStorage.refreshToken = payload; break; case 't': sessionStorage.accessToken = payload; break; default: console.log('handleRequest function: Default'); }};document.getElementById('clid').value = localStorage.clientID;document.getElementById('clse').value = localStorage.clientSecret;function registerCredentials(){ localStorage.clientID = document.getElementById('clid').value; localStorage.clientSecret = document.getElementById('clse').value; connection.send('5' + document.getElementById('clid').value); connection.send('6' + document.getElementById('clse').value); const myUrl = new URL("https://accounts.spotify.com/authorize"); myUrl.searchParams.append("response_type", "code"); myUrl.searchParams.append("client_id", document.getElementById('clid').value); myUrl.searchParams.append("redirect_uri", "http://slinktool.local/callback"); myUrl.searchParams.append("scope", "user-read-playback-state user-modify-playback-state"); document.getElementById('redirectUrl').innerHTML = '<a href="' + myUrl + '">Spotify Login</a>';};document.getElementById("loginButton").addEventListener("click", registerCredentials, false); </script> </body></html>)rawliteral";
static const char login_next[] PROGMEM = R"rawliteral(<!doctype html><html lang=en> <head> <title>foogadgets SLink tool</title> </head> <body> <a href="http://slinktool.local">http://slinktool.local</a> </body></html>)rawliteral";