diff --git a/discord.indev.js b/discord.indev.js index cfec028a..28cd8b5c 100644 --- a/discord.indev.js +++ b/discord.indev.js @@ -8756,8 +8756,8 @@ class DMChannel extends Channel { } // These are here only for documentation purposes - they are implemented by TextBasedChannel + send() { return; } sendMessage() { return; } - sendTTSMessage() { return; } sendEmbed() { return; } sendFile() { return; } sendCode() { return; } @@ -8906,8 +8906,8 @@ class GroupDMChannel extends Channel { } // These are here only for documentation purposes - they are implemented by TextBasedChannel + send() { return; } sendMessage() { return; } - sendTTSMessage() { return; } sendEmbed() { return; } sendFile() { return; } sendCode() { return; } diff --git a/discord.indev.min.js b/discord.indev.min.js index 3954014f..b03686af 100644 --- a/discord.indev.min.js +++ b/discord.indev.min.js @@ -9,10 +9,10 @@ ${e} * @author Feross Aboukhadijeh * @license MIT */ -var J=n(63),X=n(65),Q=n(66);e.Buffer=o,e.SlowBuffer=g,e.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),e.kMaxLength=s(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,n){return a(null,t,e,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,n){return u(null,t,e,n)},o.allocUnsafe=function(t){return c(null,t)},o.allocUnsafeSlow=function(t){return c(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,s=0,r=Math.min(n,i);s0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},o.prototype.compare=function(t,e,n,i,s){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),e<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=n)return 0;if(i>=s)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,s>>>=0,this===t)return 0;for(var r=s-i,a=n-e,h=Math.min(r,a),u=this.slice(i,s),c=t.slice(e,n),l=0;ls)&&(n=s),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return A(this,t,e,n);case"ascii":return k(this,t,e,n);case"latin1":case"binary":return R(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,e,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;o.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e0&&(s*=256);)i+=this[t+--e]*s;return i},o.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var i=this[t],s=1,r=0;++r=s&&(i-=Math.pow(2,8*e)),i},o.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var i=e,s=1,r=this[t+--i];i>0&&(s*=256);)r+=this[t+--i]*s;return s*=128,r>=s&&(r-=Math.pow(2,8*e)),r},o.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},o.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),X.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),X.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),X.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),X.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e|=0,n|=0,!i){var s=Math.pow(2,8*n)-1;N(this,t,e,n,s,0)}var r=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+r]=t/o&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var s=Math.pow(2,8*n-1);N(this,t,e,n,s-1,-s)}var r=0,o=1,a=0;for(this[e]=255&t;++r>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var s=Math.pow(2,8*n-1);N(this,t,e,n,s-1,-s)}var r=n-1,o=1,a=0;for(this[e+r]=255&t;--r>=0&&(o*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/o>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,n){return j(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return j(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return q(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return q(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--s)t[s+e]=this[s+n];else if(r<1e3||!o.TYPED_ARRAY_SUPPORT)for(s=0;s>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var r;if("number"==typeof t)for(r=e;r0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),s||(s=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var s=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,s,o,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,s=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(n)){for(a=o;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){s=a;break}if(s<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,n){(function(t){function n(t,e){for(var n=0,i=t.length-1;i>=0;i--){var s=t[i];"."===s?t.splice(i,1):".."===s?(t.splice(i,1),n++):n&&(t.splice(i,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],i=0;i=-1&&!s;r--){var o=r>=0?arguments[r]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,s="/"===o.charAt(0))}return e=n(i(e.split("/"),function(t){return!!t}),!s).join("/"),(s?"/":"")+e||"."},e.normalize=function(t){var s=e.isAbsolute(t),r="/"===o(t,-1);return t=n(i(t.split("/"),function(t){return!!t}),!s).join("/"),t||s||(t="."),t&&r&&(t+="/"),(s?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function i(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var s=i(t.split("/")),r=i(n.split("/")),o=Math.min(s.length,r.length),a=o,h=0;h1)for(var n=1;n=0?"&":"?")+t),this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.substring(e+1).split("&");g(this._sort)?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,e)+"?"+n.join("&")}}},c.prototype._isHost=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},c.prototype.end=function(t){var e=this,n=this.xhr=E.getXHR(),s=this._formData||this._data;this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||i,n.onreadystatechange=function(){var t=n.readyState;if(t>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==t){var i;try{i=n.status}catch(t){i=0}if(!i){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{n.onprogress=r.bind(null,"download"),n.upload&&(n.upload.onprogress=r.bind(null,"upload"))}catch(t){}if(this._appendQueryString(),this._setTimeouts(),this.username&&this.password?n.open(this.method,this.url,!0,this.username,this.password):n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!this._isHost(s)){var o=this._header["content-type"],a=this._serializer||E.serialize[o?o.split(";")[0]:""];!a&&h(o)&&(a=E.serialize["application/json"]),a&&(s=a(s))}for(var u in this.header)null!=this.header[u]&&n.setRequestHeader(u,this.header[u]);return this._responseType&&(n.responseType=this._responseType),this.emit("request",this),n.send("undefined"!=typeof s?s:null),this},E.get=function(t,e,n){var i=E("GET",t);return"function"==typeof e&&(n=e,e=null),e&&i.query(e),n&&i.end(n),i},E.head=function(t,e,n){var i=E("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},E.options=function(t,e,n){var i=E("OPTIONS",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},E.del=l,E.delete=l,E.patch=function(t,e,n){var i=E("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},E.post=function(t,e,n){var i=E("POST",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},E.put=function(t,e,n){var i=E("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i}},function(t,e){function n(t){return null!==t&&"object"==typeof t}t.exports=n},function(t,e){t.exports={name:"discord.js",version:"10.0.1",description:"A powerful library for interacting with the Discord API",main:"./src/index",types:"./typings/index.d.ts",scripts:{test:"eslint src && docgen --source src --custom docs/index.yml",docs:"docgen --source src --custom docs/index.yml --output docs/docs.json","test-docs":"docgen --source src --custom docs",lint:"eslint src","web-dist":"node ./node_modules/parallel-webpack/bin/run.js"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",runkitExampleFilename:"./docs/examples/ping.js",dependencies:{"@types/node":"^6.0.0",pako:"^1.0.0",superagent:"^3.3.0",tweetnacl:"^0.14.0",ws:"^1.1.0"},peerDependencies:{erlpack:"hammerandchisel/erlpack#master","node-opus":"^0.2.0",opusscript:"^0.0.1",uws:"^0.12.0"},devDependencies:{"discord.js-docgen":"hydrabolt/discord.js-docgen#master",eslint:"^3.12.0","parallel-webpack":"^1.6.0","uglify-js":"mishoo/UglifyJS2#harmony",webpack:"2.2.0-rc.3"},engines:{node:">=6.0.0"},browser:{ws:!1,uws:!1,erlpack:!1,opusscript:!1,"node-opus":!1,"tweet-nacl":!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/player/BasePlayer.js":!1,"src/client/voice/player/DefaultPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(t,e,n){const i=n(6),s=n(37);class r extends s{setup(t){super.setup(t),this.flags=t.flags,this.owner=new i(this.client,t.owner)}}t.exports=r},function(t,e,n){const i=n(6),s=n(3);class r extends i{setup(t){super.setup(t),this.verified=t.verified,this.email=t.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s}edit(t){return this.client.rest.methods.updateCurrentUser(t)}setUsername(t,e){return this.client.rest.methods.updateCurrentUser({username:t},e)}setEmail(t,e){return this.client.rest.methods.updateCurrentUser({email:t},e)}setPassword(t,e){return this.client.rest.methods.updateCurrentUser({password:t},e)}setAvatar(t){return t.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:t}):this.client.resolver.resolveBuffer(t).then(t=>this.client.rest.methods.updateCurrentUser({avatar:t}))}setPresence(t){return new Promise(e=>{let n=this.localPresence.status||this.presence.status,i=this.localPresence.game,s=this.localPresence.afk||this.presence.afk;if(!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url}),t.status){if("string"!=typeof t.status)throw new TypeError("Status must be a string");n=t.status}t.game&&(i=t.game,i.url&&(i.type=1)),"undefined"!=typeof t.afk&&(s=t.afk),s=Boolean(s),this.localPresence={status:n,game:i,afk:s},this.localPresence.since=0,this.localPresence.game=this.localPresence.game||null,this.client.ws.send({op:3,d:this.localPresence}),this.client._setPresence(this.id,this.localPresence),e(this)})}setStatus(t){return this.setPresence({status:t})}setGame(t,e){return this.setPresence({game:{name:t,url:e}})}setAFK(t){return this.setPresence({afk:t})}fetchMentions(t={limit:25,roles:true,everyone:true,guild:null}){return this.client.rest.methods.fetchMentions(t)}addFriend(t){return t=this.client.resolver.resolveUser(t),this.client.rest.methods.addFriend(t)}removeFriend(t){return t=this.client.resolver.resolveUser(t),this.client.rest.methods.removeFriend(t)}createGuild(t,e,n=null){return n?n.startsWith("data:")?this.client.rest.methods.createGuild({name:t,icon:n,region:e}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:t,icon:n,region:e})):this.client.rest.methods.createGuild({name:t,icon:n,region:e})}}t.exports=r},function(t,e,n){const i=n(9),s=n(12),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="dm",this.messages=new r,this._typing=new Map}setup(t){super.setup(t),this.recipient=this.client.dataManager.newUser(t.recipients[0]),this.lastMessageID=t.last_message_id}toString(){return this.recipient.toString()}sendMessage(){}sendTTSMessage(){}sendEmbed(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(9),s=n(12),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="group",this.messages=new r,this._typing=new Map}setup(t){if(super.setup(t),this.name=t.name,this.icon=t.icon,this.ownerID=t.owner_id,this.recipients||(this.recipients=new r),t.recipients)for(const e of t.recipients){const t=this.client.dataManager.newUser(e);this.recipients.set(t.id,t)}this.lastMessageID=t.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(t){const e=t&&this.id===t.id&&this.name===t.name&&this.icon===t.icon&&this.ownerID===t.ownerID; -return e?this.recipients.equals(t.recipients):e}toString(){return this.name}sendMessage(){}sendTTSMessage(){}sendEmbed(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(38),s=n(39),r=n(0);class o{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.setup(e)}setup(t){this.guild=this.client.guilds.get(t.guild.id)||new i(this.client,t.guild),this.code=t.code,this.temporary=t.temporary,this.maxAge=t.max_age,this.uses=t.uses,this.maxUses=t.max_uses,t.inviter&&(this.inviter=this.client.dataManager.newUser(t.inviter)),this.channel=this.client.channels.get(t.channel.id)||new s(this.client,t.channel),this.createdTimestamp=new Date(t.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return r.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}t.exports=o},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.message=t,this.setup(e)}setup(t){this.id=t.id,this.filename=t.filename,this.filesize=t.size,this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}t.exports=n},function(t,e,n){const i=n(21).EventEmitter,s=n(3);class r extends i{constructor(t,e,n={}){super(),this.channel=t,this.filter=e,this.options=n,this.ended=!1,this.collected=new s,this.listener=(t=>this.verify(t)),this.channel.client.on("message",this.listener),n.time&&this.channel.client.setTimeout(()=>this.stop("time"),n.time)}verify(t){return(!this.channel||this.channel.id===t.channel.id)&&(!!this.filter(t,this)&&(this.collected.set(t.id,t),this.emit("message",t,this),this.collected.size>=this.options.maxMatches?this.stop("matchesLimit"):this.options.max&&this.collected.size===this.options.max&&this.stop("limit"),!0))}get next(){return new Promise((t,e)=>{if(this.ended)return void e(this.collected);const n=()=>{this.removeListener("message",i),this.removeListener("end",s)},i=(...e)=>{n(),t(...e)},s=(...t)=>{n(),e(...t)};this.once("message",i),this.once("end",s)})}stop(t="user"){this.ended||(this.ended=!0,this.channel.client.removeListener("message",this.listener),this.emit("end",this.collected,t))}}t.exports=r},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.message=t,this.setup(e)}setup(t){if(this.type=t.type,this.title=t.title,this.description=t.description,this.url=t.url,this.color=t.color,this.fields=[],t.fields)for(const e of t.fields)this.fields.push(new o(this,e));this.createdTimestamp=t.timestamp,this.thumbnail=t.thumbnail?new i(this,t.thumbnail):null,this.author=t.author?new r(this,t.author):null,this.provider=t.provider?new s(this,t.provider):null,this.footer=t.footer?new a(this,t.footer):null}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let t=this.color.toString(16);for(;t.length<6;)t=`0${t}`;return`#${t}`}}class i{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}class s{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.url=t.url}}class r{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.url=t.url,this.iconURL=t.icon_url}}class o{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.value=t.value,this.inline=t.inline}}class a{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.text=t.text,this.iconURL=t.icon_url,this.proxyIconUrl=t.proxy_icon_url}}n.Thumbnail=i,n.Provider=s,n.Author=r,n.Field=o,n.Footer=a,t.exports=n},function(t,e,n){const i=n(3),s=n(10),r=n(18);class o{constructor(t,e,n,s){this.message=t,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,e.name,e.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const t=this.message.client.emojis;if(t.has(this._emoji.id)){const e=t.get(this._emoji.id);return this._emoji=e,e}}return this._emoji}remove(t=this.message.client.user){const e=this.message;return t=this.message.client.resolver.resolveUserID(t),t?e.client.rest.methods.removeMessageReaction(e,this.emoji.identifier,t):Promise.reject("Couldn't resolve the user ID to remove from the reaction.")}fetchUsers(t=100){const e=this.message;return e.client.rest.methods.getMessageReactionUsers(e,this.emoji.identifier,t).then(t=>{this.users=new i;for(const e of t){const t=this.message.client.dataManager.newUser(e);this.users.set(t.id,t)}return this.count=this.users.size,t})}}t.exports=o},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.description=t.description,this.icon=t.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=t.rpc_origins}get createdTimestamp(){return this.id/4194304+14200704e5}get createdAt(){return new Date(this.createdTimestamp)}toString(){return this.name}}t.exports=n},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.icon=t.icon,this.splash=t.splash}}t.exports=n},function(t,e,n){const i=n(0);class s{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.type=i.ChannelTypes.text===t.type?"text":"voice"}}t.exports=s},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"channel",{value:t}),e&&this.setup(e)}setup(t){this.id=t.id,this.type=t.type,this.deny=t.deny,this.allow=t.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}t.exports=n},function(t,e,n){const i=n(13),s=n(12),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="text",this.messages=new r,this._typing=new Map}setup(t){super.setup(t),this.topic=t.topic,this.lastMessageID=t.last_message_id}get members(){const t=new r;for(const e of this.guild.members.values())this.permissionsFor(e).hasPermission("READ_MESSAGES")&&t.set(e.id,e);return t}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(t,e){return new Promise(n=>{e.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,t,e)):this.client.resolver.resolveBuffer(e).then(e=>n(this.client.rest.methods.createWebhook(this,t,e)))})}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(13),s=n(3);class r extends i{constructor(t,e){super(t,e),this.members=new s,this.type="voice"}setup(t){super.setup(t),this.bitrate=t.bitrate,this.userLimit=t.user_limit}get connection(){const t=this.guild.voiceConnection;return t&&t.channel.id===this.id?t:null}get joinable(){return!this.client.browser&&this.permissionsFor(this.client.user).hasPermission("CONNECT")}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(t){return this.edit({bitrate:t})}setUserLimit(t){return this.edit({userLimit:t})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const t=this.client.voice.connections.get(this.guild.id);t&&t.channel.id===this.id&&t.disconnect()}}}t.exports=r},function(t,e){t.exports=function(t,{maxLength=1950,char="\n",prepend="",append=""}={}){if(t.length<=maxLength)return t;const e=t.split(char);if(1===e.length)throw new Error("Message exceeds the max length and contains no split characters.");const n=[""];let i=0;for(let s=0;smaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+e[s];return n}},function(t,e,n){"use strict";function i(t,e){if(e<65537&&(t.subarray&&o||!t.subarray&&r))return String.fromCharCode.apply(null,s.shrinkBuf(t,e));for(var n="",i=0;i=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;a[254]=a[254]=1,e.string2buf=function(t){var e,n,i,r,o,a=t.length,h=0;for(r=0;r>>6,e[o++]=128|63&n):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|63&n):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|63&n);return e},e.buf2binstring=function(t){return i(t,t.length)},e.binstring2buf=function(t){for(var e=new s.Buf8(t.length),n=0,i=e.length;n4)u[s++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&n1?u[s++]=65533:r<65536?u[s++]=r:(r-=65536,u[s++]=55296|r>>10&1023,u[s++]=56320|1023&r)}return i(u,s)},e.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return n<0?e:0===n?e:n+a[t[n]]>e?n:e}},function(t,e,n){"use strict";function i(t,e,n,i){for(var s=65535&t|0,r=t>>>16&65535|0,o=0;0!==n;){o=n>2e3?2e3:n,n-=o;do s=s+e[i++]|0,r=r+s|0;while(--o);s%=65521,r%=65521}return s|r<<16|0}t.exports=i},function(t,e,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,n){"use strict";function i(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function s(t,e,n,i){var s=r,o=i+n;t^=-1;for(var a=i;a>>8^s[255&(t^e[a])];return t^-1}var r=i();t.exports=s},function(t,e,n){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=i},function(t,e){},function(t,e,n){(function(e){const i=n(23),s=n(49),r=n(25),o=n(0),a=n(53),h=n(6),u=n(11),c=n(17),l=n(9),d=n(14),f=n(10),p=n(18);class m{constructor(t){this.client=t}resolveUser(t){return t instanceof h?t:"string"==typeof t?this.client.users.get(t)||null:t instanceof d?t.user:t instanceof u?t.author:t instanceof c?t.owner:null}resolveUserID(t){return t instanceof h||t instanceof d?t.id:"string"==typeof t?t||null:t instanceof u?t.author.id:t instanceof c?t.ownerID:null}resolveGuild(t){return t instanceof c?t:"string"==typeof t?this.client.guilds.get(t)||null:null}resolveGuildMember(t,e){return e instanceof d?e:(t=this.resolveGuild(t),e=this.resolveUser(e),t&&e?t.members.get(e.id)||null:null)}resolveChannel(t){return t instanceof l?t:t instanceof u?t.channel:t instanceof c?t.channels.get(t.id)||null:"string"==typeof t?this.client.channels.get(t)||null:null}resolveInviteCode(t){const e=/discord(?:app)?\.(?:gg|com\/invite)\/([a-z0-9]{5})/i,n=e.exec(t);return n&&n[1]?n[1]:t}resolvePermission(t){if("string"==typeof t&&(t=o.PermissionFlags[t]),"number"!=typeof t||t<1)throw new Error(o.Errors.NOT_A_PERMISSION);return t}resolvePermissions(t){let e=0;for(const n of t)e|=this.resolvePermission(n);return e}resolveString(t){return"string"==typeof t?t:t instanceof Array?t.join("\n"):String(t)}resolveBase64(t){return t instanceof e?`data:image/jpg;base64,${t.toString("base64")}`:t}resolveBuffer(t){return t instanceof e?Promise.resolve(t):this.client.browser&&t instanceof ArrayBuffer?Promise.resolve(a(t)):"string"==typeof t?new Promise((n,o)=>{if(/^https?:\/\//.test(t)){const i=r.get(t).set("Content-Type","blob");this.client.browser&&i.responseType("arraybuffer"),i.end((t,i)=>{return t?o(t):this.client.browser?n(a(i.xhr.response)):i.body instanceof e?n(i.body):o(new TypeError("The response body isn't a Buffer."))})}else{const e=i.resolve(t);s.stat(e,(t,i)=>{if(t&&o(t),!i||!i.isFile())throw new Error(`The file could not be found: ${e}`);s.readFile(e,(t,e)=>{t?o(t):n(e)})})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(t){return t instanceof f||t instanceof p?t.identifier:"string"!=typeof t||t.includes("%")?null:encodeURIComponent(t)}}t.exports=m}).call(e,n(20).Buffer)},function(t,e,n){const i=n(114),s=n(111),r=n(113),o=n(112),a=n(110),h=n(0);class u{constructor(t){this.client=t,this.handlers={},this.userAgentManager=new i(this),this.methods=new s(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}push(t,e){return new Promise((n,i)=>{t.push({request:e,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return r;case"burst":return o;default:throw new Error(h.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(t,e,n,i,s){const r=new a(this,t,e,n,i,s);if(!this.handlers[r.route]){const t=this.getRequestHandler();this.handlers[r.route]=new t(this,r.route)}return this.push(this.handlers[r.route],r)}}t.exports=u},function(t,e){class n{constructor(t){this.restManager=t,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(t){this.restManager.globallyRateLimited=t}push(t){this.queue.push(t)}handle(){}}t.exports=n},function(t,e,n){(function(e){function n(t){const n=new e(t.byteLength),i=new Uint8Array(t);for(var s=0;s0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get status(){return this.ws.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get ping(){return this.pings.reduce((t,e)=>t+e,0)/this.pings.length}get voiceConnections(){return this.browser?new Collection:this.voice.connections}get emojis(){const t=new Collection;for(const e of this.guilds.values())for(const n of e.emojis.values())t.set(n.id,n);return t}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}get browser(){return"undefined"!=typeof window}login(t){return this.rest.methods.login(t)}destroy(){for(const t of this._timeouts)clearTimeout(t);for(const e of this._intervals)clearInterval(e);return this._timeouts.clear(),this._intervals.clear(),this.manager.destroy()}syncGuilds(t=this.guilds){this.user.bot||this.ws.send({op:12,d:t instanceof Collection?t.keyArray():t.map(t=>t.id)})}fetchUser(t){return this.users.has(t)?Promise.resolve(this.users.get(t)):this.rest.methods.getUser(t)}fetchInvite(t){const e=this.resolver.resolveInviteCode(t);return this.rest.methods.getInvite(e)}fetchWebhook(t,e){return this.rest.methods.getWebhook(t,e)}sweepMessages(t=this.options.messageCacheLifetime){if("number"!=typeof t||isNaN(t))throw new TypeError("The lifetime must be a number.");if(t<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const e=1e3*t,n=Date.now();let i=0,s=0;for(const r of this.channels.values())if(r.messages){i++;for(const t of r.messages.values())n-(t.editedTimestamp||t.createdTimestamp)>e&&(r.messages.delete(t.id),s++)}return this.emit("debug",`Swept ${s} messages older than ${t} seconds in ${i} text-based channels`),s}fetchApplication(){if(!this.user.bot)throw new Error(Constants.Errors.NO_BOT_ACCOUNT);return this.rest.methods.getMyApplication()}generateInvite(t){return t?t instanceof Array&&(t=this.resolver.resolvePermissions(t)):t=0,this.fetchApplication().then(e=>`https://discordapp.com/oauth2/authorize?client_id=${e.id}&permissions=${t}&scope=bot`)}setTimeout(t,e,...n){const i=setTimeout(()=>{t(),this._timeouts.delete(i)},e,...n);return this._timeouts.add(i),i}clearTimeout(t){clearTimeout(t),this._timeouts.delete(t)}setInterval(t,e,...n){const i=setInterval(t,e,...n);return this._intervals.add(i),i}clearInterval(t){clearInterval(t),this._intervals.delete(t)}_pong(t){this.pings.unshift(Date.now()-t),this.pings.length>3&&(this.pings.length=3),this.ws.lastHeartbeatAck=!0}_setPresence(t,e){return this.presences.get(t)?void this.presences.get(t).update(e):void this.presences.set(t,new Presence(e))}_eval(script){return eval(script)}_validateOptions(t=this.options){if("number"!=typeof t.shardCount||isNaN(t.shardCount))throw new TypeError("The shardCount option must be a number.");if("number"!=typeof t.shardId||isNaN(t.shardId))throw new TypeError("The shardId option must be a number.");if(t.shardCount<0)throw new RangeError("The shardCount option must be at least 0.");if(t.shardId<0)throw new RangeError("The shardId option must be at least 0.");if(0!==t.shardId&&t.shardId>=t.shardCount)throw new RangeError("The shardId option must be less than shardCount.");if("number"!=typeof t.messageCacheMaxSize||isNaN(t.messageCacheMaxSize))throw new TypeError("The messageCacheMaxSize option must be a number.");if("number"!=typeof t.messageCacheLifetime||isNaN(t.messageCacheLifetime))throw new TypeError("The messageCacheLifetime option must be a number.");if("number"!=typeof t.messageSweepInterval||isNaN(t.messageSweepInterval))throw new TypeError("The messageSweepInterval option must be a number.");if("boolean"!=typeof t.fetchAllMembers)throw new TypeError("The fetchAllMembers option must be a boolean.");if("boolean"!=typeof t.disableEveryone)throw new TypeError("The disableEveryone option must be a boolean.");if("number"!=typeof t.restWsBridgeTimeout||isNaN(t.restWsBridgeTimeout))throw new TypeError("The restWsBridgeTimeout option must be a number.");if(!(t.disabledEvents instanceof Array))throw new TypeError("The disabledEvents option must be an Array.")}}module.exports=Client}).call(exports,__webpack_require__(24))},function(t,e,n){const i=n(19),s=n(51),r=n(50),o=n(54),a=n(0);class h extends i{constructor(t,e,n){super(null,t,e),this.options=o(a.DefaultOptions,n),this.rest=new s(this),this.resolver=new r(this)}}t.exports=h},function(t,e,n){t.exports={Client:n(55),WebhookClient:n(56),Shard:n(60),ShardClientUtil:n(61),ShardingManager:n(62),Collection:n(3),splitMessage:n(43),escapeMarkdown:n(15),fetchRecommendedShards:n(59),Channel:n(9),ClientOAuth2Application:n(28),ClientUser:n(29),DMChannel:n(30),Emoji:n(10),EvaluatedPermissions:n(16),Game:n(7).Game,GroupDMChannel:n(31),Guild:n(17),GuildChannel:n(13),GuildMember:n(14),Invite:n(32),Message:n(11),MessageAttachment:n(33),MessageCollector:n(34),MessageEmbed:n(35),MessageReaction:n(36),OAuth2Application:n(37),PartialGuild:n(38),PartialGuildChannel:n(39),PermissionOverwrites:n(40),Presence:n(7).Presence,ReactionEmoji:n(18),RichEmbed:n(58),Role:n(8),TextChannel:n(41),User:n(6),VoiceChannel:n(42),Webhook:n(19),version:n(27).version,Constants:n(0)},"undefined"!=typeof window&&(window.Discord=t.exports)},function(t,e){function n(t){return"string"==typeof t?t:t instanceof Array?t.join("\n"):String(t)}class i{constructor(t={}){this.title=t.title,this.description=t.description,this.url=t.url,this.color=t.color,this.author=t.author,this.timestamp=t.timestamp,this.fields=t.fields||[],this.thumbnail=t.thumbnail,this.image=t.image,this.footer=t.footer}setTitle(t){if(t=n(t),t.length>256)throw new RangeError("RichEmbed titles may not exceed 256 characters.");return this.title=t,this}setDescription(t){if(t=n(t),t.length>2048)throw new RangeError("RichEmbed descriptions may not exceed 2048 characters.");return this.description=t,this}setURL(t){return this.url=t,this}setColor(t){let e=10;if(t instanceof Array?t=(t[0]<<16)+(t[1]<<8)+t[2]:"string"==typeof t&&t.startsWith("#")&&(e=16,t=t.replace("#","")),t=parseInt(t,e),t<0||t>16777215)throw new RangeError("RichEmbed color must be within the range 0 - 16777215 (0xFFFFFF).");if(t&&isNaN(t))throw new TypeError("Unable to convert RichEmbed color to a number.");return this.color=t,this}setAuthor(t,e,i){return this.author={name:n(t),icon_url:e,url:i},this}setTimestamp(t=new Date){return this.timestamp=t,this}addField(t,e,i=false){if(this.fields.length>=25)throw new RangeError("RichEmbeds may not exceed 25 fields.");if(t=n(t),t.length>256)throw new RangeError("RichEmbed field names may not exceed 256 characters.");if(e=n(e),e.length>1024)throw new RangeError("RichEmbed field values may not exceed 1024 characters.");return this.fields.push({name:String(t),value:e,inline:i}),this}setThumbnail(t){return this.thumbnail={url:t},this}setImage(t){return this.image={url:t},this}setFooter(t,e){if(t=n(t),t.length>2048)throw new RangeError("RichEmbed footer text may not exceed 2048 characters.");return this.footer={text:t,icon_url:e},this}}t.exports=i},function(t,e,n){const i=n(25),s=n(0).Endpoints.botGateway;t.exports=function(t){return new Promise((e,n)=>{if(!t)throw new Error("A token must be provided.");i.get(s).set("Authorization",`Bot ${t.replace(/^Bot\s*/i,"")}`).end((t,i)=>{t&&n(t),e(i.body.shards)})})}},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";function i(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function s(t){return 3*t.length/4-i(t)}function r(t){var e,n,s,r,o,a,h=t.length;o=i(t),a=new l(3*h/4-o),s=o>0?h-4:h;var u=0;for(e=0,n=0;e>16&255,a[u++]=r>>8&255,a[u++]=255&r;return 2===o?(r=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,a[u++]=255&r):1===o&&(r=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r),a}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,n){for(var i,s=[],r=e;rc?c:h+o));return 1===i?(e=t[n-1],s+=u[e>>2],s+=u[e<<4&63],s+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],s+=u[e>>10],s+=u[e>>4&63],s+=u[e<<2&63],s+="="),r.push(s),r.join("")}e.byteLength=s,e.toByteArray=r,e.fromByteArray=h;for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,p=d.length;f>1,c=-7,l=n?s-1:0,d=n?-1:1,f=t[e+l];for(l+=d,r=f&(1<<-c)-1,f>>=-c,c+=a;c>0;r=256*r+t[e+l],l+=d,c-=8);for(o=r&(1<<-c)-1,r>>=-c,c+=i;c>0;o=256*o+t[e+l],l+=d,c-=8);if(0===r)r=1-u;else{if(r===h)return o?NaN:(f?-1:1)*(1/0);o+=Math.pow(2,i),r-=u}return(f?-1:1)*o*Math.pow(2,r-i)},e.write=function(t,e,n,i,s,r){var o,a,h,u=8*r-s-1,c=(1<>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:r-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),e+=o+l>=1?d/h:d*Math.pow(2,1-l),e*h>=2&&(o++,h/=2),o+l>=c?(a=0,o=c):o+l>=1?(a=(e*h-1)*Math.pow(2,s),o+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,s),o=0));s>=8;t[n+f]=255&a,f+=p,a/=256,s-=8);for(o=o<0;t[n+f]=255&o,f+=p,o/=256,u-=8);t[n+f-p]|=128*m}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";var i=n(5).assign,s=n(68),r=n(69),o=n(46),a={};i(a,s,r,o),t.exports=a},function(t,e,n){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=h.assign({level:E,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:w,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=a.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==m)throw new Error(c[n]);if(e.header&&a.deflateSetHeader(this.strm,e.header),e.dictionary){var s;if(s="string"==typeof e.dictionary?u.string2buf(e.dictionary):"[object ArrayBuffer]"===d.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=a.deflateSetDictionary(this.strm,s),n!==m)throw new Error(c[n]);this._dict_set=!0}}function s(t,e){var n=new i(e);if(n.push(t,!0),n.err)throw n.msg||c[n.err];return n.result}function r(t,e){return e=e||{},e.raw=!0,s(t,e)}function o(t,e){return e=e||{},e.gzip=!0,s(t,e)}var a=n(70),h=n(5),u=n(44),c=n(22),l=n(48),d=Object.prototype.toString,f=0,p=4,m=0,g=1,_=2,E=-1,w=0,v=8;i.prototype.push=function(t,e){var n,i,s=this.strm,r=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:e===!0?p:f,"string"==typeof t?s.input=u.string2buf(t):"[object ArrayBuffer]"===d.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new h.Buf8(r),s.next_out=0,s.avail_out=r),n=a.deflate(s,i),n!==g&&n!==m)return this.onEnd(n),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||i!==p&&i!==_)||("string"===this.options.to?this.onData(u.buf2binstring(h.shrinkBuf(s.output,s.next_out))):this.onData(h.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&n!==g);return i===p?(n=a.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===m):i!==_||(this.onEnd(m),s.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===m&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=i,e.deflate=s,e.deflateRaw=r,e.gzip=o},function(t,e,n){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=o.inflateInit2(this.strm,e.windowBits);if(n!==u.Z_OK)throw new Error(c[n]);this.header=new d,o.inflateGetHeader(this.strm,this.header)}function s(t,e){var n=new i(e);if(n.push(t,!0),n.err)throw n.msg||c[n.err];return n.result}function r(t,e){return e=e||{},e.raw=!0,s(t,e)}var o=n(73),a=n(5),h=n(44),u=n(46),c=n(22),l=n(48),d=n(71),f=Object.prototype.toString;i.prototype.push=function(t,e){var n,i,s,r,c,l,d=this.strm,p=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof t?d.input=h.binstring2buf(t):"[object ArrayBuffer]"===f.call(t)?d.input=new Uint8Array(t):d.input=t,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new a.Buf8(p),d.next_out=0,d.avail_out=p),n=o.inflate(d,u.Z_NO_FLUSH),n===u.Z_NEED_DICT&&m&&(l="string"==typeof m?h.string2buf(m):"[object ArrayBuffer]"===f.call(m)?new Uint8Array(m):m,n=o.inflateSetDictionary(this.strm,l)),n===u.Z_BUF_ERROR&&g===!0&&(n=u.Z_OK,g=!1),n!==u.Z_STREAM_END&&n!==u.Z_OK)return this.onEnd(n),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&n!==u.Z_STREAM_END&&(0!==d.avail_in||i!==u.Z_FINISH&&i!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(s=h.utf8border(d.output,d.next_out),r=d.next_out-s,c=h.buf2string(d.output,s),d.next_out=r,d.avail_out=p-r,r&&a.arraySet(d.output,d.output,s,r,0),this.onData(c)):this.onData(a.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(g=!0)}while((d.avail_in>0||0===d.avail_out)&&n!==u.Z_STREAM_END);return n===u.Z_STREAM_END&&(i=u.Z_FINISH),i===u.Z_FINISH?(n=o.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u.Z_OK):i!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),d.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=i,e.inflate=s,e.inflateRaw=r,e.ungzip=s; -},function(t,e,n){"use strict";function i(t,e){return t.msg=U[e],e}function s(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function o(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(I.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function a(t,e){C._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,o(t.strm)}function h(t,e){t.pending_buf[t.pending++]=e}function u(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function c(t,e,n,i){var s=t.avail_in;return s>i&&(s=i),0===s?0:(t.avail_in-=s,I.arraySet(e,t.input,t.next_in,s,n),1===t.state.wrap?t.adler=x(t.adler,e,s,n):2===t.state.wrap&&(t.adler=L(t.adler,e,s,n)),t.next_in+=s,t.total_in+=s,s)}function l(t,e){var n,i,s=t.max_chain_length,r=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-lt?t.strstart-(t.w_size-lt):0,u=t.window,c=t.w_mask,l=t.prev,d=t.strstart+ct,f=u[r+o-1],p=u[r+o];t.prev_length>=t.good_match&&(s>>=2),a>t.lookahead&&(a=t.lookahead);do if(n=e,u[n+o]===p&&u[n+o-1]===f&&u[n]===u[r]&&u[++n]===u[r+1]){r+=2,n++;do;while(u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&ro){if(t.match_start=e,o=i,i>=a)break;f=u[r+o-1],p=u[r+o]}}while((e=l[e&c])>h&&0!==--s);return o<=t.lookahead?o:t.lookahead}function d(t){var e,n,i,s,r,o=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=o+(o-lt)){I.arraySet(t.window,t.window,o,o,0),t.match_start-=o,t.strstart-=o,t.block_start-=o,n=t.hash_size,e=n;do i=t.head[--e],t.head[e]=i>=o?i-o:0;while(--n);n=o,e=n;do i=t.prev[--e],t.prev[e]=i>=o?i-o:0;while(--n);s+=o}if(0===t.strm.avail_in)break;if(n=c(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=ut)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(d(t),0===t.lookahead&&e===P)return vt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,a(t,!1),0===t.strm.avail_out))return vt;if(t.strstart-t.block_start>=t.w_size-lt&&(a(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===B?(a(t,!0),0===t.strm.avail_out?yt:At):t.strstart>t.block_start&&(a(t,!1),0===t.strm.avail_out)?vt:vt}function p(t,e){for(var n,i;;){if(t.lookahead=ut&&(t.ins_h=(t.ins_h<=ut)if(i=C._tr_tally(t,t.strstart-t.match_start,t.match_length-ut),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ut){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=ut&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=ut-1)),t.prev_length>=ut&&t.match_length<=t.prev_length){s=t.strstart+t.lookahead-ut,i=C._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ut),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=s&&(t.ins_h=(t.ins_h<=ut&&t.strstart>0&&(s=t.strstart-1,i=o[s],i===o[++s]&&i===o[++s]&&i===o[++s])){r=t.strstart+ct;do;while(i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&st.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ut?(n=C._tr_tally(t,1,t.match_length-ut),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(a(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===B?(a(t,!0),0===t.strm.avail_out?yt:At):t.last_lit&&(a(t,!1),0===t.strm.avail_out)?vt:bt}function _(t,e){for(var n;;){if(0===t.lookahead&&(d(t),0===t.lookahead)){if(e===P)return vt;break}if(t.match_length=0,n=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(a(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===B?(a(t,!0),0===t.strm.avail_out?yt:At):t.last_lit&&(a(t,!1),0===t.strm.avail_out)?vt:bt}function E(t,e,n,i,s){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=s}function w(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=S[t.level].max_lazy,t.good_match=S[t.level].good_length,t.nice_match=S[t.level].nice_length,t.max_chain_length=S[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ut-1,t.match_available=0,t.ins_h=0}function v(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=X,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new I.Buf16(2*at),this.dyn_dtree=new I.Buf16(2*(2*rt+1)),this.bl_tree=new I.Buf16(2*(2*ot+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new I.Buf16(ht+1),this.heap=new I.Buf16(2*st+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new I.Buf16(2*st+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function b(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=J,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ft:Et,t.adler=2===e.wrap?0:1,e.last_flush=P,C._tr_init(e),j):i(t,z)}function y(t){var e=b(t);return e===j&&w(t.state),e}function A(t,e){return t&&t.state?2!==t.state.wrap?z:(t.state.gzhead=e,j):z}function k(t,e,n,s,r,o){if(!t)return z;var a=1;if(e===F&&(e=6),s<0?(a=0,s=-s):s>15&&(a=2,s-=16),r<1||r>Q||n!==X||s<8||s>15||e<0||e>9||o<0||o>Z)return i(t,z);8===s&&(s=9);var h=new v;return t.state=h,h.strm=t,h.wrap=a,h.gzhead=null,h.w_bits=s,h.w_size=1<G||e<0)return t?i(t,z):z;if(a=t.state,!t.output||!t.input&&0!==t.avail_in||a.status===wt&&e!==B)return i(t,0===t.avail_out?W:z);if(a.strm=t,n=a.last_flush,a.last_flush=e,a.status===ft)if(2===a.wrap)t.adler=0,h(a,31),h(a,139),h(a,8),a.gzhead?(h(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),h(a,255&a.gzhead.time),h(a,a.gzhead.time>>8&255),h(a,a.gzhead.time>>16&255),h(a,a.gzhead.time>>24&255),h(a,9===a.level?2:a.strategy>=V||a.level<2?4:0),h(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(h(a,255&a.gzhead.extra.length),h(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=L(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=pt):(h(a,0),h(a,0),h(a,0),h(a,0),h(a,0),h(a,9===a.level?2:a.strategy>=V||a.level<2?4:0),h(a,kt),a.status=Et);else{var d=X+(a.w_bits-8<<4)<<8,f=-1;f=a.strategy>=V||a.level<2?0:a.level<6?1:6===a.level?2:3,d|=f<<6,0!==a.strstart&&(d|=dt),d+=31-d%31,a.status=Et,u(a,d),0!==a.strstart&&(u(a,t.adler>>>16),u(a,65535&t.adler)),t.adler=1}if(a.status===pt)if(a.gzhead.extra){for(c=a.pending;a.gzindex<(65535&a.gzhead.extra.length)&&(a.pending!==a.pending_buf_size||(a.gzhead.hcrc&&a.pending>c&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),o(t),c=a.pending,a.pending!==a.pending_buf_size));)h(a,255&a.gzhead.extra[a.gzindex]),a.gzindex++;a.gzhead.hcrc&&a.pending>c&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=mt)}else a.status=mt;if(a.status===mt)if(a.gzhead.name){c=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>c&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),o(t),c=a.pending,a.pending===a.pending_buf_size)){l=1;break}l=a.gzindexc&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),0===l&&(a.gzindex=0,a.status=gt)}else a.status=gt;if(a.status===gt)if(a.gzhead.comment){c=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>c&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),o(t),c=a.pending,a.pending===a.pending_buf_size)){l=1;break}l=a.gzindexc&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),0===l&&(a.status=_t)}else a.status=_t;if(a.status===_t&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&o(t),a.pending+2<=a.pending_buf_size&&(h(a,255&t.adler),h(a,t.adler>>8&255),t.adler=0,a.status=Et)):a.status=Et),0!==a.pending){if(o(t),0===t.avail_out)return a.last_flush=-1,j}else if(0===t.avail_in&&s(e)<=s(n)&&e!==B)return i(t,W);if(a.status===wt&&0!==t.avail_in)return i(t,W);if(0!==t.avail_in||0!==a.lookahead||e!==P&&a.status!==wt){var p=a.strategy===V?_(a,e):a.strategy===K?g(a,e):S[a.level].func(a,e);if(p!==yt&&p!==At||(a.status=wt),p===vt||p===yt)return 0===t.avail_out&&(a.last_flush=-1),j;if(p===bt&&(e===N?C._tr_align(a):e!==G&&(C._tr_stored_block(a,0,0,!1),e===O&&(r(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),o(t),0===t.avail_out))return a.last_flush=-1,j}return e!==B?j:a.wrap<=0?q:(2===a.wrap?(h(a,255&t.adler),h(a,t.adler>>8&255),h(a,t.adler>>16&255),h(a,t.adler>>24&255),h(a,255&t.total_in),h(a,t.total_in>>8&255),h(a,t.total_in>>16&255),h(a,t.total_in>>24&255)):(u(a,t.adler>>>16),u(a,65535&t.adler)),o(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?j:q)}function D(t){var e;return t&&t.state?(e=t.state.status,e!==ft&&e!==pt&&e!==mt&&e!==gt&&e!==_t&&e!==Et&&e!==wt?i(t,z):(t.state=null,e===Et?i(t,H):j)):z}function M(t,e){var n,i,s,o,a,h,u,c,l=e.length;if(!t||!t.state)return z;if(n=t.state,o=n.wrap,2===o||1===o&&n.status!==ft||n.lookahead)return z;for(1===o&&(t.adler=x(t.adler,e,l,0)),n.wrap=0,l>=n.w_size&&(0===o&&(r(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new I.Buf8(n.w_size),I.arraySet(c,e,l-n.w_size,n.w_size,0),e=c,l=n.w_size),a=t.avail_in,h=t.next_in,u=t.input,t.avail_in=l,t.next_in=0,t.input=e,d(n);n.lookahead>=ut;){i=n.strstart,s=n.lookahead-(ut-1);do n.ins_h=(n.ins_h<>>24,m>>>=y,g-=y,y=b>>>16&255,0===y)M[a++]=65535&b;else{if(!(16&y)){if(0===(64&y)){b=_[(65535&b)+(m&(1<>>=y,g-=y),g<15&&(m+=D[r++]<>>24,m>>>=y,g-=y,y=b>>>16&255,!(16&y)){if(0===(64&y)){b=E[(65535&b)+(m&(1<c){t.msg="invalid distance too far back",n.mode=i;break t}if(m>>>=y,g-=y,y=a-h,k>y){if(y=k-y,y>d&&n.sane){t.msg="invalid distance too far back",n.mode=i;break t}if(R=0,T=p,0===f){if(R+=l-y,y2;)M[a++]=T[R++],M[a++]=T[R++],M[a++]=T[R++],A-=3;A&&(M[a++]=T[R++],A>1&&(M[a++]=T[R++]))}else{R=a-k;do M[a++]=M[R++],M[a++]=M[R++],M[a++]=M[R++],A-=3;while(A>2);A&&(M[a++]=M[R++],A>1&&(M[a++]=M[R++]))}break}}break}}while(r>3,r-=A,g-=A<<3,m&=(1<>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new E.Buf16(320),this.work=new E.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=O,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new E.Buf32(mt),e.distcode=e.distdyn=new E.Buf32(gt),e.sane=1,e.back=-1,S):x}function o(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):x}function a(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?x:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,o(t))):x}function h(t,e){var n,i;return t?(i=new s,t.state=i,i.window=null,n=a(t,e),n!==S&&(t.state=null),n):x}function u(t){return h(t,Et)}function c(t){if(wt){var e;for(g=new E.Buf32(512),_=new E.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(y(k,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;y(R,t.lens,0,32,_,0,t.work,{bits:5}),wt=!1}t.lencode=g,t.lenbits=9,t.distcode=_,t.distbits=5}function l(t,e,n,i){var s,r=t.state;return null===r.window&&(r.wsize=1<=r.wsize?(E.arraySet(r.window,e,n-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>i&&(s=i),E.arraySet(r.window,e,n-i,s,r.wnext),i-=s,i?(E.arraySet(r.window,e,n-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,n.check=v(n.check,Dt,2,0),d=0,f=0,n.mode=B;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){t.msg="incorrect header check",n.mode=dt;break}if((15&d)!==N){t.msg="unknown compression method",n.mode=dt;break}if(d>>>=4,f-=4,yt=(15&d)+8,0===n.wbits)n.wbits=yt;else if(yt>n.wbits){t.msg="invalid window size",n.mode=dt;break}n.dmax=1<>8&1),512&n.flags&&(Dt[0]=255&d,Dt[1]=d>>>8&255,n.check=v(n.check,Dt,2,0)),d=0,f=0,n.mode=G;case G:for(;f<32;){if(0===h)break t;h--,d+=s[o++]<>>8&255,Dt[2]=d>>>16&255,Dt[3]=d>>>24&255,n.check=v(n.check,Dt,4,0)),d=0,f=0,n.mode=j;case j:for(;f<16;){if(0===h)break t;h--,d+=s[o++]<>8),512&n.flags&&(Dt[0]=255&d,Dt[1]=d>>>8&255,n.check=v(n.check,Dt,2,0)),d=0,f=0,n.mode=q;case q:if(1024&n.flags){for(;f<16;){if(0===h)break t;h--,d+=s[o++]<>>8&255,n.check=v(n.check,Dt,2,0)),d=0,f=0}else n.head&&(n.head.extra=null);n.mode=z;case z:if(1024&n.flags&&(g=n.length,g>h&&(g=h),g&&(n.head&&(yt=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),E.arraySet(n.head.extra,s,o,g,yt)),512&n.flags&&(n.check=v(n.check,s,g,o)),h-=g,o+=g,n.length-=g),n.length))break t;n.length=0,n.mode=H;case H:if(2048&n.flags){if(0===h)break t;g=0;do yt=s[o+g++],n.head&&yt&&n.length<65536&&(n.head.name+=String.fromCharCode(yt));while(yt&&g>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=K;break;case Y:for(;f<32;){if(0===h)break t;h--,d+=s[o++]<>>=7&f,f-=7&f,n.mode=ut;break}for(;f<3;){if(0===h)break t;h--,d+=s[o++]<>>=1,f-=1,3&d){case 0:n.mode=$;break;case 1:if(c(n),n.mode=nt,e===M){d>>>=2,f-=2;break t}break;case 2:n.mode=Q;break;case 3:t.msg="invalid block type",n.mode=dt}d>>>=2,f-=2;break;case $:for(d>>>=7&f,f-=7&f;f<32;){if(0===h)break t;h--,d+=s[o++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=dt;break}if(n.length=65535&d,d=0,f=0,n.mode=J,e===M)break t;case J:n.mode=X;case X:if(g=n.length){if(g>h&&(g=h),g>u&&(g=u),0===g)break t;E.arraySet(r,s,o,g,a),h-=g,o+=g,u-=g,a+=g,n.length-=g;break}n.mode=K;break;case Q:for(;f<14;){if(0===h)break t;h--,d+=s[o++]<>>=5,f-=5,n.ndist=(31&d)+1,d>>>=5,f-=5,n.ncode=(15&d)+4,d>>>=4,f-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=dt;break}n.have=0,n.mode=tt;case tt:for(;n.have>>=3,f-=3}for(;n.have<19;)n.lens[Mt[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,kt={bits:n.lenbits},At=y(A,n.lens,0,19,n.lencode,0,n.work,kt),n.lenbits=kt.bits,At){t.msg="invalid code lengths set",n.mode=dt;break}n.have=0,n.mode=et;case et:for(;n.have>>24,_t=Tt>>>16&255,Et=65535&Tt,!(gt<=f);){if(0===h)break t;h--,d+=s[o++]<>>=gt,f-=gt,n.lens[n.have++]=Et;else{if(16===Et){for(Rt=gt+2;f>>=gt,f-=gt,0===n.have){t.msg="invalid bit length repeat",n.mode=dt;break}yt=n.lens[n.have-1],g=3+(3&d),d>>>=2,f-=2}else if(17===Et){for(Rt=gt+3;f>>=gt,f-=gt,yt=0,g=3+(7&d),d>>>=3,f-=3}else{for(Rt=gt+7;f>>=gt,f-=gt,yt=0,g=11+(127&d),d>>>=7,f-=7}if(n.have+g>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=dt;break}for(;g--;)n.lens[n.have++]=yt}}if(n.mode===dt)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=dt;break}if(n.lenbits=9,kt={bits:n.lenbits},At=y(k,n.lens,0,n.nlen,n.lencode,0,n.work,kt),n.lenbits=kt.bits,At){t.msg="invalid literal/lengths set",n.mode=dt;break}if(n.distbits=6,n.distcode=n.distdyn,kt={bits:n.distbits},At=y(R,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,kt),n.distbits=kt.bits,At){t.msg="invalid distances set",n.mode=dt;break}if(n.mode=nt,e===M)break t;case nt:n.mode=it;case it:if(h>=6&&u>=258){t.next_out=a,t.avail_out=u,t.next_in=o,t.avail_in=h,n.hold=d,n.bits=f,b(t,m),a=t.next_out,r=t.output,u=t.avail_out,o=t.next_in,s=t.input,h=t.avail_in,d=n.hold,f=n.bits,n.mode===K&&(n.back=-1);break}for(n.back=0;Tt=n.lencode[d&(1<>>24,_t=Tt>>>16&255,Et=65535&Tt,!(gt<=f);){if(0===h)break t;h--,d+=s[o++]<>wt)],gt=Tt>>>24,_t=Tt>>>16&255,Et=65535&Tt,!(wt+gt<=f);){if(0===h)break t;h--,d+=s[o++]<>>=wt,f-=wt,n.back+=wt}if(d>>>=gt,f-=gt,n.back+=gt,n.length=Et,0===_t){n.mode=ht;break}if(32&_t){n.back=-1,n.mode=K;break}if(64&_t){t.msg="invalid literal/length code",n.mode=dt;break}n.extra=15&_t,n.mode=st;case st:if(n.extra){for(Rt=n.extra;f>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=rt;case rt:for(;Tt=n.distcode[d&(1<>>24,_t=Tt>>>16&255,Et=65535&Tt,!(gt<=f);){if(0===h)break t;h--,d+=s[o++]<>wt)],gt=Tt>>>24,_t=Tt>>>16&255,Et=65535&Tt,!(wt+gt<=f);){if(0===h)break t;h--,d+=s[o++]<>>=wt,f-=wt,n.back+=wt}if(d>>>=gt,f-=gt,n.back+=gt,64&_t){t.msg="invalid distance code",n.mode=dt;break}n.offset=Et,n.extra=15&_t,n.mode=ot;case ot:if(n.extra){for(Rt=n.extra;f>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=dt;break}n.mode=at;case at:if(0===u)break t;if(g=m-u,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=dt;break}g>n.wnext?(g-=n.wnext,_=n.wsize-g):_=n.wnext-g,g>n.length&&(g=n.length),mt=n.window}else mt=r,_=a-n.offset,g=n.length;g>u&&(g=u),u-=g,n.length-=g;do r[a++]=mt[_++];while(--g);0===n.length&&(n.mode=it);break;case ht:if(0===u)break t;r[a++]=n.length,u--,n.mode=it;break;case ut:if(n.wrap){for(;f<32;){if(0===h)break t;h--,d|=s[o++]<=1&&0===q[x];x--);if(L>x&&(L=x),0===x)return m[g++]=20971520,m[g++]=20971520,E.bits=1,0;for(C=1;C0&&(t===a||1!==x))return-1;for(z[1]=0,S=1;Sr||t===u&&O>o)return 1;for(;;){R=S-P,_[I]k?(T=H[W+_[I]],D=G[j+_[I]]):(T=96,D=0),w=1<>P)+v]=R<<24|T<<16|D|0;while(0!==v);for(w=1<>=1;if(0!==w?(B&=w-1,B+=w):B=0,I++,0===--q[S]){if(S===x)break;S=e[n+_[I]]}if(S>L&&(B&y)!==b){for(0===P&&(P=L),A+=C,U=S-P,N=1<r||t===u&&O>o)return 1;b=B&y,m[b]=L<<24|U<<16|A-g|0}}return 0!==B&&(m[A+B]=S-P<<24|64<<16|0),E.bits=L,0}},function(t,e,n){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t,e,n,i,s){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=s,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function o(t){return t<256?ht[t]:ht[256+(t>>>7)]}function a(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function h(t,e,n){t.bi_valid>Z-n?(t.bi_buf|=e<>Z-t.bi_valid,t.bi_valid+=n-Z):(t.bi_buf|=e<>>=1,n<<=1;while(--e>0);return n>>>1}function l(t){16===t.bi_valid?(a(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function d(t,e){var n,i,s,r,o,a,h=e.dyn_tree,u=e.max_code,c=e.stat_desc.static_tree,l=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(r=0;r<=K;r++)t.bl_count[r]=0;for(h[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;np&&(r=p,m++),h[2*i+1]=r,i>u||(t.bl_count[r]++,o=0,i>=f&&(o=d[i-f]),a=h[2*i],t.opt_len+=a*(r+o),l&&(t.static_len+=a*(c[2*i+1]+o)));if(0!==m){do{for(r=p-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(r=p;0!==r;r--)for(i=t.bl_count[r];0!==i;)s=t.heap[--n],s>u||(h[2*s+1]!==r&&(t.opt_len+=(r-h[2*s+1])*h[2*s],h[2*s+1]=r),i--)}}function f(t,e,n){var i,s,r=new Array(K+1),o=0;for(i=1;i<=K;i++)r[i]=o=o+n[i-1]<<1;for(s=0;s<=e;s++){var a=t[2*s+1];0!==a&&(t[2*s]=c(r[a]++,a))}}function p(){var t,e,n,i,r,o=new Array(K+1);for(n=0,i=0;i>=7;i8?a(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function _(t,e,n,i){g(t),i&&(a(t,n),a(t,~n)),x.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function E(t,e,n,i){var s=2*e,r=2*n;return t[s]>1;n>=1;n--)w(t,r,n);s=h;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],w(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,r[2*s]=r[2*n]+r[2*i],t.depth[s]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,r[2*n+1]=r[2*i+1]=s,t.heap[1]=s++,w(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],d(t,e),f(r,u,t.bl_count)}function y(t,e,n){var i,s,r=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)s=o,o=e[2*(i+1)+1],++a=3&&0===t.bl_tree[2*st[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function R(t,e,n,i){var s;for(h(t,e-257,5),h(t,n-1,5),h(t,i-4,4),s=0;s>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return U;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return P;for(e=32;e0?(t.strm.data_type===N&&(t.strm.data_type=T(t)),b(t,t.l_desc),b(t,t.d_desc),o=k(t),s=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=s&&(s=r)):s=r=n+5,n+4<=s&&e!==-1?M(t,e,n,i):t.strategy===L||r===s?(h(t,(B<<1)+(i?1:0),3),v(t,ot,at)):(h(t,(G<<1)+(i?1:0),3),R(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),v(t,t.dyn_ltree,t.dyn_dtree)),m(t),i&&g(t)}function C(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(ut[n]+H+1)]++,t.dyn_dtree[2*o(e)]++),t.last_lit===t.lit_bufsize-1}var x=n(5),L=4,U=0,P=1,N=2,O=0,B=1,G=2,j=3,q=258,z=29,H=256,W=H+1+z,F=30,Y=19,V=2*W+1,K=15,Z=16,$=7,J=256,X=16,Q=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],nt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],st=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,ot=new Array(2*(W+2));i(ot);var at=new Array(2*F);i(at);var ht=new Array(rt);i(ht);var ut=new Array(q-j+1);i(ut);var ct=new Array(z);i(ct);var lt=new Array(F);i(lt);var dt,ft,pt,mt=!1;e._tr_init=D,e._tr_stored_block=M,e._tr_flush_block=I,e._tr_tally=C,e._tr_align=S},function(t,e,n){function i(t){var e=s(t)?Object.prototype.toString.call(t):"";return"[object Function]"===e}var s=n(26);t.exports=i},function(t,e,n){function i(t){if(t)return s(t)}function s(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}var r=n(26);t.exports=i,i.prototype.clearTimeout=function(){return this._timeout=0,this._responseTimeout=0,clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),this},i.prototype.parse=function(t){return this._parser=t,this},i.prototype.responseType=function(t){return this._responseType=t,this},i.prototype.serialize=function(t){return this._serializer=t,this},i.prototype.timeout=function(t){return t&&"object"==typeof t?("undefined"!=typeof t.deadline&&(this._timeout=t.deadline),"undefined"!=typeof t.response&&(this._responseTimeout=t.response),this):(this._timeout=t,this._responseTimeout=0,this)},i.prototype.then=function(t,e){if(!this._fullfilledPromise){var n=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(t,e){n.end(function(n,i){n?e(n):t(i)})})}return this._fullfilledPromise.then(t,e)},i.prototype.catch=function(t){return this.then(void 0,t)},i.prototype.use=function(t){return t(this),this},i.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},i.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},i.prototype.get=function(t){return this._header[t.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(t,e){if(r(t)){for(var n in t)this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},i.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},i.prototype.field=function(t,e){if(null===t||void 0===t)throw new Error(".field(name, val) name can not be empty");if(r(t)){for(var n in t)this.field(n,t[n]);return this}if(Array.isArray(e)){for(var i in e)this.field(t,e[i]);return this}if(null===e||void 0===e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=""+e),this._getFormData().append(t,e),this},i.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},i.prototype.withCredentials=function(){return this._withCredentials=!0,this},i.prototype.redirects=function(t){return this._maxRedirects=t,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(t){var e=r(t),n=this._header["content-type"];if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&r(this._data))for(var i in t)this._data[i]=t[i];else"string"==typeof t?(n||this.type("form"),n=this._header["content-type"],"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+t:t:this._data=(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(n||this.type("json"),this)},i.prototype.sortQuery=function(t){return this._sort="undefined"==typeof t||t,this},i.prototype._timeoutError=function(t,e){if(!this._aborted){var n=new Error(t+e+"ms exceeded");n.timeout=e,n.code="ECONNABORTED",this.timedout=!0,this.abort(),this.callback(n)}},i.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout)},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout)},this._responseTimeout))}},function(t,e,n){function i(t){if(t)return s(t)}function s(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}var r=n(79);t.exports=i,i.prototype.get=function(t){return this.header[t.toLowerCase()]},i.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=r.type(e);var n=r.params(e);for(var i in n)this[i]=n[i];this.links={};try{t.link&&(this.links=r.parseLinks(t.link))}catch(t){}},i.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t}},function(t,e){e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){return t.split(/ *; */).reduce(function(t,e){var n=e.split(/ *= */),i=n.shift(),s=n.shift();return i&&s&&(t[i]=s),t},{})},e.parseLinks=function(t){return t.split(/ *, */).reduce(function(t,e){var n=e.split(/ *; */),i=n[0].slice(1,-1),s=n[1].split(/ *= */)[1].slice(1,-1);return t[s]=i,t},{})},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&delete t.cookie,t}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){const i=n(0),s=n(4),r=n(17),o=n(6),a=n(30),h=n(10),u=n(41),c=n(42),l=n(13),d=n(31);class f{constructor(t){this.client=t}get pastReady(){return this.client.ws.status===i.Status.READY}newGuild(t){const e=this.client.guilds.has(t.id),n=new r(this.client,t);return this.client.guilds.set(n.id,n),this.pastReady&&!e&&(this.client.options.fetchAllMembers?n.fetchMembers().then(()=>{this.client.emit(i.Events.GUILD_CREATE,n)}):this.client.emit(i.Events.GUILD_CREATE,n)),n}newUser(t){if(this.client.users.has(t.id))return this.client.users.get(t.id);const e=new o(this.client,t);return this.client.users.set(e.id,e),e}newChannel(t,e){const n=this.client.channels.has(t.id);let s;return t.type===i.ChannelTypes.DM?s=new a(this.client,t):t.type===i.ChannelTypes.groupDM?s=new d(this.client,t):(e=e||this.client.guilds.get(t.guild_id),e&&(t.type===i.ChannelTypes.text?(s=new u(e,t),e.channels.set(s.id,s)):t.type===i.ChannelTypes.voice&&(s=new c(e,t),e.channels.set(s.id,s)))),s?(this.pastReady&&!n&&this.client.emit(i.Events.CHANNEL_CREATE,s),this.client.channels.set(s.id,s),s):null}newEmoji(t,e){const n=e.emojis.has(t.id);if(t&&!n){let n=new h(e,t);return this.client.emit(i.Events.GUILD_EMOJI_CREATE,n),e.emojis.set(n.id,n),n}return n?e.emojis.get(t.id):null}killEmoji(t){t instanceof h&&t.guild&&(this.client.emit(i.Events.GUILD_EMOJI_DELETE,t),t.guild.emojis.delete(t.id))}killGuild(t){const e=this.client.guilds.has(t.id);this.client.guilds.delete(t.id),e&&this.pastReady&&this.client.emit(i.Events.GUILD_DELETE,t)}killUser(t){this.client.users.delete(t.id)}killChannel(t){this.client.channels.delete(t.id),t instanceof l&&t.guild.channels.delete(t.id)}updateGuild(t,e){const n=s(t);t.setup(e),this.pastReady&&this.client.emit(i.Events.GUILD_UPDATE,n,t)}updateChannel(t,e){t.setup(e)}updateEmoji(t,e){const n=s(t);t.setup(e),this.client.emit(i.Events.GUILD_EMOJI_UPDATE,n,t)}}t.exports=f},function(t,e,n){const i=n(0);class s{constructor(t){this.client=t,this.heartbeatInterval=null}connectToWebSocket(t,e,n){this.client.emit(i.Events.DEBUG,`Authenticated using token ${t}`),this.client.token=t;const s=this.client.setTimeout(()=>n(new Error(i.Errors.TOOK_TOO_LONG)),3e5);this.client.rest.methods.getGateway().then(r=>{this.client.emit(i.Events.DEBUG,`Using gateway ${r}`),this.client.ws.connect(r),this.client.ws.once("close",t=>{4004===t.code&&n(new Error(i.Errors.BAD_LOGIN)),4010===t.code&&n(new Error(i.Errors.INVALID_SHARD))}),this.client.once(i.Events.READY,()=>{e(t),this.client.clearTimeout(s)})},n)}setupKeepAlive(t){this.heartbeatInterval=this.client.setInterval(()=>this.client.ws.heartbeat(!0),t)}destroy(){return this.client.ws.destroy(),this.client.user.bot?(this.client.token=null,Promise.resolve()):this.client.rest.methods.logout().then(()=>{this.client.token=null})}}t.exports=s},function(t,e,n){class i{constructor(t){this.client=t,this.register(n(100)),this.register(n(101)),this.register(n(102)),this.register(n(106)),this.register(n(103)),this.register(n(104)),this.register(n(105)),this.register(n(84)),this.register(n(85)),this.register(n(86)),this.register(n(88)),this.register(n(99)),this.register(n(92)),this.register(n(93)),this.register(n(87)),this.register(n(94)),this.register(n(95)),this.register(n(96)),this.register(n(107)),this.register(n(109)),this.register(n(108)),this.register(n(98)),this.register(n(89)),this.register(n(90)),this.register(n(91)),this.register(n(97))}register(t){this[t.name.replace(/Action$/,"")]=new t(this.client)}}t.exports=i},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.dataManager.newChannel(t);return{channel:n}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.channels.get(t.id);return n?(e.dataManager.killChannel(n),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)):n=this.deleted.get(t.id)||null,{channel:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.id);if(n){const i=r(n);return n.setup(t),e.emit(s.Events.CHANNEL_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id),i=e.dataManager.newUser(t.user);n&&i&&e.emit(s.Events.GUILD_BAN_REMOVE,n,i)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.guilds.get(t.id);if(n){if(n.available&&t.unavailable)return n.available=!1,e.emit(s.Events.GUILD_UNAVAILABLE,n),{guild:null};e.guilds.delete(n.id),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)}else n=this.deleted.get(t.id)||null;return{guild:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t,e){const n=this.client,i=n.dataManager.newEmoji(e,t);return{emoji:i}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client;return e.dataManager.killEmoji(t),{emoji:t}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t,e){this.client.dataManager.updateEmoji(t,e)}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t,e){const n=t._addMember(e,!1);return{member:n}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){let i=n.members.get(t.user.id);return i?(n.memberCount--,n._removeMember(i),this.deleted.set(n.id+t.user.id,i),e.status===s.Status.READY&&e.emit(s.Events.GUILD_MEMBER_REMOVE,i),this.scheduleForDeletion(n.id,t.user.id)):i=this.deleted.get(n.id+t.user.id)||null,{guild:n,member:i}}return{guild:n,member:null}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(8);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){const i=n.roles.has(t.role.id),o=new r(n,t.role);return n.roles.set(o.id,o),i||e.emit(s.Events.GUILD_ROLE_CREATE,o),{role:o}}return{role:null}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){let i=n.roles.get(t.role_id);return i?(n.roles.delete(t.role_id),this.deleted.set(n.id+t.role_id,i),this.scheduleForDeletion(n.id,t.role_id),e.emit(s.Events.GUILD_ROLE_DELETE,i)):i=this.deleted.get(n.id+t.role_id)||null,{role:i}}return{role:null}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){const i=t.role;let o=null;const a=n.roles.get(i.id);return a&&(o=r(a),a.setup(t.role),e.emit(s.Events.GUILD_ROLE_UPDATE,o,a)),{old:o,updated:a}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n)for(const i of t.roles){const t=n.roles.get(i.id);t&&(t.position=i.position)}return{guild:n}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){t.presences=t.presences||[];for(const e of t.presences)n._setPresence(e.user.id,e);t.members=t.members||[];for(const i of t.members){const t=n.members.get(i.user.id);t?n._updateMember(t,i):n._addMember(i,!1)}}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){const i=r(n);return n.setup(t),e.emit(s.Events.GUILD_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2),s=n(11);class r extends i{handle(t){const e=this.client,n=e.channels.get((t instanceof Array?t[0]:t).channel_id),i=e.users.get((t instanceof Array?t[0]:t).author.id);if(n){const r=n.guild?n.guild.member(i):null;if(t instanceof Array){const o=new Array(t.length);for(let a=0;athis.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(3),r=n(0);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id),i=t.ids,o=new s;for(const a of i){const t=n.messages.get(a);t&&o.set(t.id,t)}return o.size>0&&e.emit(r.Events.MESSAGE_BULK_DELETE,o),{messages:o}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._addReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_ADD,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._removeReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_REMOVE,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.channels.get(t.channel_id);if(!e||"voice"===e.type)return!1;const n=e.messages.get(t.message_id);return!!n&&(n._clearReactions(),this.client.emit(s.Events.MESSAGE_REACTION_REMOVE_ALL,n),{message:n})}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id);if(n){const i=n.messages.get(t.id);if(i){const n=r(i);return i.patch(t),i._edits.unshift(n),e.emit(s.Events.MESSAGE_UPDATE,n,i),{old:n,updated:i}}return{old:i,updated:i}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.dataManager.newUser(t);return{user:n}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.user.notes.get(t.id),i=t.note.length?t.note:null;return e.user.notes.set(t.id,i),e.emit(s.Events.USER_NOTE_UPDATE,t.id,n,i),{old:n,updated:i}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client;if(e.user){if(e.user.equals(t))return{old:e.user,updated:e.user};const n=r(e.user);return e.user.patch(t),e.emit(s.Events.USER_UPDATE,n,e.user),{old:n,updated:e.user}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){function i(t){let e=t.split("?")[0];if(e.includes("/channels/")||e.includes("/guilds/")){const t=e.includes("/channels/")?e.indexOf("/channels/"):e.indexOf("/guilds/"),n=e.substring(t).split("/")[2];e=e.replace(/(\d{8,})/g,":id").replace(":id",n)}return e}const s=n(25),r=n(0);class o{constructor(t,e,n,s,r,o){this.rest=t,this.method=e,this.url=n,this.auth=s,this.data=r,this.file=o,this.route=i(this.url)}getAuth(){if(this.rest.client.token&&this.rest.client.user&&this.rest.client.user.bot)return`Bot ${this.rest.client.token}`;if(this.rest.client.token)return this.rest.client.token;throw new Error(r.Errors.NO_TOKEN)}gen(){const t=s[this.method](this.url);return this.auth&&t.set("authorization",this.getAuth()),this.file&&this.file.file?(t.attach("file",this.file.file,this.file.name),this.data=this.data||{},t.field("payload_json",JSON.stringify(this.data))):this.data&&t.send(this.data),this.rest.client.browser||t.set("User-Agent",this.rest.userAgentManager.userAgent),t}}t.exports=o},function(t,e,n){const i=n(0),s=n(3),r=n(43),o=n(154),a=n(15),h=n(6),u=n(14),c=n(11),l=n(8),d=n(32),f=n(19),p=n(152),m=n(28);class g{constructor(t){this.rest=t,this.client=t.client}login(t=this.client.token){return new Promise((e,n)=>{if("string"!=typeof t)throw new Error(i.Errors.INVALID_TOKEN);t=t.replace(/^Bot\s*/i,""),this.client.manager.connectToWebSocket(t,e,n)})}logout(){return this.rest.makeRequest("post",i.Endpoints.logout,!0,{})}getGateway(){return this.rest.makeRequest("get",i.Endpoints.gateway,!0).then(t=>{return this.client.ws.gateway=`${t.url}/?v=${i.PROTOCOL_VERSION}`,this.client.ws.gateway})}getBotGateway(){return this.rest.makeRequest("get",i.Endpoints.botGateway,!0)}sendMessage(t,e,{tts,nonce,embed,disableEveryone,split,code}={},n=null){return new Promise((s,o)=>{"undefined"!=typeof e&&(e=this.client.resolver.resolveString(e)),e&&("undefined"==typeof code||"boolean"==typeof code&&code!==!0||(e=a(this.client.resolver.resolveString(e),!0),e=`\`\`\`${"boolean"!=typeof code?code||"":""} +var J=n(63),X=n(65),Q=n(66);e.Buffer=o,e.SlowBuffer=g,e.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),e.kMaxLength=s(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,n){return a(null,t,e,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,n){return u(null,t,e,n)},o.allocUnsafe=function(t){return c(null,t)},o.allocUnsafeSlow=function(t){return c(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,s=0,r=Math.min(n,i);s0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},o.prototype.compare=function(t,e,n,i,s){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===s&&(s=this.length),e<0||n>t.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&e>=n)return 0;if(i>=s)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,s>>>=0,this===t)return 0;for(var r=s-i,a=n-e,h=Math.min(r,a),u=this.slice(i,s),c=t.slice(e,n),l=0;ls)&&(n=s),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return A(this,t,e,n);case"ascii":return k(this,t,e,n);case"latin1":case"binary":return R(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,e,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;o.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e0&&(s*=256);)i+=this[t+--e]*s;return i},o.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var i=this[t],s=1,r=0;++r=s&&(i-=Math.pow(2,8*e)),i},o.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var i=e,s=1,r=this[t+--i];i>0&&(s*=256);)r+=this[t+--i]*s;return s*=128,r>=s&&(r-=Math.pow(2,8*e)),r},o.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},o.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),X.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),X.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),X.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),X.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e|=0,n|=0,!i){var s=Math.pow(2,8*n)-1;N(this,t,e,n,s,0)}var r=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+r]=t/o&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var s=Math.pow(2,8*n-1);N(this,t,e,n,s-1,-s)}var r=0,o=1,a=0;for(this[e]=255&t;++r>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var s=Math.pow(2,8*n-1);N(this,t,e,n,s-1,-s)}var r=n-1,o=1,a=0;for(this[e+r]=255&t;--r>=0&&(o*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/o>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,n){return j(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return j(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return q(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return q(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--s)t[s+e]=this[s+n];else if(r<1e3||!o.TYPED_ARRAY_SUPPORT)for(s=0;s>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var r;if("number"==typeof t)for(r=e;r0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),s||(s=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var s=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,s,o,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,s=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(n)){for(a=o;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){s=a;break}if(s<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(s,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,n){(function(t){function n(t,e){for(var n=0,i=t.length-1;i>=0;i--){var s=t[i];"."===s?t.splice(i,1):".."===s?(t.splice(i,1),n++):n&&(t.splice(i,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],i=0;i=-1&&!s;r--){var o=r>=0?arguments[r]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,s="/"===o.charAt(0))}return e=n(i(e.split("/"),function(t){return!!t}),!s).join("/"),(s?"/":"")+e||"."},e.normalize=function(t){var s=e.isAbsolute(t),r="/"===o(t,-1);return t=n(i(t.split("/"),function(t){return!!t}),!s).join("/"),t||s||(t="."),t&&r&&(t+="/"),(s?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function i(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var s=i(t.split("/")),r=i(n.split("/")),o=Math.min(s.length,r.length),a=o,h=0;h1)for(var n=1;n=0?"&":"?")+t),this._sort){var e=this.url.indexOf("?");if(e>=0){var n=this.url.substring(e+1).split("&");g(this._sort)?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,e)+"?"+n.join("&")}}},c.prototype._isHost=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},c.prototype.end=function(t){var e=this,n=this.xhr=E.getXHR(),s=this._formData||this._data;this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||i,n.onreadystatechange=function(){var t=n.readyState;if(t>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==t){var i;try{i=n.status}catch(t){i=0}if(!i){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{n.onprogress=r.bind(null,"download"),n.upload&&(n.upload.onprogress=r.bind(null,"upload"))}catch(t){}if(this._appendQueryString(),this._setTimeouts(),this.username&&this.password?n.open(this.method,this.url,!0,this.username,this.password):n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!this._isHost(s)){var o=this._header["content-type"],a=this._serializer||E.serialize[o?o.split(";")[0]:""];!a&&h(o)&&(a=E.serialize["application/json"]),a&&(s=a(s))}for(var u in this.header)null!=this.header[u]&&n.setRequestHeader(u,this.header[u]);return this._responseType&&(n.responseType=this._responseType),this.emit("request",this),n.send("undefined"!=typeof s?s:null),this},E.get=function(t,e,n){var i=E("GET",t);return"function"==typeof e&&(n=e,e=null),e&&i.query(e),n&&i.end(n),i},E.head=function(t,e,n){var i=E("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},E.options=function(t,e,n){var i=E("OPTIONS",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},E.del=l,E.delete=l,E.patch=function(t,e,n){var i=E("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},E.post=function(t,e,n){var i=E("POST",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i},E.put=function(t,e,n){var i=E("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&i.send(e),n&&i.end(n),i}},function(t,e){function n(t){return null!==t&&"object"==typeof t}t.exports=n},function(t,e){t.exports={name:"discord.js",version:"10.0.1",description:"A powerful library for interacting with the Discord API",main:"./src/index",types:"./typings/index.d.ts",scripts:{test:"eslint src && docgen --source src --custom docs/index.yml",docs:"docgen --source src --custom docs/index.yml --output docs/docs.json","test-docs":"docgen --source src --custom docs",lint:"eslint src","web-dist":"node ./node_modules/parallel-webpack/bin/run.js"},repository:{type:"git",url:"git+https://github.com/hydrabolt/discord.js.git"},keywords:["discord","api","bot","client","node","discordapp"],author:"Amish Shah ",license:"Apache-2.0",bugs:{url:"https://github.com/hydrabolt/discord.js/issues"},homepage:"https://github.com/hydrabolt/discord.js#readme",runkitExampleFilename:"./docs/examples/ping.js",dependencies:{"@types/node":"^6.0.0",pako:"^1.0.0",superagent:"^3.3.0",tweetnacl:"^0.14.0",ws:"^1.1.0"},peerDependencies:{erlpack:"hammerandchisel/erlpack#master","node-opus":"^0.2.0",opusscript:"^0.0.1",uws:"^0.12.0"},devDependencies:{"discord.js-docgen":"hydrabolt/discord.js-docgen#master",eslint:"^3.12.0","parallel-webpack":"^1.6.0","uglify-js":"mishoo/UglifyJS2#harmony",webpack:"2.2.0-rc.3"},engines:{node:">=6.0.0"},browser:{ws:!1,uws:!1,erlpack:!1,opusscript:!1,"node-opus":!1,"tweet-nacl":!1,"src/sharding/Shard.js":!1,"src/sharding/ShardClientUtil.js":!1,"src/sharding/ShardingManager.js":!1,"src/client/voice/dispatcher/StreamDispatcher.js":!1,"src/client/voice/opus/BaseOpusEngine.js":!1,"src/client/voice/opus/NodeOpusEngine.js":!1,"src/client/voice/opus/OpusEngineList.js":!1,"src/client/voice/opus/OpusScriptEngine.js":!1,"src/client/voice/pcm/ConverterEngine.js":!1,"src/client/voice/pcm/ConverterEngineList.js":!1,"src/client/voice/pcm/FfmpegConverterEngine.js":!1,"src/client/voice/player/AudioPlayer.js":!1,"src/client/voice/player/BasePlayer.js":!1,"src/client/voice/player/DefaultPlayer.js":!1,"src/client/voice/receiver/VoiceReadable.js":!1,"src/client/voice/receiver/VoiceReceiver.js":!1,"src/client/voice/util/SecretKey.js":!1,"src/client/voice/ClientVoiceManager.js":!1,"src/client/voice/VoiceConnection.js":!1,"src/client/voice/VoiceUDPClient.js":!1,"src/client/voice/VoiceWebSocket.js":!1}}},function(t,e,n){const i=n(6),s=n(37);class r extends s{setup(t){super.setup(t),this.flags=t.flags,this.owner=new i(this.client,t.owner)}}t.exports=r},function(t,e,n){const i=n(6),s=n(3);class r extends i{setup(t){super.setup(t),this.verified=t.verified,this.email=t.email,this.localPresence={},this._typing=new Map,this.friends=new s,this.blocked=new s,this.notes=new s}edit(t){return this.client.rest.methods.updateCurrentUser(t)}setUsername(t,e){return this.client.rest.methods.updateCurrentUser({username:t},e)}setEmail(t,e){return this.client.rest.methods.updateCurrentUser({email:t},e)}setPassword(t,e){return this.client.rest.methods.updateCurrentUser({password:t},e)}setAvatar(t){return t.startsWith("data:")?this.client.rest.methods.updateCurrentUser({avatar:t}):this.client.resolver.resolveBuffer(t).then(t=>this.client.rest.methods.updateCurrentUser({avatar:t}))}setPresence(t){return new Promise(e=>{let n=this.localPresence.status||this.presence.status,i=this.localPresence.game,s=this.localPresence.afk||this.presence.afk;if(!i&&this.presence.game&&(i={name:this.presence.game.name,type:this.presence.game.type,url:this.presence.game.url}),t.status){if("string"!=typeof t.status)throw new TypeError("Status must be a string");n=t.status}t.game&&(i=t.game,i.url&&(i.type=1)),"undefined"!=typeof t.afk&&(s=t.afk),s=Boolean(s),this.localPresence={status:n,game:i,afk:s},this.localPresence.since=0,this.localPresence.game=this.localPresence.game||null,this.client.ws.send({op:3,d:this.localPresence}),this.client._setPresence(this.id,this.localPresence),e(this)})}setStatus(t){return this.setPresence({status:t})}setGame(t,e){return this.setPresence({game:{name:t,url:e}})}setAFK(t){return this.setPresence({afk:t})}fetchMentions(t={limit:25,roles:true,everyone:true,guild:null}){return this.client.rest.methods.fetchMentions(t)}addFriend(t){return t=this.client.resolver.resolveUser(t),this.client.rest.methods.addFriend(t)}removeFriend(t){return t=this.client.resolver.resolveUser(t),this.client.rest.methods.removeFriend(t)}createGuild(t,e,n=null){return n?n.startsWith("data:")?this.client.rest.methods.createGuild({name:t,icon:n,region:e}):this.client.resolver.resolveBuffer(n).then(n=>this.client.rest.methods.createGuild({name:t,icon:n,region:e})):this.client.rest.methods.createGuild({name:t,icon:n,region:e})}}t.exports=r},function(t,e,n){const i=n(9),s=n(12),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="dm",this.messages=new r,this._typing=new Map}setup(t){super.setup(t),this.recipient=this.client.dataManager.newUser(t.recipients[0]),this.lastMessageID=t.last_message_id}toString(){return this.recipient.toString()}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(9),s=n(12),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="group",this.messages=new r,this._typing=new Map}setup(t){if(super.setup(t),this.name=t.name,this.icon=t.icon,this.ownerID=t.owner_id,this.recipients||(this.recipients=new r),t.recipients)for(const e of t.recipients){const t=this.client.dataManager.newUser(e);this.recipients.set(t.id,t)}this.lastMessageID=t.last_message_id}get owner(){return this.client.users.get(this.ownerID)}equals(t){const e=t&&this.id===t.id&&this.name===t.name&&this.icon===t.icon&&this.ownerID===t.ownerID; +return e?this.recipients.equals(t.recipients):e}toString(){return this.name}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(38),s=n(39),r=n(0);class o{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.setup(e)}setup(t){this.guild=this.client.guilds.get(t.guild.id)||new i(this.client,t.guild),this.code=t.code,this.temporary=t.temporary,this.maxAge=t.max_age,this.uses=t.uses,this.maxUses=t.max_uses,t.inviter&&(this.inviter=this.client.dataManager.newUser(t.inviter)),this.channel=this.client.channels.get(t.channel.id)||new s(this.client,t.channel),this.createdTimestamp=new Date(t.created_at).getTime()}get createdAt(){return new Date(this.createdTimestamp)}get expiresTimestamp(){return this.createdTimestamp+1e3*this.maxAge}get expiresAt(){return new Date(this.expiresTimestamp)}get url(){return r.Endpoints.inviteLink(this.code)}delete(){return this.client.rest.methods.deleteInvite(this)}toString(){return this.url}}t.exports=o},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.message=t,this.setup(e)}setup(t){this.id=t.id,this.filename=t.filename,this.filesize=t.size,this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}t.exports=n},function(t,e,n){const i=n(21).EventEmitter,s=n(3);class r extends i{constructor(t,e,n={}){super(),this.channel=t,this.filter=e,this.options=n,this.ended=!1,this.collected=new s,this.listener=(t=>this.verify(t)),this.channel.client.on("message",this.listener),n.time&&this.channel.client.setTimeout(()=>this.stop("time"),n.time)}verify(t){return(!this.channel||this.channel.id===t.channel.id)&&(!!this.filter(t,this)&&(this.collected.set(t.id,t),this.emit("message",t,this),this.collected.size>=this.options.maxMatches?this.stop("matchesLimit"):this.options.max&&this.collected.size===this.options.max&&this.stop("limit"),!0))}get next(){return new Promise((t,e)=>{if(this.ended)return void e(this.collected);const n=()=>{this.removeListener("message",i),this.removeListener("end",s)},i=(...e)=>{n(),t(...e)},s=(...t)=>{n(),e(...t)};this.once("message",i),this.once("end",s)})}stop(t="user"){this.ended||(this.ended=!0,this.channel.client.removeListener("message",this.listener),this.emit("end",this.collected,t))}}t.exports=r},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t.client}),this.message=t,this.setup(e)}setup(t){if(this.type=t.type,this.title=t.title,this.description=t.description,this.url=t.url,this.color=t.color,this.fields=[],t.fields)for(const e of t.fields)this.fields.push(new o(this,e));this.createdTimestamp=t.timestamp,this.thumbnail=t.thumbnail?new i(this,t.thumbnail):null,this.author=t.author?new r(this,t.author):null,this.provider=t.provider?new s(this,t.provider):null,this.footer=t.footer?new a(this,t.footer):null}get createdAt(){return new Date(this.createdTimestamp)}get hexColor(){let t=this.color.toString(16);for(;t.length<6;)t=`0${t}`;return`#${t}`}}class i{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.url=t.url,this.proxyURL=t.proxy_url,this.height=t.height,this.width=t.width}}class s{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.url=t.url}}class r{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.url=t.url,this.iconURL=t.icon_url}}class o{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.name=t.name,this.value=t.value,this.inline=t.inline}}class a{constructor(t,e){this.embed=t,this.setup(e)}setup(t){this.text=t.text,this.iconURL=t.icon_url,this.proxyIconUrl=t.proxy_icon_url}}n.Thumbnail=i,n.Provider=s,n.Author=r,n.Field=o,n.Footer=a,t.exports=n},function(t,e,n){const i=n(3),s=n(10),r=n(18);class o{constructor(t,e,n,s){this.message=t,this.me=s,this.count=n||0,this.users=new i,this._emoji=new r(this,e.name,e.id)}get emoji(){if(this._emoji instanceof s)return this._emoji;if(this._emoji.id){const t=this.message.client.emojis;if(t.has(this._emoji.id)){const e=t.get(this._emoji.id);return this._emoji=e,e}}return this._emoji}remove(t=this.message.client.user){const e=this.message;return t=this.message.client.resolver.resolveUserID(t),t?e.client.rest.methods.removeMessageReaction(e,this.emoji.identifier,t):Promise.reject("Couldn't resolve the user ID to remove from the reaction.")}fetchUsers(t=100){const e=this.message;return e.client.rest.methods.getMessageReactionUsers(e,this.emoji.identifier,t).then(t=>{this.users=new i;for(const e of t){const t=this.message.client.dataManager.newUser(e);this.users.set(t.id,t)}return this.count=this.users.size,t})}}t.exports=o},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.description=t.description,this.icon=t.icon,this.iconURL=`https://cdn.discordapp.com/app-icons/${this.id}/${this.icon}.jpg`,this.rpcOrigins=t.rpc_origins}get createdTimestamp(){return this.id/4194304+14200704e5}get createdAt(){return new Date(this.createdTimestamp)}toString(){return this.name}}t.exports=n},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.icon=t.icon,this.splash=t.splash}}t.exports=n},function(t,e,n){const i=n(0);class s{constructor(t,e){Object.defineProperty(this,"client",{value:t}),this.setup(e)}setup(t){this.id=t.id,this.name=t.name,this.type=i.ChannelTypes.text===t.type?"text":"voice"}}t.exports=s},function(t,e){class n{constructor(t,e){Object.defineProperty(this,"channel",{value:t}),e&&this.setup(e)}setup(t){this.id=t.id,this.type=t.type,this.deny=t.deny,this.allow=t.allow}delete(){return this.channel.client.rest.methods.deletePermissionOverwrites(this)}}t.exports=n},function(t,e,n){const i=n(13),s=n(12),r=n(3);class o extends i{constructor(t,e){super(t,e),this.type="text",this.messages=new r,this._typing=new Map}setup(t){super.setup(t),this.topic=t.topic,this.lastMessageID=t.last_message_id}get members(){const t=new r;for(const e of this.guild.members.values())this.permissionsFor(e).hasPermission("READ_MESSAGES")&&t.set(e.id,e);return t}fetchWebhooks(){return this.client.rest.methods.getChannelWebhooks(this)}createWebhook(t,e){return new Promise(n=>{e.startsWith("data:")?n(this.client.rest.methods.createWebhook(this,t,e)):this.client.resolver.resolveBuffer(e).then(e=>n(this.client.rest.methods.createWebhook(this,t,e)))})}send(){}sendMessage(){}sendEmbed(){}sendFile(){}sendCode(){}fetchMessage(){}fetchMessages(){}fetchPinnedMessages(){}startTyping(){}stopTyping(){}get typing(){}get typingCount(){}createCollector(){}awaitMessages(){}bulkDelete(){}_cacheMessage(){}}s.applyToClass(o,!0),t.exports=o},function(t,e,n){const i=n(13),s=n(3);class r extends i{constructor(t,e){super(t,e),this.members=new s,this.type="voice"}setup(t){super.setup(t),this.bitrate=t.bitrate,this.userLimit=t.user_limit}get connection(){const t=this.guild.voiceConnection;return t&&t.channel.id===this.id?t:null}get joinable(){return!this.client.browser&&this.permissionsFor(this.client.user).hasPermission("CONNECT")}get speakable(){return this.permissionsFor(this.client.user).hasPermission("SPEAK")}setBitrate(t){return this.edit({bitrate:t})}setUserLimit(t){return this.edit({userLimit:t})}join(){return this.client.browser?Promise.reject(new Error("Voice connections are not available in browsers.")):this.client.voice.joinChannel(this)}leave(){if(!this.client.browser){const t=this.client.voice.connections.get(this.guild.id);t&&t.channel.id===this.id&&t.disconnect()}}}t.exports=r},function(t,e){t.exports=function(t,{maxLength=1950,char="\n",prepend="",append=""}={}){if(t.length<=maxLength)return t;const e=t.split(char);if(1===e.length)throw new Error("Message exceeds the max length and contains no split characters.");const n=[""];let i=0;for(let s=0;smaxLength&&(n[i]+=append,n.push(prepend),i++),n[i]+=(n[i].length>0&&n[i]!==prepend?char:"")+e[s];return n}},function(t,e,n){"use strict";function i(t,e){if(e<65537&&(t.subarray&&o||!t.subarray&&r))return String.fromCharCode.apply(null,s.shrinkBuf(t,e));for(var n="",i=0;i=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;a[254]=a[254]=1,e.string2buf=function(t){var e,n,i,r,o,a=t.length,h=0;for(r=0;r>>6,e[o++]=128|63&n):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|63&n):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|63&n);return e},e.buf2binstring=function(t){return i(t,t.length)},e.binstring2buf=function(t){for(var e=new s.Buf8(t.length),n=0,i=e.length;n4)u[s++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&n1?u[s++]=65533:r<65536?u[s++]=r:(r-=65536,u[s++]=55296|r>>10&1023,u[s++]=56320|1023&r)}return i(u,s)},e.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return n<0?e:0===n?e:n+a[t[n]]>e?n:e}},function(t,e,n){"use strict";function i(t,e,n,i){for(var s=65535&t|0,r=t>>>16&65535|0,o=0;0!==n;){o=n>2e3?2e3:n,n-=o;do s=s+e[i++]|0,r=r+s|0;while(--o);s%=65521,r%=65521}return s|r<<16|0}t.exports=i},function(t,e,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,n){"use strict";function i(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function s(t,e,n,i){var s=r,o=i+n;t^=-1;for(var a=i;a>>8^s[255&(t^e[a])];return t^-1}var r=i();t.exports=s},function(t,e,n){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=i},function(t,e){},function(t,e,n){(function(e){const i=n(23),s=n(49),r=n(25),o=n(0),a=n(53),h=n(6),u=n(11),c=n(17),l=n(9),d=n(14),f=n(10),p=n(18);class m{constructor(t){this.client=t}resolveUser(t){return t instanceof h?t:"string"==typeof t?this.client.users.get(t)||null:t instanceof d?t.user:t instanceof u?t.author:t instanceof c?t.owner:null}resolveUserID(t){return t instanceof h||t instanceof d?t.id:"string"==typeof t?t||null:t instanceof u?t.author.id:t instanceof c?t.ownerID:null}resolveGuild(t){return t instanceof c?t:"string"==typeof t?this.client.guilds.get(t)||null:null}resolveGuildMember(t,e){return e instanceof d?e:(t=this.resolveGuild(t),e=this.resolveUser(e),t&&e?t.members.get(e.id)||null:null)}resolveChannel(t){return t instanceof l?t:t instanceof u?t.channel:t instanceof c?t.channels.get(t.id)||null:"string"==typeof t?this.client.channels.get(t)||null:null}resolveInviteCode(t){const e=/discord(?:app)?\.(?:gg|com\/invite)\/([a-z0-9]{5})/i,n=e.exec(t);return n&&n[1]?n[1]:t}resolvePermission(t){if("string"==typeof t&&(t=o.PermissionFlags[t]),"number"!=typeof t||t<1)throw new Error(o.Errors.NOT_A_PERMISSION);return t}resolvePermissions(t){let e=0;for(const n of t)e|=this.resolvePermission(n);return e}resolveString(t){return"string"==typeof t?t:t instanceof Array?t.join("\n"):String(t)}resolveBase64(t){return t instanceof e?`data:image/jpg;base64,${t.toString("base64")}`:t}resolveBuffer(t){return t instanceof e?Promise.resolve(t):this.client.browser&&t instanceof ArrayBuffer?Promise.resolve(a(t)):"string"==typeof t?new Promise((n,o)=>{if(/^https?:\/\//.test(t)){const i=r.get(t).set("Content-Type","blob");this.client.browser&&i.responseType("arraybuffer"),i.end((t,i)=>{return t?o(t):this.client.browser?n(a(i.xhr.response)):i.body instanceof e?n(i.body):o(new TypeError("The response body isn't a Buffer."))})}else{const e=i.resolve(t);s.stat(e,(t,i)=>{if(t&&o(t),!i||!i.isFile())throw new Error(`The file could not be found: ${e}`);s.readFile(e,(t,e)=>{t?o(t):n(e)})})}}):Promise.reject(new TypeError("The resource must be a string or Buffer."))}resolveEmojiIdentifier(t){return t instanceof f||t instanceof p?t.identifier:"string"!=typeof t||t.includes("%")?null:encodeURIComponent(t)}}t.exports=m}).call(e,n(20).Buffer)},function(t,e,n){const i=n(114),s=n(111),r=n(113),o=n(112),a=n(110),h=n(0);class u{constructor(t){this.client=t,this.handlers={},this.userAgentManager=new i(this),this.methods=new s(this),this.rateLimitedEndpoints={},this.globallyRateLimited=!1}push(t,e){return new Promise((n,i)=>{t.push({request:e,resolve:n,reject:i})})}getRequestHandler(){switch(this.client.options.apiRequestMethod){case"sequential":return r;case"burst":return o;default:throw new Error(h.Errors.INVALID_RATE_LIMIT_METHOD)}}makeRequest(t,e,n,i,s){const r=new a(this,t,e,n,i,s);if(!this.handlers[r.route]){const t=this.getRequestHandler();this.handlers[r.route]=new t(this,r.route)}return this.push(this.handlers[r.route],r)}}t.exports=u},function(t,e){class n{constructor(t){this.restManager=t,this.queue=[]}get globalLimit(){return this.restManager.globallyRateLimited}set globalLimit(t){this.restManager.globallyRateLimited=t}push(t){this.queue.push(t)}handle(){}}t.exports=n},function(t,e,n){(function(e){function n(t){const n=new e(t.byteLength),i=new Uint8Array(t);for(var s=0;s0&&this.setInterval(this.sweepMessages.bind(this),1e3*this.options.messageSweepInterval)}get status(){return this.ws.status}get uptime(){return this.readyAt?Date.now()-this.readyAt:null}get ping(){return this.pings.reduce((t,e)=>t+e,0)/this.pings.length}get voiceConnections(){return this.browser?new Collection:this.voice.connections}get emojis(){const t=new Collection;for(const e of this.guilds.values())for(const n of e.emojis.values())t.set(n.id,n);return t}get readyTimestamp(){return this.readyAt?this.readyAt.getTime():null}get browser(){return"undefined"!=typeof window}login(t){return this.rest.methods.login(t)}destroy(){for(const t of this._timeouts)clearTimeout(t);for(const e of this._intervals)clearInterval(e);return this._timeouts.clear(),this._intervals.clear(),this.manager.destroy()}syncGuilds(t=this.guilds){this.user.bot||this.ws.send({op:12,d:t instanceof Collection?t.keyArray():t.map(t=>t.id)})}fetchUser(t){return this.users.has(t)?Promise.resolve(this.users.get(t)):this.rest.methods.getUser(t)}fetchInvite(t){const e=this.resolver.resolveInviteCode(t);return this.rest.methods.getInvite(e)}fetchWebhook(t,e){return this.rest.methods.getWebhook(t,e)}sweepMessages(t=this.options.messageCacheLifetime){if("number"!=typeof t||isNaN(t))throw new TypeError("The lifetime must be a number.");if(t<=0)return this.emit("debug","Didn't sweep messages - lifetime is unlimited"),-1;const e=1e3*t,n=Date.now();let i=0,s=0;for(const r of this.channels.values())if(r.messages){i++;for(const t of r.messages.values())n-(t.editedTimestamp||t.createdTimestamp)>e&&(r.messages.delete(t.id),s++)}return this.emit("debug",`Swept ${s} messages older than ${t} seconds in ${i} text-based channels`),s}fetchApplication(){if(!this.user.bot)throw new Error(Constants.Errors.NO_BOT_ACCOUNT);return this.rest.methods.getMyApplication()}generateInvite(t){return t?t instanceof Array&&(t=this.resolver.resolvePermissions(t)):t=0,this.fetchApplication().then(e=>`https://discordapp.com/oauth2/authorize?client_id=${e.id}&permissions=${t}&scope=bot`)}setTimeout(t,e,...n){const i=setTimeout(()=>{t(),this._timeouts.delete(i)},e,...n);return this._timeouts.add(i),i}clearTimeout(t){clearTimeout(t),this._timeouts.delete(t)}setInterval(t,e,...n){const i=setInterval(t,e,...n);return this._intervals.add(i),i}clearInterval(t){clearInterval(t),this._intervals.delete(t)}_pong(t){this.pings.unshift(Date.now()-t),this.pings.length>3&&(this.pings.length=3),this.ws.lastHeartbeatAck=!0}_setPresence(t,e){return this.presences.get(t)?void this.presences.get(t).update(e):void this.presences.set(t,new Presence(e))}_eval(script){return eval(script)}_validateOptions(t=this.options){if("number"!=typeof t.shardCount||isNaN(t.shardCount))throw new TypeError("The shardCount option must be a number.");if("number"!=typeof t.shardId||isNaN(t.shardId))throw new TypeError("The shardId option must be a number.");if(t.shardCount<0)throw new RangeError("The shardCount option must be at least 0.");if(t.shardId<0)throw new RangeError("The shardId option must be at least 0.");if(0!==t.shardId&&t.shardId>=t.shardCount)throw new RangeError("The shardId option must be less than shardCount.");if("number"!=typeof t.messageCacheMaxSize||isNaN(t.messageCacheMaxSize))throw new TypeError("The messageCacheMaxSize option must be a number.");if("number"!=typeof t.messageCacheLifetime||isNaN(t.messageCacheLifetime))throw new TypeError("The messageCacheLifetime option must be a number.");if("number"!=typeof t.messageSweepInterval||isNaN(t.messageSweepInterval))throw new TypeError("The messageSweepInterval option must be a number.");if("boolean"!=typeof t.fetchAllMembers)throw new TypeError("The fetchAllMembers option must be a boolean.");if("boolean"!=typeof t.disableEveryone)throw new TypeError("The disableEveryone option must be a boolean.");if("number"!=typeof t.restWsBridgeTimeout||isNaN(t.restWsBridgeTimeout))throw new TypeError("The restWsBridgeTimeout option must be a number.");if(!(t.disabledEvents instanceof Array))throw new TypeError("The disabledEvents option must be an Array.")}}module.exports=Client}).call(exports,__webpack_require__(24))},function(t,e,n){const i=n(19),s=n(51),r=n(50),o=n(54),a=n(0);class h extends i{constructor(t,e,n){super(null,t,e),this.options=o(a.DefaultOptions,n),this.rest=new s(this),this.resolver=new r(this)}}t.exports=h},function(t,e,n){t.exports={Client:n(55),WebhookClient:n(56),Shard:n(60),ShardClientUtil:n(61),ShardingManager:n(62),Collection:n(3),splitMessage:n(43),escapeMarkdown:n(15),fetchRecommendedShards:n(59),Channel:n(9),ClientOAuth2Application:n(28),ClientUser:n(29),DMChannel:n(30),Emoji:n(10),EvaluatedPermissions:n(16),Game:n(7).Game,GroupDMChannel:n(31),Guild:n(17),GuildChannel:n(13),GuildMember:n(14),Invite:n(32),Message:n(11),MessageAttachment:n(33),MessageCollector:n(34),MessageEmbed:n(35),MessageReaction:n(36),OAuth2Application:n(37),PartialGuild:n(38),PartialGuildChannel:n(39),PermissionOverwrites:n(40),Presence:n(7).Presence,ReactionEmoji:n(18),RichEmbed:n(58),Role:n(8),TextChannel:n(41),User:n(6),VoiceChannel:n(42),Webhook:n(19),version:n(27).version,Constants:n(0)},"undefined"!=typeof window&&(window.Discord=t.exports)},function(t,e){function n(t){return"string"==typeof t?t:t instanceof Array?t.join("\n"):String(t)}class i{constructor(t={}){this.title=t.title,this.description=t.description,this.url=t.url,this.color=t.color,this.author=t.author,this.timestamp=t.timestamp,this.fields=t.fields||[],this.thumbnail=t.thumbnail,this.image=t.image,this.footer=t.footer}setTitle(t){if(t=n(t),t.length>256)throw new RangeError("RichEmbed titles may not exceed 256 characters.");return this.title=t,this}setDescription(t){if(t=n(t),t.length>2048)throw new RangeError("RichEmbed descriptions may not exceed 2048 characters.");return this.description=t,this}setURL(t){return this.url=t,this}setColor(t){let e=10;if(t instanceof Array?t=(t[0]<<16)+(t[1]<<8)+t[2]:"string"==typeof t&&t.startsWith("#")&&(e=16,t=t.replace("#","")),t=parseInt(t,e),t<0||t>16777215)throw new RangeError("RichEmbed color must be within the range 0 - 16777215 (0xFFFFFF).");if(t&&isNaN(t))throw new TypeError("Unable to convert RichEmbed color to a number.");return this.color=t,this}setAuthor(t,e,i){return this.author={name:n(t),icon_url:e,url:i},this}setTimestamp(t=new Date){return this.timestamp=t,this}addField(t,e,i=false){if(this.fields.length>=25)throw new RangeError("RichEmbeds may not exceed 25 fields.");if(t=n(t),t.length>256)throw new RangeError("RichEmbed field names may not exceed 256 characters.");if(e=n(e),e.length>1024)throw new RangeError("RichEmbed field values may not exceed 1024 characters.");return this.fields.push({name:String(t),value:e,inline:i}),this}setThumbnail(t){return this.thumbnail={url:t},this}setImage(t){return this.image={url:t},this}setFooter(t,e){if(t=n(t),t.length>2048)throw new RangeError("RichEmbed footer text may not exceed 2048 characters.");return this.footer={text:t,icon_url:e},this}}t.exports=i},function(t,e,n){const i=n(25),s=n(0).Endpoints.botGateway;t.exports=function(t){return new Promise((e,n)=>{if(!t)throw new Error("A token must be provided.");i.get(s).set("Authorization",`Bot ${t.replace(/^Bot\s*/i,"")}`).end((t,i)=>{t&&n(t),e(i.body.shards)})})}},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";function i(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function s(t){return 3*t.length/4-i(t)}function r(t){var e,n,s,r,o,a,h=t.length;o=i(t),a=new l(3*h/4-o),s=o>0?h-4:h;var u=0;for(e=0,n=0;e>16&255,a[u++]=r>>8&255,a[u++]=255&r;return 2===o?(r=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,a[u++]=255&r):1===o&&(r=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,a[u++]=r>>8&255,a[u++]=255&r),a}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,n){for(var i,s=[],r=e;rc?c:h+o));return 1===i?(e=t[n-1],s+=u[e>>2],s+=u[e<<4&63],s+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],s+=u[e>>10],s+=u[e>>4&63],s+=u[e<<2&63],s+="="),r.push(s),r.join("")}e.byteLength=s,e.toByteArray=r,e.fromByteArray=h;for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,p=d.length;f>1,c=-7,l=n?s-1:0,d=n?-1:1,f=t[e+l];for(l+=d,r=f&(1<<-c)-1,f>>=-c,c+=a;c>0;r=256*r+t[e+l],l+=d,c-=8);for(o=r&(1<<-c)-1,r>>=-c,c+=i;c>0;o=256*o+t[e+l],l+=d,c-=8);if(0===r)r=1-u;else{if(r===h)return o?NaN:(f?-1:1)*(1/0);o+=Math.pow(2,i),r-=u}return(f?-1:1)*o*Math.pow(2,r-i)},e.write=function(t,e,n,i,s,r){var o,a,h,u=8*r-s-1,c=(1<>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:r-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),e+=o+l>=1?d/h:d*Math.pow(2,1-l),e*h>=2&&(o++,h/=2),o+l>=c?(a=0,o=c):o+l>=1?(a=(e*h-1)*Math.pow(2,s),o+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,s),o=0));s>=8;t[n+f]=255&a,f+=p,a/=256,s-=8);for(o=o<0;t[n+f]=255&o,f+=p,o/=256,u-=8);t[n+f-p]|=128*m}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";var i=n(5).assign,s=n(68),r=n(69),o=n(46),a={};i(a,s,r,o),t.exports=a},function(t,e,n){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=h.assign({level:E,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:w,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=a.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==m)throw new Error(c[n]);if(e.header&&a.deflateSetHeader(this.strm,e.header),e.dictionary){var s;if(s="string"==typeof e.dictionary?u.string2buf(e.dictionary):"[object ArrayBuffer]"===d.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=a.deflateSetDictionary(this.strm,s),n!==m)throw new Error(c[n]);this._dict_set=!0}}function s(t,e){var n=new i(e);if(n.push(t,!0),n.err)throw n.msg||c[n.err];return n.result}function r(t,e){return e=e||{},e.raw=!0,s(t,e)}function o(t,e){return e=e||{},e.gzip=!0,s(t,e)}var a=n(70),h=n(5),u=n(44),c=n(22),l=n(48),d=Object.prototype.toString,f=0,p=4,m=0,g=1,_=2,E=-1,w=0,v=8;i.prototype.push=function(t,e){var n,i,s=this.strm,r=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:e===!0?p:f,"string"==typeof t?s.input=u.string2buf(t):"[object ArrayBuffer]"===d.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new h.Buf8(r),s.next_out=0,s.avail_out=r),n=a.deflate(s,i),n!==g&&n!==m)return this.onEnd(n),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||i!==p&&i!==_)||("string"===this.options.to?this.onData(u.buf2binstring(h.shrinkBuf(s.output,s.next_out))):this.onData(h.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&n!==g);return i===p?(n=a.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===m):i!==_||(this.onEnd(m),s.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===m&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=i,e.deflate=s,e.deflateRaw=r,e.gzip=o},function(t,e,n){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=o.inflateInit2(this.strm,e.windowBits);if(n!==u.Z_OK)throw new Error(c[n]);this.header=new d,o.inflateGetHeader(this.strm,this.header)}function s(t,e){var n=new i(e);if(n.push(t,!0),n.err)throw n.msg||c[n.err];return n.result}function r(t,e){return e=e||{},e.raw=!0,s(t,e)}var o=n(73),a=n(5),h=n(44),u=n(46),c=n(22),l=n(48),d=n(71),f=Object.prototype.toString;i.prototype.push=function(t,e){var n,i,s,r,c,l,d=this.strm,p=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof t?d.input=h.binstring2buf(t):"[object ArrayBuffer]"===f.call(t)?d.input=new Uint8Array(t):d.input=t,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new a.Buf8(p),d.next_out=0,d.avail_out=p),n=o.inflate(d,u.Z_NO_FLUSH),n===u.Z_NEED_DICT&&m&&(l="string"==typeof m?h.string2buf(m):"[object ArrayBuffer]"===f.call(m)?new Uint8Array(m):m,n=o.inflateSetDictionary(this.strm,l)),n===u.Z_BUF_ERROR&&g===!0&&(n=u.Z_OK,g=!1),n!==u.Z_STREAM_END&&n!==u.Z_OK)return this.onEnd(n),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&n!==u.Z_STREAM_END&&(0!==d.avail_in||i!==u.Z_FINISH&&i!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(s=h.utf8border(d.output,d.next_out),r=d.next_out-s,c=h.buf2string(d.output,s),d.next_out=r,d.avail_out=p-r,r&&a.arraySet(d.output,d.output,s,r,0),this.onData(c)):this.onData(a.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(g=!0)}while((d.avail_in>0||0===d.avail_out)&&n!==u.Z_STREAM_END);return n===u.Z_STREAM_END&&(i=u.Z_FINISH),i===u.Z_FINISH?(n=o.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u.Z_OK):i!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),d.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=i,e.inflate=s,e.inflateRaw=r,e.ungzip=s},function(t,e,n){ +"use strict";function i(t,e){return t.msg=U[e],e}function s(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function o(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(I.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function a(t,e){C._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,o(t.strm)}function h(t,e){t.pending_buf[t.pending++]=e}function u(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function c(t,e,n,i){var s=t.avail_in;return s>i&&(s=i),0===s?0:(t.avail_in-=s,I.arraySet(e,t.input,t.next_in,s,n),1===t.state.wrap?t.adler=x(t.adler,e,s,n):2===t.state.wrap&&(t.adler=L(t.adler,e,s,n)),t.next_in+=s,t.total_in+=s,s)}function l(t,e){var n,i,s=t.max_chain_length,r=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-lt?t.strstart-(t.w_size-lt):0,u=t.window,c=t.w_mask,l=t.prev,d=t.strstart+ct,f=u[r+o-1],p=u[r+o];t.prev_length>=t.good_match&&(s>>=2),a>t.lookahead&&(a=t.lookahead);do if(n=e,u[n+o]===p&&u[n+o-1]===f&&u[n]===u[r]&&u[++n]===u[r+1]){r+=2,n++;do;while(u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&u[++r]===u[++n]&&ro){if(t.match_start=e,o=i,i>=a)break;f=u[r+o-1],p=u[r+o]}}while((e=l[e&c])>h&&0!==--s);return o<=t.lookahead?o:t.lookahead}function d(t){var e,n,i,s,r,o=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=o+(o-lt)){I.arraySet(t.window,t.window,o,o,0),t.match_start-=o,t.strstart-=o,t.block_start-=o,n=t.hash_size,e=n;do i=t.head[--e],t.head[e]=i>=o?i-o:0;while(--n);n=o,e=n;do i=t.prev[--e],t.prev[e]=i>=o?i-o:0;while(--n);s+=o}if(0===t.strm.avail_in)break;if(n=c(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=ut)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(d(t),0===t.lookahead&&e===P)return vt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,a(t,!1),0===t.strm.avail_out))return vt;if(t.strstart-t.block_start>=t.w_size-lt&&(a(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===B?(a(t,!0),0===t.strm.avail_out?yt:At):t.strstart>t.block_start&&(a(t,!1),0===t.strm.avail_out)?vt:vt}function p(t,e){for(var n,i;;){if(t.lookahead=ut&&(t.ins_h=(t.ins_h<=ut)if(i=C._tr_tally(t,t.strstart-t.match_start,t.match_length-ut),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ut){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=ut&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=ut-1)),t.prev_length>=ut&&t.match_length<=t.prev_length){s=t.strstart+t.lookahead-ut,i=C._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ut),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=s&&(t.ins_h=(t.ins_h<=ut&&t.strstart>0&&(s=t.strstart-1,i=o[s],i===o[++s]&&i===o[++s]&&i===o[++s])){r=t.strstart+ct;do;while(i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&st.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ut?(n=C._tr_tally(t,1,t.match_length-ut),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(a(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===B?(a(t,!0),0===t.strm.avail_out?yt:At):t.last_lit&&(a(t,!1),0===t.strm.avail_out)?vt:bt}function _(t,e){for(var n;;){if(0===t.lookahead&&(d(t),0===t.lookahead)){if(e===P)return vt;break}if(t.match_length=0,n=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(a(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===B?(a(t,!0),0===t.strm.avail_out?yt:At):t.last_lit&&(a(t,!1),0===t.strm.avail_out)?vt:bt}function E(t,e,n,i,s){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=s}function w(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=S[t.level].max_lazy,t.good_match=S[t.level].good_length,t.nice_match=S[t.level].nice_length,t.max_chain_length=S[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ut-1,t.match_available=0,t.ins_h=0}function v(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=X,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new I.Buf16(2*at),this.dyn_dtree=new I.Buf16(2*(2*rt+1)),this.bl_tree=new I.Buf16(2*(2*ot+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new I.Buf16(ht+1),this.heap=new I.Buf16(2*st+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new I.Buf16(2*st+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function b(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=J,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ft:Et,t.adler=2===e.wrap?0:1,e.last_flush=P,C._tr_init(e),j):i(t,z)}function y(t){var e=b(t);return e===j&&w(t.state),e}function A(t,e){return t&&t.state?2!==t.state.wrap?z:(t.state.gzhead=e,j):z}function k(t,e,n,s,r,o){if(!t)return z;var a=1;if(e===F&&(e=6),s<0?(a=0,s=-s):s>15&&(a=2,s-=16),r<1||r>Q||n!==X||s<8||s>15||e<0||e>9||o<0||o>Z)return i(t,z);8===s&&(s=9);var h=new v;return t.state=h,h.strm=t,h.wrap=a,h.gzhead=null,h.w_bits=s,h.w_size=1<G||e<0)return t?i(t,z):z;if(a=t.state,!t.output||!t.input&&0!==t.avail_in||a.status===wt&&e!==B)return i(t,0===t.avail_out?W:z);if(a.strm=t,n=a.last_flush,a.last_flush=e,a.status===ft)if(2===a.wrap)t.adler=0,h(a,31),h(a,139),h(a,8),a.gzhead?(h(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),h(a,255&a.gzhead.time),h(a,a.gzhead.time>>8&255),h(a,a.gzhead.time>>16&255),h(a,a.gzhead.time>>24&255),h(a,9===a.level?2:a.strategy>=V||a.level<2?4:0),h(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(h(a,255&a.gzhead.extra.length),h(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=L(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=pt):(h(a,0),h(a,0),h(a,0),h(a,0),h(a,0),h(a,9===a.level?2:a.strategy>=V||a.level<2?4:0),h(a,kt),a.status=Et);else{var d=X+(a.w_bits-8<<4)<<8,f=-1;f=a.strategy>=V||a.level<2?0:a.level<6?1:6===a.level?2:3,d|=f<<6,0!==a.strstart&&(d|=dt),d+=31-d%31,a.status=Et,u(a,d),0!==a.strstart&&(u(a,t.adler>>>16),u(a,65535&t.adler)),t.adler=1}if(a.status===pt)if(a.gzhead.extra){for(c=a.pending;a.gzindex<(65535&a.gzhead.extra.length)&&(a.pending!==a.pending_buf_size||(a.gzhead.hcrc&&a.pending>c&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),o(t),c=a.pending,a.pending!==a.pending_buf_size));)h(a,255&a.gzhead.extra[a.gzindex]),a.gzindex++;a.gzhead.hcrc&&a.pending>c&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=mt)}else a.status=mt;if(a.status===mt)if(a.gzhead.name){c=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>c&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),o(t),c=a.pending,a.pending===a.pending_buf_size)){l=1;break}l=a.gzindexc&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),0===l&&(a.gzindex=0,a.status=gt)}else a.status=gt;if(a.status===gt)if(a.gzhead.comment){c=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>c&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),o(t),c=a.pending,a.pending===a.pending_buf_size)){l=1;break}l=a.gzindexc&&(t.adler=L(t.adler,a.pending_buf,a.pending-c,c)),0===l&&(a.status=_t)}else a.status=_t;if(a.status===_t&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&o(t),a.pending+2<=a.pending_buf_size&&(h(a,255&t.adler),h(a,t.adler>>8&255),t.adler=0,a.status=Et)):a.status=Et),0!==a.pending){if(o(t),0===t.avail_out)return a.last_flush=-1,j}else if(0===t.avail_in&&s(e)<=s(n)&&e!==B)return i(t,W);if(a.status===wt&&0!==t.avail_in)return i(t,W);if(0!==t.avail_in||0!==a.lookahead||e!==P&&a.status!==wt){var p=a.strategy===V?_(a,e):a.strategy===K?g(a,e):S[a.level].func(a,e);if(p!==yt&&p!==At||(a.status=wt),p===vt||p===yt)return 0===t.avail_out&&(a.last_flush=-1),j;if(p===bt&&(e===N?C._tr_align(a):e!==G&&(C._tr_stored_block(a,0,0,!1),e===O&&(r(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),o(t),0===t.avail_out))return a.last_flush=-1,j}return e!==B?j:a.wrap<=0?q:(2===a.wrap?(h(a,255&t.adler),h(a,t.adler>>8&255),h(a,t.adler>>16&255),h(a,t.adler>>24&255),h(a,255&t.total_in),h(a,t.total_in>>8&255),h(a,t.total_in>>16&255),h(a,t.total_in>>24&255)):(u(a,t.adler>>>16),u(a,65535&t.adler)),o(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?j:q)}function D(t){var e;return t&&t.state?(e=t.state.status,e!==ft&&e!==pt&&e!==mt&&e!==gt&&e!==_t&&e!==Et&&e!==wt?i(t,z):(t.state=null,e===Et?i(t,H):j)):z}function M(t,e){var n,i,s,o,a,h,u,c,l=e.length;if(!t||!t.state)return z;if(n=t.state,o=n.wrap,2===o||1===o&&n.status!==ft||n.lookahead)return z;for(1===o&&(t.adler=x(t.adler,e,l,0)),n.wrap=0,l>=n.w_size&&(0===o&&(r(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new I.Buf8(n.w_size),I.arraySet(c,e,l-n.w_size,n.w_size,0),e=c,l=n.w_size),a=t.avail_in,h=t.next_in,u=t.input,t.avail_in=l,t.next_in=0,t.input=e,d(n);n.lookahead>=ut;){i=n.strstart,s=n.lookahead-(ut-1);do n.ins_h=(n.ins_h<>>24,m>>>=y,g-=y,y=b>>>16&255,0===y)M[a++]=65535&b;else{if(!(16&y)){if(0===(64&y)){b=_[(65535&b)+(m&(1<>>=y,g-=y),g<15&&(m+=D[r++]<>>24,m>>>=y,g-=y,y=b>>>16&255,!(16&y)){if(0===(64&y)){b=E[(65535&b)+(m&(1<c){t.msg="invalid distance too far back",n.mode=i;break t}if(m>>>=y,g-=y,y=a-h,k>y){if(y=k-y,y>d&&n.sane){t.msg="invalid distance too far back",n.mode=i;break t}if(R=0,T=p,0===f){if(R+=l-y,y2;)M[a++]=T[R++],M[a++]=T[R++],M[a++]=T[R++],A-=3;A&&(M[a++]=T[R++],A>1&&(M[a++]=T[R++]))}else{R=a-k;do M[a++]=M[R++],M[a++]=M[R++],M[a++]=M[R++],A-=3;while(A>2);A&&(M[a++]=M[R++],A>1&&(M[a++]=M[R++]))}break}}break}}while(r>3,r-=A,g-=A<<3,m&=(1<>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new E.Buf16(320),this.work=new E.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=O,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new E.Buf32(mt),e.distcode=e.distdyn=new E.Buf32(gt),e.sane=1,e.back=-1,S):x}function o(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):x}function a(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?x:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,o(t))):x}function h(t,e){var n,i;return t?(i=new s,t.state=i,i.window=null,n=a(t,e),n!==S&&(t.state=null),n):x}function u(t){return h(t,Et)}function c(t){if(wt){var e;for(g=new E.Buf32(512),_=new E.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(y(k,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;y(R,t.lens,0,32,_,0,t.work,{bits:5}),wt=!1}t.lencode=g,t.lenbits=9,t.distcode=_,t.distbits=5}function l(t,e,n,i){var s,r=t.state;return null===r.window&&(r.wsize=1<=r.wsize?(E.arraySet(r.window,e,n-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(s=r.wsize-r.wnext,s>i&&(s=i),E.arraySet(r.window,e,n-i,s,r.wnext),i-=s,i?(E.arraySet(r.window,e,n-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=s,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,n.check=v(n.check,Dt,2,0),d=0,f=0,n.mode=B;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){t.msg="incorrect header check",n.mode=dt;break}if((15&d)!==N){t.msg="unknown compression method",n.mode=dt;break}if(d>>>=4,f-=4,yt=(15&d)+8,0===n.wbits)n.wbits=yt;else if(yt>n.wbits){t.msg="invalid window size",n.mode=dt;break}n.dmax=1<>8&1),512&n.flags&&(Dt[0]=255&d,Dt[1]=d>>>8&255,n.check=v(n.check,Dt,2,0)),d=0,f=0,n.mode=G;case G:for(;f<32;){if(0===h)break t;h--,d+=s[o++]<>>8&255,Dt[2]=d>>>16&255,Dt[3]=d>>>24&255,n.check=v(n.check,Dt,4,0)),d=0,f=0,n.mode=j;case j:for(;f<16;){if(0===h)break t;h--,d+=s[o++]<>8),512&n.flags&&(Dt[0]=255&d,Dt[1]=d>>>8&255,n.check=v(n.check,Dt,2,0)),d=0,f=0,n.mode=q;case q:if(1024&n.flags){for(;f<16;){if(0===h)break t;h--,d+=s[o++]<>>8&255,n.check=v(n.check,Dt,2,0)),d=0,f=0}else n.head&&(n.head.extra=null);n.mode=z;case z:if(1024&n.flags&&(g=n.length,g>h&&(g=h),g&&(n.head&&(yt=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),E.arraySet(n.head.extra,s,o,g,yt)),512&n.flags&&(n.check=v(n.check,s,g,o)),h-=g,o+=g,n.length-=g),n.length))break t;n.length=0,n.mode=H;case H:if(2048&n.flags){if(0===h)break t;g=0;do yt=s[o+g++],n.head&&yt&&n.length<65536&&(n.head.name+=String.fromCharCode(yt));while(yt&&g>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=K;break;case Y:for(;f<32;){if(0===h)break t;h--,d+=s[o++]<>>=7&f,f-=7&f,n.mode=ut;break}for(;f<3;){if(0===h)break t;h--,d+=s[o++]<>>=1,f-=1,3&d){case 0:n.mode=$;break;case 1:if(c(n),n.mode=nt,e===M){d>>>=2,f-=2;break t}break;case 2:n.mode=Q;break;case 3:t.msg="invalid block type",n.mode=dt}d>>>=2,f-=2;break;case $:for(d>>>=7&f,f-=7&f;f<32;){if(0===h)break t;h--,d+=s[o++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=dt;break}if(n.length=65535&d,d=0,f=0,n.mode=J,e===M)break t;case J:n.mode=X;case X:if(g=n.length){if(g>h&&(g=h),g>u&&(g=u),0===g)break t;E.arraySet(r,s,o,g,a),h-=g,o+=g,u-=g,a+=g,n.length-=g;break}n.mode=K;break;case Q:for(;f<14;){if(0===h)break t;h--,d+=s[o++]<>>=5,f-=5,n.ndist=(31&d)+1,d>>>=5,f-=5,n.ncode=(15&d)+4,d>>>=4,f-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=dt;break}n.have=0,n.mode=tt;case tt:for(;n.have>>=3,f-=3}for(;n.have<19;)n.lens[Mt[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,kt={bits:n.lenbits},At=y(A,n.lens,0,19,n.lencode,0,n.work,kt),n.lenbits=kt.bits,At){t.msg="invalid code lengths set",n.mode=dt;break}n.have=0,n.mode=et;case et:for(;n.have>>24,_t=Tt>>>16&255,Et=65535&Tt,!(gt<=f);){if(0===h)break t;h--,d+=s[o++]<>>=gt,f-=gt,n.lens[n.have++]=Et;else{if(16===Et){for(Rt=gt+2;f>>=gt,f-=gt,0===n.have){t.msg="invalid bit length repeat",n.mode=dt;break}yt=n.lens[n.have-1],g=3+(3&d),d>>>=2,f-=2}else if(17===Et){for(Rt=gt+3;f>>=gt,f-=gt,yt=0,g=3+(7&d),d>>>=3,f-=3}else{for(Rt=gt+7;f>>=gt,f-=gt,yt=0,g=11+(127&d),d>>>=7,f-=7}if(n.have+g>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=dt;break}for(;g--;)n.lens[n.have++]=yt}}if(n.mode===dt)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=dt;break}if(n.lenbits=9,kt={bits:n.lenbits},At=y(k,n.lens,0,n.nlen,n.lencode,0,n.work,kt),n.lenbits=kt.bits,At){t.msg="invalid literal/lengths set",n.mode=dt;break}if(n.distbits=6,n.distcode=n.distdyn,kt={bits:n.distbits},At=y(R,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,kt),n.distbits=kt.bits,At){t.msg="invalid distances set",n.mode=dt;break}if(n.mode=nt,e===M)break t;case nt:n.mode=it;case it:if(h>=6&&u>=258){t.next_out=a,t.avail_out=u,t.next_in=o,t.avail_in=h,n.hold=d,n.bits=f,b(t,m),a=t.next_out,r=t.output,u=t.avail_out,o=t.next_in,s=t.input,h=t.avail_in,d=n.hold,f=n.bits,n.mode===K&&(n.back=-1);break}for(n.back=0;Tt=n.lencode[d&(1<>>24,_t=Tt>>>16&255,Et=65535&Tt,!(gt<=f);){if(0===h)break t;h--,d+=s[o++]<>wt)],gt=Tt>>>24,_t=Tt>>>16&255,Et=65535&Tt,!(wt+gt<=f);){if(0===h)break t;h--,d+=s[o++]<>>=wt,f-=wt,n.back+=wt}if(d>>>=gt,f-=gt,n.back+=gt,n.length=Et,0===_t){n.mode=ht;break}if(32&_t){n.back=-1,n.mode=K;break}if(64&_t){t.msg="invalid literal/length code",n.mode=dt;break}n.extra=15&_t,n.mode=st;case st:if(n.extra){for(Rt=n.extra;f>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=rt;case rt:for(;Tt=n.distcode[d&(1<>>24,_t=Tt>>>16&255,Et=65535&Tt,!(gt<=f);){if(0===h)break t;h--,d+=s[o++]<>wt)],gt=Tt>>>24,_t=Tt>>>16&255,Et=65535&Tt,!(wt+gt<=f);){if(0===h)break t;h--,d+=s[o++]<>>=wt,f-=wt,n.back+=wt}if(d>>>=gt,f-=gt,n.back+=gt,64&_t){t.msg="invalid distance code",n.mode=dt;break}n.offset=Et,n.extra=15&_t,n.mode=ot;case ot:if(n.extra){for(Rt=n.extra;f>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=dt;break}n.mode=at;case at:if(0===u)break t;if(g=m-u,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=dt;break}g>n.wnext?(g-=n.wnext,_=n.wsize-g):_=n.wnext-g,g>n.length&&(g=n.length),mt=n.window}else mt=r,_=a-n.offset,g=n.length;g>u&&(g=u),u-=g,n.length-=g;do r[a++]=mt[_++];while(--g);0===n.length&&(n.mode=it);break;case ht:if(0===u)break t;r[a++]=n.length,u--,n.mode=it;break;case ut:if(n.wrap){for(;f<32;){if(0===h)break t;h--,d|=s[o++]<=1&&0===q[x];x--);if(L>x&&(L=x),0===x)return m[g++]=20971520,m[g++]=20971520,E.bits=1,0;for(C=1;C0&&(t===a||1!==x))return-1;for(z[1]=0,S=1;Sr||t===u&&O>o)return 1;for(;;){R=S-P,_[I]k?(T=H[W+_[I]],D=G[j+_[I]]):(T=96,D=0),w=1<>P)+v]=R<<24|T<<16|D|0;while(0!==v);for(w=1<>=1;if(0!==w?(B&=w-1,B+=w):B=0,I++,0===--q[S]){if(S===x)break;S=e[n+_[I]]}if(S>L&&(B&y)!==b){for(0===P&&(P=L),A+=C,U=S-P,N=1<r||t===u&&O>o)return 1;b=B&y,m[b]=L<<24|U<<16|A-g|0}}return 0!==B&&(m[A+B]=S-P<<24|64<<16|0),E.bits=L,0}},function(t,e,n){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t,e,n,i,s){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=s,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function o(t){return t<256?ht[t]:ht[256+(t>>>7)]}function a(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function h(t,e,n){t.bi_valid>Z-n?(t.bi_buf|=e<>Z-t.bi_valid,t.bi_valid+=n-Z):(t.bi_buf|=e<>>=1,n<<=1;while(--e>0);return n>>>1}function l(t){16===t.bi_valid?(a(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function d(t,e){var n,i,s,r,o,a,h=e.dyn_tree,u=e.max_code,c=e.stat_desc.static_tree,l=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(r=0;r<=K;r++)t.bl_count[r]=0;for(h[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;np&&(r=p,m++),h[2*i+1]=r,i>u||(t.bl_count[r]++,o=0,i>=f&&(o=d[i-f]),a=h[2*i],t.opt_len+=a*(r+o),l&&(t.static_len+=a*(c[2*i+1]+o)));if(0!==m){do{for(r=p-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(r=p;0!==r;r--)for(i=t.bl_count[r];0!==i;)s=t.heap[--n],s>u||(h[2*s+1]!==r&&(t.opt_len+=(r-h[2*s+1])*h[2*s],h[2*s+1]=r),i--)}}function f(t,e,n){var i,s,r=new Array(K+1),o=0;for(i=1;i<=K;i++)r[i]=o=o+n[i-1]<<1;for(s=0;s<=e;s++){var a=t[2*s+1];0!==a&&(t[2*s]=c(r[a]++,a))}}function p(){var t,e,n,i,r,o=new Array(K+1);for(n=0,i=0;i>=7;i8?a(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function _(t,e,n,i){g(t),i&&(a(t,n),a(t,~n)),x.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function E(t,e,n,i){var s=2*e,r=2*n;return t[s]>1;n>=1;n--)w(t,r,n);s=h;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],w(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,r[2*s]=r[2*n]+r[2*i],t.depth[s]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,r[2*n+1]=r[2*i+1]=s,t.heap[1]=s++,w(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],d(t,e),f(r,u,t.bl_count)}function y(t,e,n){var i,s,r=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)s=o,o=e[2*(i+1)+1],++a=3&&0===t.bl_tree[2*st[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function R(t,e,n,i){var s;for(h(t,e-257,5),h(t,n-1,5),h(t,i-4,4),s=0;s>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return U;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return P;for(e=32;e0?(t.strm.data_type===N&&(t.strm.data_type=T(t)),b(t,t.l_desc),b(t,t.d_desc),o=k(t),s=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=s&&(s=r)):s=r=n+5,n+4<=s&&e!==-1?M(t,e,n,i):t.strategy===L||r===s?(h(t,(B<<1)+(i?1:0),3),v(t,ot,at)):(h(t,(G<<1)+(i?1:0),3),R(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),v(t,t.dyn_ltree,t.dyn_dtree)),m(t),i&&g(t)}function C(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(ut[n]+H+1)]++,t.dyn_dtree[2*o(e)]++),t.last_lit===t.lit_bufsize-1}var x=n(5),L=4,U=0,P=1,N=2,O=0,B=1,G=2,j=3,q=258,z=29,H=256,W=H+1+z,F=30,Y=19,V=2*W+1,K=15,Z=16,$=7,J=256,X=16,Q=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],nt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],st=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,ot=new Array(2*(W+2));i(ot);var at=new Array(2*F);i(at);var ht=new Array(rt);i(ht);var ut=new Array(q-j+1);i(ut);var ct=new Array(z);i(ct);var lt=new Array(F);i(lt);var dt,ft,pt,mt=!1;e._tr_init=D,e._tr_stored_block=M,e._tr_flush_block=I,e._tr_tally=C,e._tr_align=S},function(t,e,n){function i(t){var e=s(t)?Object.prototype.toString.call(t):"";return"[object Function]"===e}var s=n(26);t.exports=i},function(t,e,n){function i(t){if(t)return s(t)}function s(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}var r=n(26);t.exports=i,i.prototype.clearTimeout=function(){return this._timeout=0,this._responseTimeout=0,clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),this},i.prototype.parse=function(t){return this._parser=t,this},i.prototype.responseType=function(t){return this._responseType=t,this},i.prototype.serialize=function(t){return this._serializer=t,this},i.prototype.timeout=function(t){return t&&"object"==typeof t?("undefined"!=typeof t.deadline&&(this._timeout=t.deadline),"undefined"!=typeof t.response&&(this._responseTimeout=t.response),this):(this._timeout=t,this._responseTimeout=0,this)},i.prototype.then=function(t,e){if(!this._fullfilledPromise){var n=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(t,e){n.end(function(n,i){n?e(n):t(i)})})}return this._fullfilledPromise.then(t,e)},i.prototype.catch=function(t){return this.then(void 0,t)},i.prototype.use=function(t){return t(this),this},i.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},i.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},i.prototype.get=function(t){return this._header[t.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(t,e){if(r(t)){for(var n in t)this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},i.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},i.prototype.field=function(t,e){if(null===t||void 0===t)throw new Error(".field(name, val) name can not be empty");if(r(t)){for(var n in t)this.field(n,t[n]);return this}if(Array.isArray(e)){for(var i in e)this.field(t,e[i]);return this}if(null===e||void 0===e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=""+e),this._getFormData().append(t,e),this},i.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},i.prototype.withCredentials=function(){return this._withCredentials=!0,this},i.prototype.redirects=function(t){return this._maxRedirects=t,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(t){var e=r(t),n=this._header["content-type"];if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(e&&r(this._data))for(var i in t)this._data[i]=t[i];else"string"==typeof t?(n||this.type("form"),n=this._header["content-type"],"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+t:t:this._data=(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(n||this.type("json"),this)},i.prototype.sortQuery=function(t){return this._sort="undefined"==typeof t||t,this},i.prototype._timeoutError=function(t,e){if(!this._aborted){var n=new Error(t+e+"ms exceeded");n.timeout=e,n.code="ECONNABORTED",this.timedout=!0,this.abort(),this.callback(n)}},i.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout)},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout)},this._responseTimeout))}},function(t,e,n){function i(t){if(t)return s(t)}function s(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}var r=n(79);t.exports=i,i.prototype.get=function(t){return this.header[t.toLowerCase()]},i.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=r.type(e);var n=r.params(e);for(var i in n)this[i]=n[i];this.links={};try{t.link&&(this.links=r.parseLinks(t.link))}catch(t){}},i.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t}},function(t,e){e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){return t.split(/ *; */).reduce(function(t,e){var n=e.split(/ *= */),i=n.shift(),s=n.shift();return i&&s&&(t[i]=s),t},{})},e.parseLinks=function(t){return t.split(/ *, */).reduce(function(t,e){var n=e.split(/ *; */),i=n[0].slice(1,-1),s=n[1].split(/ *= */)[1].slice(1,-1);return t[s]=i,t},{})},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&delete t.cookie,t}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){const i=n(0),s=n(4),r=n(17),o=n(6),a=n(30),h=n(10),u=n(41),c=n(42),l=n(13),d=n(31);class f{constructor(t){this.client=t}get pastReady(){return this.client.ws.status===i.Status.READY}newGuild(t){const e=this.client.guilds.has(t.id),n=new r(this.client,t);return this.client.guilds.set(n.id,n),this.pastReady&&!e&&(this.client.options.fetchAllMembers?n.fetchMembers().then(()=>{this.client.emit(i.Events.GUILD_CREATE,n)}):this.client.emit(i.Events.GUILD_CREATE,n)),n}newUser(t){if(this.client.users.has(t.id))return this.client.users.get(t.id);const e=new o(this.client,t);return this.client.users.set(e.id,e),e}newChannel(t,e){const n=this.client.channels.has(t.id);let s;return t.type===i.ChannelTypes.DM?s=new a(this.client,t):t.type===i.ChannelTypes.groupDM?s=new d(this.client,t):(e=e||this.client.guilds.get(t.guild_id),e&&(t.type===i.ChannelTypes.text?(s=new u(e,t),e.channels.set(s.id,s)):t.type===i.ChannelTypes.voice&&(s=new c(e,t),e.channels.set(s.id,s)))),s?(this.pastReady&&!n&&this.client.emit(i.Events.CHANNEL_CREATE,s),this.client.channels.set(s.id,s),s):null}newEmoji(t,e){const n=e.emojis.has(t.id);if(t&&!n){let n=new h(e,t);return this.client.emit(i.Events.GUILD_EMOJI_CREATE,n),e.emojis.set(n.id,n),n}return n?e.emojis.get(t.id):null}killEmoji(t){t instanceof h&&t.guild&&(this.client.emit(i.Events.GUILD_EMOJI_DELETE,t),t.guild.emojis.delete(t.id))}killGuild(t){const e=this.client.guilds.has(t.id);this.client.guilds.delete(t.id),e&&this.pastReady&&this.client.emit(i.Events.GUILD_DELETE,t)}killUser(t){this.client.users.delete(t.id)}killChannel(t){this.client.channels.delete(t.id),t instanceof l&&t.guild.channels.delete(t.id)}updateGuild(t,e){const n=s(t);t.setup(e),this.pastReady&&this.client.emit(i.Events.GUILD_UPDATE,n,t)}updateChannel(t,e){t.setup(e)}updateEmoji(t,e){const n=s(t);t.setup(e),this.client.emit(i.Events.GUILD_EMOJI_UPDATE,n,t)}}t.exports=f},function(t,e,n){const i=n(0);class s{constructor(t){this.client=t,this.heartbeatInterval=null}connectToWebSocket(t,e,n){this.client.emit(i.Events.DEBUG,`Authenticated using token ${t}`),this.client.token=t;const s=this.client.setTimeout(()=>n(new Error(i.Errors.TOOK_TOO_LONG)),3e5);this.client.rest.methods.getGateway().then(r=>{this.client.emit(i.Events.DEBUG,`Using gateway ${r}`),this.client.ws.connect(r),this.client.ws.once("close",t=>{4004===t.code&&n(new Error(i.Errors.BAD_LOGIN)),4010===t.code&&n(new Error(i.Errors.INVALID_SHARD))}),this.client.once(i.Events.READY,()=>{e(t),this.client.clearTimeout(s)})},n)}setupKeepAlive(t){this.heartbeatInterval=this.client.setInterval(()=>this.client.ws.heartbeat(!0),t)}destroy(){return this.client.ws.destroy(),this.client.user.bot?(this.client.token=null,Promise.resolve()):this.client.rest.methods.logout().then(()=>{this.client.token=null})}}t.exports=s},function(t,e,n){class i{constructor(t){this.client=t,this.register(n(100)),this.register(n(101)),this.register(n(102)),this.register(n(106)),this.register(n(103)),this.register(n(104)),this.register(n(105)),this.register(n(84)),this.register(n(85)),this.register(n(86)),this.register(n(88)),this.register(n(99)),this.register(n(92)),this.register(n(93)),this.register(n(87)),this.register(n(94)),this.register(n(95)),this.register(n(96)),this.register(n(107)),this.register(n(109)),this.register(n(108)),this.register(n(98)),this.register(n(89)),this.register(n(90)),this.register(n(91)),this.register(n(97))}register(t){this[t.name.replace(/Action$/,"")]=new t(this.client)}}t.exports=i},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.dataManager.newChannel(t);return{channel:n}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.channels.get(t.id);return n?(e.dataManager.killChannel(n),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)):n=this.deleted.get(t.id)||null,{channel:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.id);if(n){const i=r(n);return n.setup(t),e.emit(s.Events.CHANNEL_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id),i=e.dataManager.newUser(t.user);n&&i&&e.emit(s.Events.GUILD_BAN_REMOVE,n,i)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client;let n=e.guilds.get(t.id);if(n){if(n.available&&t.unavailable)return n.available=!1,e.emit(s.Events.GUILD_UNAVAILABLE,n),{guild:null};e.guilds.delete(n.id),this.deleted.set(n.id,n),this.scheduleForDeletion(n.id)}else n=this.deleted.get(t.id)||null;return{guild:n}}scheduleForDeletion(t){this.client.setTimeout(()=>this.deleted.delete(t),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2);class s extends i{handle(t,e){const n=this.client,i=n.dataManager.newEmoji(e,t);return{emoji:i}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client;return e.dataManager.killEmoji(t),{emoji:t}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t,e){this.client.dataManager.updateEmoji(t,e)}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t,e){const n=t._addMember(e,!1);return{member:n}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){let i=n.members.get(t.user.id);return i?(n.memberCount--,n._removeMember(i),this.deleted.set(n.id+t.user.id,i),e.status===s.Status.READY&&e.emit(s.Events.GUILD_MEMBER_REMOVE,i),this.scheduleForDeletion(n.id,t.user.id)):i=this.deleted.get(n.id+t.user.id)||null,{guild:n,member:i}}return{guild:n,member:null}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(8);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){const i=n.roles.has(t.role.id),o=new r(n,t.role);return n.roles.set(o.id,o),i||e.emit(s.Events.GUILD_ROLE_CREATE,o),{role:o}}return{role:null}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{constructor(t){super(t),this.deleted=new Map}handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){let i=n.roles.get(t.role_id);return i?(n.roles.delete(t.role_id),this.deleted.set(n.id+t.role_id,i),this.scheduleForDeletion(n.id,t.role_id),e.emit(s.Events.GUILD_ROLE_DELETE,i)):i=this.deleted.get(n.id+t.role_id)||null,{role:i}}return{role:null}}scheduleForDeletion(t,e){this.client.setTimeout(()=>this.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n){const i=t.role;let o=null;const a=n.roles.get(i.id);return a&&(o=r(a),a.setup(t.role),e.emit(s.Events.GUILD_ROLE_UPDATE,o,a)),{old:o,updated:a}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.guild_id);if(n)for(const i of t.roles){const t=n.roles.get(i.id);t&&(t.position=i.position)}return{guild:n}}}t.exports=s},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){t.presences=t.presences||[];for(const e of t.presences)n._setPresence(e.user.id,e);t.members=t.members||[];for(const i of t.members){const t=n.members.get(i.user.id);t?n._updateMember(t,i):n._addMember(i,!1)}}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.guilds.get(t.id);if(n){const i=r(n);return n.setup(t),e.emit(s.Events.GUILD_UPDATE,i,n),{old:i,updated:n}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2),s=n(11);class r extends i{handle(t){const e=this.client,n=e.channels.get((t instanceof Array?t[0]:t).channel_id),i=e.users.get((t instanceof Array?t[0]:t).author.id);if(n){const r=n.guild?n.guild.member(i):null;if(t instanceof Array){const o=new Array(t.length);for(let a=0;athis.deleted.delete(t+e),this.client.options.restWsBridgeTimeout)}}t.exports=s},function(t,e,n){const i=n(2),s=n(3),r=n(0);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id),i=t.ids,o=new s;for(const a of i){const t=n.messages.get(a);t&&o.set(t.id,t)}return o.size>0&&e.emit(r.Events.MESSAGE_BULK_DELETE,o),{messages:o}}}t.exports=o},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._addReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_ADD,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.users.get(t.user_id);if(!e)return!1;const n=this.client.channels.get(t.channel_id);if(!n||"voice"===n.type)return!1;const i=n.messages.get(t.message_id);if(!i)return!1;if(!t.emoji)return!1;const r=i._removeReaction(t.emoji,e);return r&&this.client.emit(s.Events.MESSAGE_REACTION_REMOVE,r,e),{message:i,reaction:r,user:e}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client.channels.get(t.channel_id);if(!e||"voice"===e.type)return!1;const n=e.messages.get(t.message_id);return!!n&&(n._clearReactions(),this.client.emit(s.Events.MESSAGE_REACTION_REMOVE_ALL,n),{message:n})}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client,n=e.channels.get(t.channel_id);if(n){const i=n.messages.get(t.id);if(i){const n=r(i);return i.patch(t),i._edits.unshift(n),e.emit(s.Events.MESSAGE_UPDATE,n,i),{old:n,updated:i}}return{old:i,updated:i}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){const i=n(2);class s extends i{handle(t){const e=this.client,n=e.dataManager.newUser(t);return{user:n}}}t.exports=s},function(t,e,n){const i=n(2),s=n(0);class r extends i{handle(t){const e=this.client,n=e.user.notes.get(t.id),i=t.note.length?t.note:null;return e.user.notes.set(t.id,i),e.emit(s.Events.USER_NOTE_UPDATE,t.id,n,i),{old:n,updated:i}}}t.exports=r},function(t,e,n){const i=n(2),s=n(0),r=n(4);class o extends i{handle(t){const e=this.client;if(e.user){if(e.user.equals(t))return{old:e.user,updated:e.user};const n=r(e.user);return e.user.patch(t),e.emit(s.Events.USER_UPDATE,n,e.user),{old:n,updated:e.user}}return{old:null,updated:null}}}t.exports=o},function(t,e,n){function i(t){let e=t.split("?")[0];if(e.includes("/channels/")||e.includes("/guilds/")){const t=e.includes("/channels/")?e.indexOf("/channels/"):e.indexOf("/guilds/"),n=e.substring(t).split("/")[2];e=e.replace(/(\d{8,})/g,":id").replace(":id",n)}return e}const s=n(25),r=n(0);class o{constructor(t,e,n,s,r,o){this.rest=t,this.method=e,this.url=n,this.auth=s,this.data=r,this.file=o,this.route=i(this.url)}getAuth(){if(this.rest.client.token&&this.rest.client.user&&this.rest.client.user.bot)return`Bot ${this.rest.client.token}`;if(this.rest.client.token)return this.rest.client.token;throw new Error(r.Errors.NO_TOKEN)}gen(){const t=s[this.method](this.url);return this.auth&&t.set("authorization",this.getAuth()),this.file&&this.file.file?(t.attach("file",this.file.file,this.file.name),this.data=this.data||{},t.field("payload_json",JSON.stringify(this.data))):this.data&&t.send(this.data),this.rest.client.browser||t.set("User-Agent",this.rest.userAgentManager.userAgent),t}}t.exports=o},function(t,e,n){const i=n(0),s=n(3),r=n(43),o=n(154),a=n(15),h=n(6),u=n(14),c=n(11),l=n(8),d=n(32),f=n(19),p=n(152),m=n(28);class g{constructor(t){this.rest=t,this.client=t.client}login(t=this.client.token){return new Promise((e,n)=>{if("string"!=typeof t)throw new Error(i.Errors.INVALID_TOKEN);t=t.replace(/^Bot\s*/i,""),this.client.manager.connectToWebSocket(t,e,n)})}logout(){return this.rest.makeRequest("post",i.Endpoints.logout,!0,{})}getGateway(){return this.rest.makeRequest("get",i.Endpoints.gateway,!0).then(t=>{return this.client.ws.gateway=`${t.url}/?v=${i.PROTOCOL_VERSION}`,this.client.ws.gateway})}getBotGateway(){return this.rest.makeRequest("get",i.Endpoints.botGateway,!0)}sendMessage(t,e,{tts,nonce,embed,disableEveryone,split,code}={},n=null){return new Promise((s,o)=>{"undefined"!=typeof e&&(e=this.client.resolver.resolveString(e)),e&&("undefined"==typeof code||"boolean"==typeof code&&code!==!0||(e=a(this.client.resolver.resolveString(e),!0),e=`\`\`\`${"boolean"!=typeof code?code||"":""} ${e} \`\`\``),(disableEveryone||"undefined"==typeof disableEveryone&&this.client.options.disableEveryone)&&(e=e.replace(/@(everyone|here)/g,"@​$1")),split&&(e=r(e,"object"==typeof split?split:{})));const c=t=>{if(e instanceof Array){const i=[];!function e(r,o){const a=o===r.length?{tts:tts,embed:embed}:{tts:tts};t.send(r[o],a,o===r.length?n:null).then(t=>{return i.push(t),o>=r.length?s(i):e(r,++o)})}(e,0)}else this.rest.makeRequest("post",i.Endpoints.channelMessages(t.id),!0,{content:e,tts:tts,nonce:nonce,embed:embed},n).then(t=>s(this.client.actions.MessageCreate.handle(t).message),o)};t instanceof h||t instanceof u?this.createDM(t).then(c,o):c(t)})}updateMessage(t,e,{embed,code}={}){return e=this.client.resolver.resolveString(e),"undefined"==typeof code||"boolean"==typeof code&&code!==!0||(e=a(this.client.resolver.resolveString(e),!0),e=`\`\`\`${"boolean"!=typeof code?code||"":""} ${e}