Professional Documents
Culture Documents
// @name ..::1mp3r1uM::..
// @author Pulsar, Blisma, 2yL
// @match *://moomoo.io/*
// @match *://*.moomoo.io/*
// @match *://*.skids.info/*
// @grant none
// @run-at document-end
// @require https://greasyfork.org/scripts/456235-moomoo-js/code/MooMoojs.js
// ==/UserScript==
"use strict";
class Bot {
static generateBot(botManager) {
const bot = new botManager.Bot();
botsAll.push(bot);
let runOnce = 1;
bot.addEventListener("packet", server => {
if (!runOnce) return
bot.spawn({
name: "bot",
skin: 1,
moofoll: 1
});
runOnce = 0;
});
bot.addEventListener("packet", packetData => {
if (packetData.packet === "11") bot.spawn();
if (packetData.packet == "io-init") bot.sockId = packetData.data[0];
});
const { region, index } = MooMoo.ServerManager.extractRegionAndIndex();
bot.join([region, index]);
let b = botManager.addBot(bot);
setInterval(() => {
if (!bot.x || !bot.y) return;
const playerAngle = Math.atan2(MooMoo.myPlayer.y - bot.y,
MooMoo.myPlayer.x - bot.x);
bot.sendPacket(33, playerAngle);
}, 111);
}
}
let oldPack = [];
WebSocket.prototype.send = new Proxy(WebSocket.prototype.send, {
apply(target, that, args) {
const decoded = MooMoo.msgpack.decode(args);
if (args[0] == "2") {
if (args[1].includes(MooMoo.myPlayer.dir)) {
return ()=>{};
}
}
if (args[0] == "5") {
if (args[1].includes(MooMoo.myPlayer.buildIndex) ||
args[1].includes(MooMoo.myPlayer.weaponIndex)) {
return ()=>{};
}
}
if (args[0] == "c") {
if (args[1] == (oldPack)) {
return ()=>{};
} else {
oldPack = args[1];
}
}
return Reflect.apply(...arguments);
}
})
var asa = 2;
MooMoo.onGameLoad = ()=>{while(asa--)Bot.generateBot(botManager)};
(function removeOriginalBundle() {
var xhr = new XMLHttpRequest;var content;var doc;xhr.open( "GET", document.URL,
false );xhr.send(null);content = xhr.responseText;doc =
document.implementation.createHTMLDocument(""+(document.title ||
""));doc.open();doc.write(content);doc.close();
[...doc.getElementsByTagName("script")].find(e =>
e?.src.endsWith("bundle.js"))?.remove();document.replaceChild( document.importNode(
doc.documentElement, true), document.documentElement);
})();
window.cpmstarAPI = () => {}; /******/
(function(modules) { // webpackBootstrap
/******/ // The module cache
/******/
var installedModules = {}; /******/ /******/ // The require function
/******/
function __webpack_require__(moduleId) {
/******/ /******/ // Check if module is in cache
/******/
if (installedModules[moduleId]) {
/******/
return installedModules[moduleId].exports; /******/
} /******/ // Create a new module (and put it into the cache)
/******/
var module = installedModules[moduleId] = {
/******/
i: moduleId,
/******/ l: false,
/******/ exports: {} /******/
}; /******/ /******/ // Execute the module function
/******/
modules[moduleId].call(module.exports, module, module.exports,
__webpack_require__); /******/ /******/ // Flag the module as loaded
/******/
module.l = true; /******/ /******/ // Return the exports of the module
/******/
return module.exports; /******/
} /******/ /******/ /******/ // expose the modules object (__webpack_modules__)
/******/
__webpack_require__.m = modules; /******/ /******/ // expose the module cache
/******/
__webpack_require__.c = installedModules; /******/ /******/ // define getter
function for harmony exports
/******/
__webpack_require__.d = function(exports, name, getter) {
/******/
if (!__webpack_require__.o(exports, name)) {
/******/
Object.defineProperty(exports, name, {
enumerable: true,
get: getter
}); /******/
} /******/
}; /******/ /******/ // define __esModule on exports
/******/
__webpack_require__.r = function(exports) {
/******/
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/
Object.defineProperty(exports, Symbol.toStringTag, {
value: 'Module'
}); /******/
} /******/
Object.defineProperty(exports, '__esModule', {
value: true
}); /******/
}; /******/ /******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/
__webpack_require__.t = function(value, mode) {
/******/
if (mode & 1) value = __webpack_require__(value); /******/
if (mode & 8) return value; /******/
if (mode & 4 && typeof value === 'object' && value && value.__esModule)
return value; /******/
var ns = Object.create(null); /******/
__webpack_require__.r(ns); /******/
Object.defineProperty(ns, 'default', {
enumerable: true,
value: value
}); /******/
if (mode & 2 && typeof value != 'string')
for (var key in value) __webpack_require__.d(ns, key, function(key) {
return value[key];
}.bind(null, key)); /******/
return ns; /******/
}; /******/ /******/ // getDefaultExport function for compatibility with non-
harmony modules
/******/
__webpack_require__.n = function(module) {
/******/
var getter = module && module.__esModule ? /******/ function getDefault() {
return module['default'];
} : /******/ function getModuleExports() {
return module;
}; /******/
__webpack_require__.d(getter, 'a', getter); /******/
return getter; /******/
}; /******/ /******/ // Object.prototype.hasOwnProperty.call
/******/
__webpack_require__.o = function(object, property) {
return Object.prototype.hasOwnProperty.call(object, property);
}; /******/ /******/ // __webpack_public_path__
/******/
__webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and
return exports
/******/
return __webpack_require__(__webpack_require__.s = "./src/js/app.js"); /******/
} /************************************************************************/
/******/ )({
/***/
"./node_modules/bad-words/lib/badwords.js":
/*!************************************************!*\
!*** ./node_modules/bad-words/lib/badwords.js ***!
\************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
const localList = __webpack_require__( /*! ./lang.json */
"./node_modules/bad-words/lib/lang.json").words;
const baseList = __webpack_require__( /*! badwords-list */
"./node_modules/badwords-list/lib/index.js").array;
class Filter {
/**
* Filter constructor.
* @constructor
* @param {object} options - Filter instance options
* @param {boolean} options.emptyList - Instantiate filter with no
blacklist
* @param {array} options.list - Instantiate filter with custom
list
* @param {string} options.placeHolder - Character used to replace
profane words.
* @param {string} options.regex - Regular expression used to
sanitize words before comparing them to blacklist.
* @param {string} options.replaceRegex - Regular expression used
to replace profane words with placeHolder.
*/
constructor(options = {}) {
Object.assign(this, {
list: options.emptyList && [] ||
Array.prototype.concat.apply(localList, [baseList, options.list || []]),
exclude: options.exclude || [],
placeHolder: options.placeHolder || '*',
regex: options.regex || /[^a-zA-Z0-9|\$|\@]|\^/g,
replaceRegex: options.replaceRegex || /\w/g
});
}
/**
* Determine if a string contains profane language.
* @param {string} string - String to evaluate for profanity.
*/
isProfane(string) {
return this.list.filter(word => {
const wordExp = new RegExp(`\\b${word.replace(/(\W)/g,'\\
$1')}\\b`, 'gi');
return !this.exclude.includes(word.toLowerCase()) &&
wordExp.test(string);
}).length > 0 || false;
}
/**
* Replace a word with placeHolder characters;
* @param {string} string - String to replace.
*/
replaceWord(string) {
return string.replace(this.regex, '').replace(this.replaceRegex,
this.placeHolder);
}
/**
* Evaluate a string for profanity and return an edited version.
* @param {string} string - Sentence to filter.
*/
clean(string) {
return string.split(/\b/).map(word => {
return this.isProfane(word) ? this.replaceWord(word) : word;
}).join('');
}
/**
* Add word(s) to blacklist filter / remove words from whitelist
filter
* @param {...string} word - Word(s) to add to blacklist
*/
addWords() {
let words = Array.from(arguments);
this.list.push(...words);
words.map(word => word.toLowerCase()).forEach(word => {
if (this.exclude.includes(word)) {
this.exclude.splice(this.exclude.indexOf(word), 1);
}
});
}
/**
* Add words to whitelist filter
* @param {...string} word - Word(s) to add to whitelist.
*/
removeWords() {
this.exclude.push(...Array.from(arguments).map(word =>
word.toLowerCase()));
}
}
module.exports = Filter; /***/
},
/***/ "./node_modules/bad-words/lib/lang.json":
/*!**********************************************!*\
!*** ./node_modules/bad-words/lib/lang.json ***!
\**********************************************/
/*! exports provided: words, default */ /***/ function(module) {
module.exports = {
"words": ["ahole", "anus", "ash0le", "ash0les", "asholes", "ass", "Ass
Monkey", "Assface", "assh0le", "assh0lez", "asshole", "assholes", "assholz",
"asswipe", "azzhole", "bassterds", "bastard", "bastards", "bastardz", "basterds",
"basterdz", "Biatch", "bitch", "bitches", "Blow Job", "boffing", "butthole",
"buttwipe", "c0ck", "c0cks", "c0k", "Carpet Muncher", "cawk", "cawks", "Clit",
"cnts", "cntz", "cock", "cockhead", "cock-head", "cocks", "CockSucker", "cock-
sucker", "crap", "cum", "cunt", "cunts", "cuntz", "dick", "dild0", "dild0s",
"dildo", "dildos", "dilld0", "dilld0s", "dominatricks", "dominatrics",
"dominatrix", "dyke", "enema", "f u c k", "f u c k e r", "fag", "fag1t", "faget",
"fagg1t", "faggit", "faggot", "fagg0t", "fagit", "fags", "fagz", "faig", "faigs",
"fart", "flipping the bird", "fuck", "fucker", "fuckin", "fucking", "fucks", "Fudge
Packer", "fuk", "Fukah", "Fuken", "fuker", "Fukin", "Fukk", "Fukkah", "Fukken",
"Fukker", "Fukkin", "g00k", "God-damned", "h00r", "h0ar", "h0re", "hells", "hoar",
"hoor", "hoore", "jackoff", "jap", "japs", "jerk-off", "jisim", "jiss", "jizm",
"jizz", "knob", "knobs", "knobz", "kunt", "kunts", "kuntz", "Lezzian", "Lipshits",
"Lipshitz", "masochist", "masokist", "massterbait", "masstrbait", "masstrbate",
"masterbaiter", "masterbate", "masterbates", "Motha Fucker", "Motha Fuker", "Motha
Fukkah", "Motha Fukker", "Mother Fucker", "Mother Fukah", "Mother Fuker", "Mother
Fukkah", "Mother Fukker", "mother-fucker", "Mutha Fucker", "Mutha Fukah", "Mutha
Fuker", "Mutha Fukkah", "Mutha Fukker", "n1gr", "nastt", "nigger;", "nigur;",
"niiger;", "niigr;", "orafis", "orgasim;", "orgasm", "orgasum", "oriface",
"orifice", "orifiss", "packi", "packie", "packy", "paki", "pakie", "paky",
"pecker", "peeenus", "peeenusss", "peenus", "peinus", "pen1s", "penas", "penis",
"penis-breath", "penus", "penuus", "Phuc", "Phuck", "Phuk", "Phuker", "Phukker",
"polac", "polack", "polak", "Poonani", "pr1c", "pr1ck", "pr1k", "pusse", "pussee",
"pussy", "puuke", "puuker", "queer", "queers", "queerz", "qweers", "qweerz",
"qweir", "recktum", "rectum", "retard", "sadist", "scank", "schlong", "screwing",
"semen", "sex", "sexy", "Sh!t", "sh1t", "sh1ter", "sh1ts", "sh1tter", "sh1tz",
"shit", "shits", "shitter", "Shitty", "Shity", "shitz", "Shyt", "Shyte", "Shytty",
"Shyty", "skanck", "skank", "skankee", "skankey", "skanks", "Skanky", "slag",
"slut", "sluts", "Slutty", "slutz", "son-of-a-bitch", "tit", "turd", "va1jina",
"vag1na", "vagiina", "vagina", "vaj1na", "vajina", "vullva", "vulva", "w0p",
"wh00r", "wh0re", "whore", "xrated", "xxx", "b!+ch", "bitch", "blowjob", "clit",
"arschloch", "fuck", "shit", "ass", "asshole", "b!tch", "b17ch", "b1tch",
"bastard", "bi+ch", "boiolas", "buceta", "c0ck", "cawk", "chink", "cipa", "clits",
"cock", "cum", "cunt", "dildo", "dirsa", "ejakulate", "fatass", "fcuk", "fuk",
"fux0r", "hoer", "hore", "jism", "kawk", "l3itch", "l3i+ch", "lesbian",
"masturbate", "masterbat*", "masterbat3", "motherfucker", "s.o.b.", "mofo", "nazi",
"nigga", "nigger", "nutsack", "phuck", "pimpis", "pusse", "pussy", "scrotum", "sh!
t", "shemale", "shi+", "sh!+", "slut", "smut", "teets", "tits", "boobs", "b00bs",
"teez", "testical", "testicle", "titt", "w00se", "jackoff", "wank", "whoar",
"whore", "*damn", "*dyke", "*fuck*", "*shit*", "@$$", "amcik", "andskota", "arse*",
"assrammer", "ayir", "bi7ch", "bitch*", "bollock*", "breasts", "butt-pirate",
"cabron", "cazzo", "chraa", "chuj", "Cock*", "cunt*", "d4mn", "daygo", "dego",
"dick*", "dike*", "dupa", "dziwka", "ejackulate", "Ekrem*", "Ekto", "enculer",
"faen", "fag*", "fanculo", "fanny", "feces", "feg", "Felcher", "ficken", "fitt*",
"Flikker", "foreskin", "Fotze", "Fu(*", "fuk*", "futkretzn", "gook", "guiena",
"h0r", "h4x0r", "hell", "helvete", "hoer*", "honkey", "Huevon", "hui", "injun",
"jizz", "kanker*", "kike", "klootzak", "kraut", "knulle", "kuk", "kuksuger",
"Kurac", "kurwa", "kusi*", "kyrpa*", "lesbo", "mamhoon", "masturbat*", "merd*",
"mibun", "monkleigh", "mouliewop", "muie", "mulkku", "muschi", "nazis",
"nepesaurio", "nigger*", "orospu", "paska*", "perse", "picka", "pierdol*",
"pillu*", "pimmel", "piss*", "pizda", "poontsee", "poop", "porn", "p0rn", "pr0n",
"preteen", "pula", "pule", "puta", "puto", "qahbeh", "queef*", "rautenberg",
"schaffer", "scheiss*", "schlampe", "schmuck", "screw", "sh!t*", "sharmuta",
"sharmute", "shipal", "shiz", "skribz", "skurwysyn", "sphencter", "spic",
"spierdalaj", "splooge", "suka", "b00b*", "testicle*", "titt*", "twat", "vittu",
"wank*", "wetback*", "wichser", "wop*", "yed", "zabourah"]
}; /***/
},
/***/ "./node_modules/badwords-list/lib/array.js":
/*!*************************************************!*\
!*** ./node_modules/badwords-list/lib/array.js ***!
\*************************************************/
/*! no static exports found */ /***/ function(module, exports) {
module.exports = ["4r5e", "5h1t", "5hit", "a55", "anal", "anus", "ar5e",
"arrse", "arse", "ass", "ass-fucker", "asses", "assfucker", "assfukka", "asshole",
"assholes", "asswhole", "a_s_s", "b!tch", "b00bs", "b17ch", "b1tch", "ballbag",
"balls", "ballsack", "bastard", "beastial", "beastiality", "bellend", "bestial",
"bestiality", "bi+ch", "biatch", "bitch", "bitcher", "bitchers", "bitches",
"bitchin", "bitching", "bloody", "blow job", "blowjob", "blowjobs", "boiolas",
"bollock", "bollok", "boner", "boob", "boobs", "booobs", "boooobs", "booooobs",
"booooooobs", "breasts", "buceta", "bugger", "bum", "bunny fucker", "butt",
"butthole", "buttmuch", "buttplug", "c0ck", "c0cksucker", "carpet muncher", "cawk",
"chink", "cipa", "cl1t", "clit", "clitoris", "clits", "cnut", "cock", "cock-
sucker", "cockface", "cockhead", "cockmunch", "cockmuncher", "cocks", "cocksuck",
"cocksucked", "cocksucker", "cocksucking", "cocksucks", "cocksuka", "cocksukka",
"cok", "cokmuncher", "coksucka", "coon", "cox", "crap", "cum", "cummer", "cumming",
"cums", "cumshot", "cunilingus", "cunillingus", "cunnilingus", "cunt", "cuntlick",
"cuntlicker", "cuntlicking", "cunts", "cyalis", "cyberfuc", "cyberfuck",
"cyberfucked", "cyberfucker", "cyberfuckers", "cyberfucking", "d1ck", "damn",
"dick", "dickhead", "dildo", "dildos", "dink", "dinks", "dirsa", "dlck", "dog-
fucker", "doggin", "dogging", "donkeyribber", "doosh", "duche", "dyke",
"ejaculate", "ejaculated", "ejaculates", "ejaculating", "ejaculatings",
"ejaculation", "ejakulate", "f u c k", "f u c k e r", "f4nny", "fag", "fagging",
"faggitt", "faggot", "faggs", "fagot", "fagots", "fags", "fanny", "fannyflaps",
"fannyfucker", "fanyy", "fatass", "fcuk", "fcuker", "fcuking", "feck", "fecker",
"felching", "fellate", "fellatio", "fingerfuck", "fingerfucked", "fingerfucker",
"fingerfuckers", "fingerfucking", "fingerfucks", "fistfuck", "fistfucked",
"fistfucker", "fistfuckers", "fistfucking", "fistfuckings", "fistfucks", "flange",
"fook", "fooker", "fuck", "fucka", "fucked", "fucker", "fuckers", "fuckhead",
"fuckheads", "fuckin", "fucking", "fuckings", "fuckingshitmotherfucker", "fuckme",
"fucks", "fuckwhit", "fuckwit", "fudge packer", "fudgepacker", "fuk", "fuker",
"fukker", "fukkin", "fuks", "fukwhit", "fukwit", "fux", "fux0r", "f_u_c_k",
"gangbang", "gangbanged", "gangbangs", "gaylord", "gaysex", "goatse", "God", "god-
dam", "god-damned", "goddamn", "goddamned", "hardcoresex", "hell", "heshe", "hoar",
"hoare", "hoer", "homo", "hore", "horniest", "horny", "hotsex", "jack-off",
"jackoff", "jap", "jerk-off", "jism", "jiz", "jizm", "jizz", "kawk", "knob",
"knobead", "knobed", "knobend", "knobhead", "knobjocky", "knobjokey", "kock",
"kondum", "kondums", "kum", "kummer", "kumming", "kums", "kunilingus", "l3i+ch",
"l3itch", "labia", "lust", "lusting", "m0f0", "m0fo", "m45terbate", "ma5terb8",
"ma5terbate", "masochist", "master-bate", "masterb8", "masterbat*", "masterbat3",
"masterbate", "masterbation", "masterbations", "masturbate", "mo-fo", "mof0",
"mofo", "mothafuck", "mothafucka", "mothafuckas", "mothafuckaz", "mothafucked",
"mothafucker", "mothafuckers", "mothafuckin", "mothafucking", "mothafuckings",
"mothafucks", "mother fucker", "motherfuck", "motherfucked", "motherfucker",
"motherfuckers", "motherfuckin", "motherfucking", "motherfuckings", "motherfuckka",
"motherfucks", "muff", "mutha", "muthafecker", "muthafuckker", "muther",
"mutherfucker", "n1gga", "n1gger", "nazi", "nigg3r", "nigg4h", "nigga", "niggah",
"niggas", "niggaz", "nigger", "niggers", "nob", "nob jokey", "nobhead", "nobjocky",
"nobjokey", "numbnuts", "nutsack", "orgasim", "orgasims", "orgasm", "orgasms",
"p0rn", "pawn", "pecker", "penis", "penisfucker", "phonesex", "phuck", "phuk",
"phuked", "phuking", "phukked", "phukking", "phuks", "phuq", "pigfucker", "pimpis",
"piss", "pissed", "pisser", "pissers", "pisses", "pissflaps", "pissin", "pissing",
"pissoff", "poop", "porn", "porno", "pornography", "pornos", "prick", "pricks",
"pron", "pube", "pusse", "pussi", "pussies", "pussy", "pussys", "rectum", "retard",
"rimjaw", "rimming", "s hit", "s.o.b.", "sadist", "schlong", "screwing", "scroat",
"scrote", "scrotum", "semen", "sex", "sh!+", "sh!t", "sh1t", "shag", "shagger",
"shaggin", "shagging", "shemale", "shi+", "shit", "shitdick", "shite", "shited",
"shitey", "shitfuck", "shitfull", "shithead", "shiting", "shitings", "shits",
"shitted", "shitter", "shitters", "shitting", "shittings", "shitty", "skank",
"slut", "sluts", "smegma", "smut", "snatch", "son-of-a-bitch", "spac", "spunk",
"s_h_i_t", "t1tt1e5", "t1tties", "teets", "teez", "testical", "testicle", "tit",
"titfuck", "tits", "titt", "tittie5", "tittiefucker", "titties", "tittyfuck",
"tittywank", "titwank", "tosser", "turd", "tw4t", "twat", "twathead", "twatty",
"twunt", "twunter", "v14gra", "v1gra", "vagina", "viagra", "vulva", "w00se",
"wang", "wank", "wanker", "wanky", "whoar", "whore", "willies", "willy", "xrated",
"xxx"]; /***/
},
/***/ "./node_modules/badwords-list/lib/index.js":
/*!*************************************************!*\
!*** ./node_modules/badwords-list/lib/index.js ***!
\*************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
module.exports = {
object: __webpack_require__( /*! ./object */ "./node_modules/badwords-
list/lib/object.js"),
array: __webpack_require__( /*! ./array */ "./node_modules/badwords-
list/lib/array.js"),
regex: __webpack_require__( /*! ./regexp */ "./node_modules/badwords-
list/lib/regexp.js")
}; /***/
},
/***/ "./node_modules/badwords-list/lib/object.js":
/*!**************************************************!*\
!*** ./node_modules/badwords-list/lib/object.js ***!
\**************************************************/
/*! no static exports found */ /***/ function(module, exports) {
module.exports = {
"4r5e": 1,
"5h1t": 1,
"5hit": 1,
"a55": 1,
"anal": 1,
"anus": 1,
"ar5e": 1,
"arrse": 1,
"arse": 1,
"ass": 1,
"ass-fucker": 1,
"asses": 1,
"assfucker": 1,
"assfukka": 1,
"asshole": 1,
"assholes": 1,
"asswhole": 1,
"a_s_s": 1,
"b!tch": 1,
"b00bs": 1,
"b17ch": 1,
"b1tch": 1,
"ballbag": 1,
"balls": 1,
"ballsack": 1,
"bastard": 1,
"beastial": 1,
"beastiality": 1,
"bellend": 1,
"bestial": 1,
"bestiality": 1,
"bi+ch": 1,
"biatch": 1,
"bitch": 1,
"bitcher": 1,
"bitchers": 1,
"bitches": 1,
"bitchin": 1,
"bitching": 1,
"bloody": 1,
"blow job": 1,
"blowjob": 1,
"blowjobs": 1,
"boiolas": 1,
"bollock": 1,
"bollok": 1,
"boner": 1,
"boob": 1,
"boobs": 1,
"booobs": 1,
"boooobs": 1,
"booooobs": 1,
"booooooobs": 1,
"breasts": 1,
"buceta": 1,
"bugger": 1,
"bum": 1,
"bunny fucker": 1,
"butt": 1,
"butthole": 1,
"buttmuch": 1,
"buttplug": 1,
"c0ck": 1,
"c0cksucker": 1,
"carpet muncher": 1,
"cawk": 1,
"chink": 1,
"cipa": 1,
"cl1t": 1,
"clit": 1,
"clitoris": 1,
"clits": 1,
"cnut": 1,
"cock": 1,
"cock-sucker": 1,
"cockface": 1,
"cockhead": 1,
"cockmunch": 1,
"cockmuncher": 1,
"cocks": 1,
"cocksuck": 1,
"cocksucked": 1,
"cocksucker": 1,
"cocksucking": 1,
"cocksucks": 1,
"cocksuka": 1,
"cocksukka": 1,
"cok": 1,
"cokmuncher": 1,
"coksucka": 1,
"coon": 1,
"cox": 1,
"crap": 1,
"cum": 1,
"cummer": 1,
"cumming": 1,
"cums": 1,
"cumshot": 1,
"cunilingus": 1,
"cunillingus": 1,
"cunnilingus": 1,
"cunt": 1,
"cuntlick": 1,
"cuntlicker": 1,
"cuntlicking": 1,
"cunts": 1,
"cyalis": 1,
"cyberfuc": 1,
"cyberfuck": 1,
"cyberfucked": 1,
"cyberfucker": 1,
"cyberfuckers": 1,
"cyberfucking": 1,
"d1ck": 1,
"damn": 1,
"dick": 1,
"dickhead": 1,
"dildo": 1,
"dildos": 1,
"dink": 1,
"dinks": 1,
"dirsa": 1,
"dlck": 1,
"dog-fucker": 1,
"doggin": 1,
"dogging": 1,
"donkeyribber": 1,
"doosh": 1,
"duche": 1,
"dyke": 1,
"ejaculate": 1,
"ejaculated": 1,
"ejaculates": 1,
"ejaculating": 1,
"ejaculatings": 1,
"ejaculation": 1,
"ejakulate": 1,
"f u c k": 1,
"f u c k e r": 1,
"f4nny": 1,
"fag": 1,
"fagging": 1,
"faggitt": 1,
"faggot": 1,
"faggs": 1,
"fagot": 1,
"fagots": 1,
"fags": 1,
"fanny": 1,
"fannyflaps": 1,
"fannyfucker": 1,
"fanyy": 1,
"fatass": 1,
"fcuk": 1,
"fcuker": 1,
"fcuking": 1,
"feck": 1,
"fecker": 1,
"felching": 1,
"fellate": 1,
"fellatio": 1,
"fingerfuck": 1,
"fingerfucked": 1,
"fingerfucker": 1,
"fingerfuckers": 1,
"fingerfucking": 1,
"fingerfucks": 1,
"fistfuck": 1,
"fistfucked": 1,
"fistfucker": 1,
"fistfuckers": 1,
"fistfucking": 1,
"fistfuckings": 1,
"fistfucks": 1,
"flange": 1,
"fook": 1,
"fooker": 1,
"fuck": 1,
"fucka": 1,
"fucked": 1,
"fucker": 1,
"fuckers": 1,
"fuckhead": 1,
"fuckheads": 1,
"fuckin": 1,
"fucking": 1,
"fuckings": 1,
"fuckingshitmotherfucker": 1,
"fuckme": 1,
"fucks": 1,
"fuckwhit": 1,
"fuckwit": 1,
"fudge packer": 1,
"fudgepacker": 1,
"fuk": 1,
"fuker": 1,
"fukker": 1,
"fukkin": 1,
"fuks": 1,
"fukwhit": 1,
"fukwit": 1,
"fux": 1,
"fux0r": 1,
"f_u_c_k": 1,
"gangbang": 1,
"gangbanged": 1,
"gangbangs": 1,
"gaylord": 1,
"gaysex": 1,
"goatse": 1,
"God": 1,
"god-dam": 1,
"god-damned": 1,
"goddamn": 1,
"goddamned": 1,
"hardcoresex": 1,
"hell": 1,
"heshe": 1,
"hoar": 1,
"hoare": 1,
"hoer": 1,
"homo": 1,
"hore": 1,
"horniest": 1,
"horny": 1,
"hotsex": 1,
"jack-off": 1,
"jackoff": 1,
"jap": 1,
"jerk-off": 1,
"jism": 1,
"jiz": 1,
"jizm": 1,
"jizz": 1,
"kawk": 1,
"knob": 1,
"knobead": 1,
"knobed": 1,
"knobend": 1,
"knobhead": 1,
"knobjocky": 1,
"knobjokey": 1,
"kock": 1,
"kondum": 1,
"kondums": 1,
"kum": 1,
"kummer": 1,
"kumming": 1,
"kums": 1,
"kunilingus": 1,
"l3i+ch": 1,
"l3itch": 1,
"labia": 1,
"lust": 1,
"lusting": 1,
"m0f0": 1,
"m0fo": 1,
"m45terbate": 1,
"ma5terb8": 1,
"ma5terbate": 1,
"masochist": 1,
"master-bate": 1,
"masterb8": 1,
"masterbat*": 1,
"masterbat3": 1,
"masterbate": 1,
"masterbation": 1,
"masterbations": 1,
"masturbate": 1,
"mo-fo": 1,
"mof0": 1,
"mofo": 1,
"mothafuck": 1,
"mothafucka": 1,
"mothafuckas": 1,
"mothafuckaz": 1,
"mothafucked": 1,
"mothafucker": 1,
"mothafuckers": 1,
"mothafuckin": 1,
"mothafucking": 1,
"mothafuckings": 1,
"mothafucks": 1,
"mother fucker": 1,
"motherfuck": 1,
"motherfucked": 1,
"motherfucker": 1,
"motherfuckers": 1,
"motherfuckin": 1,
"motherfucking": 1,
"motherfuckings": 1,
"motherfuckka": 1,
"motherfucks": 1,
"muff": 1,
"mutha": 1,
"muthafecker": 1,
"muthafuckker": 1,
"muther": 1,
"mutherfucker": 1,
"n1gga": 1,
"n1gger": 1,
"nazi": 1,
"nigg3r": 1,
"nigg4h": 1,
"nigga": 1,
"niggah": 1,
"niggas": 1,
"niggaz": 1,
"nigger": 1,
"niggers": 1,
"nob": 1,
"nob jokey": 1,
"nobhead": 1,
"nobjocky": 1,
"nobjokey": 1,
"numbnuts": 1,
"nutsack": 1,
"orgasim": 1,
"orgasims": 1,
"orgasm": 1,
"orgasms": 1,
"p0rn": 1,
"pawn": 1,
"pecker": 1,
"penis": 1,
"penisfucker": 1,
"phonesex": 1,
"phuck": 1,
"phuk": 1,
"phuked": 1,
"phuking": 1,
"phukked": 1,
"phukking": 1,
"phuks": 1,
"phuq": 1,
"pigfucker": 1,
"pimpis": 1,
"piss": 1,
"pissed": 1,
"pisser": 1,
"pissers": 1,
"pisses": 1,
"pissflaps": 1,
"pissin": 1,
"pissing": 1,
"pissoff": 1,
"poop": 1,
"porn": 1,
"porno": 1,
"pornography": 1,
"pornos": 1,
"prick": 1,
"pricks": 1,
"pron": 1,
"pube": 1,
"pusse": 1,
"pussi": 1,
"pussies": 1,
"pussy": 1,
"pussys": 1,
"rectum": 1,
"retard": 1,
"rimjaw": 1,
"rimming": 1,
"s hit": 1,
"s.o.b.": 1,
"sadist": 1,
"schlong": 1,
"screwing": 1,
"scroat": 1,
"scrote": 1,
"scrotum": 1,
"semen": 1,
"sex": 1,
"sh!+": 1,
"sh!t": 1,
"sh1t": 1,
"shag": 1,
"shagger": 1,
"shaggin": 1,
"shagging": 1,
"shemale": 1,
"shi+": 1,
"shit": 1,
"shitdick": 1,
"shite": 1,
"shited": 1,
"shitey": 1,
"shitfuck": 1,
"shitfull": 1,
"shithead": 1,
"shiting": 1,
"shitings": 1,
"shits": 1,
"shitted": 1,
"shitter": 1,
"shitters": 1,
"shitting": 1,
"shittings": 1,
"shitty": 1,
"skank": 1,
"slut": 1,
"sluts": 1,
"smegma": 1,
"smut": 1,
"snatch": 1,
"son-of-a-bitch": 1,
"spac": 1,
"spunk": 1,
"s_h_i_t": 1,
"t1tt1e5": 1,
"t1tties": 1,
"teets": 1,
"teez": 1,
"testical": 1,
"testicle": 1,
"tit": 1,
"titfuck": 1,
"tits": 1,
"titt": 1,
"tittie5": 1,
"tittiefucker": 1,
"titties": 1,
"tittyfuck": 1,
"tittywank": 1,
"titwank": 1,
"tosser": 1,
"turd": 1,
"tw4t": 1,
"twat": 1,
"twathead": 1,
"twatty": 1,
"twunt": 1,
"twunter": 1,
"v14gra": 1,
"v1gra": 1,
"vagina": 1,
"viagra": 1,
"vulva": 1,
"w00se": 1,
"wang": 1,
"wank": 1,
"wanker": 1,
"wanky": 1,
"whoar": 1,
"whore": 1,
"willies": 1,
"willy": 1,
"xrated": 1,
"xxx": 1
}; /***/
},
/***/ "./node_modules/badwords-list/lib/regexp.js":
/*!**************************************************!*\
!*** ./node_modules/badwords-list/lib/regexp.js ***!
\**************************************************/
/*! no static exports found */ /***/ function(module, exports) {
module.exports = /\b(4r5e|5h1t|5hit|a55|anal|anus|ar5e|arrse|arse|ass|ass-
fucker|asses|assfucker|assfukka|asshole|assholes|asswhole|a_s_s|b!tch|b00bs|b17ch|
b1tch|ballbag|balls|ballsack|bastard|beastial|beastiality|bellend|bestial|
bestiality|bi\+ch|biatch|bitch|bitcher|bitchers|bitches|bitchin|bitching|bloody|
blow job|blowjob|blowjobs|boiolas|bollock|bollok|boner|boob|boobs|booobs|boooobs|
booooobs|booooooobs|breasts|buceta|bugger|bum|bunny fucker|butt|butthole|buttmuch|
buttplug|c0ck|c0cksucker|carpet muncher|cawk|chink|cipa|cl1t|clit|clitoris|clits|
cnut|cock|cock-sucker|cockface|cockhead|cockmunch|cockmuncher|cocks|cocksuck|
cocksucked|cocksucker|cocksucking|cocksucks|cocksuka|cocksukka|cok|cokmuncher|
coksucka|coon|cox|crap|cum|cummer|cumming|cums|cumshot|cunilingus|cunillingus|
cunnilingus|cunt|cuntlick|cuntlicker|cuntlicking|cunts|cyalis|cyberfuc|cyberfuck|
cyberfucked|cyberfucker|cyberfuckers|cyberfucking|d1ck|damn|dick|dickhead|dildo|
dildos|dink|dinks|dirsa|dlck|dog-fucker|doggin|dogging|donkeyribber|doosh|duche|
dyke|ejaculate|ejaculated|ejaculates|ejaculating|ejaculatings|ejaculation|
ejakulate|f u c k|f u c k e r|f4nny|fag|fagging|faggitt|faggot|faggs|fagot|fagots|
fags|fanny|fannyflaps|fannyfucker|fanyy|fatass|fcuk|fcuker|fcuking|feck|fecker|
felching|fellate|fellatio|fingerfuck|fingerfucked|fingerfucker|fingerfuckers|
fingerfucking|fingerfucks|fistfuck|fistfucked|fistfucker|fistfuckers|fistfucking|
fistfuckings|fistfucks|flange|fook|fooker|fuck|fucka|fucked|fucker|fuckers|
fuckhead|fuckheads|fuckin|fucking|fuckings|fuckingshitmotherfucker|fuckme|fucks|
fuckwhit|fuckwit|fudge packer|fudgepacker|fuk|fuker|fukker|fukkin|fuks|fukwhit|
fukwit|fux|fux0r|f_u_c_k|gangbang|gangbanged|gangbangs|gaylord|gaysex|goatse|God|
god-dam|god-damned|goddamn|goddamned|hardcoresex|hell|heshe|hoar|hoare|hoer|homo|
hore|horniest|horny|hotsex|jack-off|jackoff|jap|jerk-off|jism|jiz|jizm|jizz|kawk|
knob|knobead|knobed|knobend|knobhead|knobjocky|knobjokey|kock|kondum|kondums|kum|
kummer|kumming|kums|kunilingus|l3i\+ch|l3itch|labia|lust|lusting|m0f0|m0fo|
m45terbate|ma5terb8|ma5terbate|masochist|master-bate|masterb8|masterbat*|
masterbat3|masterbate|masterbation|masterbations|masturbate|mo-fo|mof0|mofo|
mothafuck|mothafucka|mothafuckas|mothafuckaz|mothafucked|mothafucker|mothafuckers|
mothafuckin|mothafucking|mothafuckings|mothafucks|mother fucker|motherfuck|
motherfucked|motherfucker|motherfuckers|motherfuckin|motherfucking|motherfuckings|
motherfuckka|motherfucks|muff|mutha|muthafecker|muthafuckker|muther|mutherfucker|
n1gga|n1gger|nazi|nigg3r|nigg4h|nigga|niggah|niggas|niggaz|nigger|niggers|nob|nob
jokey|nobhead|nobjocky|nobjokey|numbnuts|nutsack|orgasim|orgasims|orgasm|orgasms|
p0rn|pawn|pecker|penis|penisfucker|phonesex|phuck|phuk|phuked|phuking|phukked|
phukking|phuks|phuq|pigfucker|pimpis|piss|pissed|pisser|pissers|pisses|pissflaps|
pissin|pissing|pissoff|poop|porn|porno|pornography|pornos|prick|pricks|pron|pube|
pusse|pussi|pussies|pussy|pussys|rectum|retard|rimjaw|rimming|s hit|s.o.b.|sadist|
schlong|screwing|scroat|scrote|scrotum|semen|sex|sh!\+|sh!t|sh1t|shag|shagger|
shaggin|shagging|shemale|shi\+|shit|shitdick|shite|shited|shitey|shitfuck|shitfull|
shithead|shiting|shitings|shits|shitted|shitter|shitters|shitting|shittings|shitty|
skank|slut|sluts|smegma|smut|snatch|son-of-a-bitch|spac|spunk|s_h_i_t|t1tt1e5|
t1tties|teets|teez|testical|testicle|tit|titfuck|tits|titt|tittie5|tittiefucker|
titties|tittyfuck|tittywank|titwank|tosser|turd|tw4t|twat|twathead|twatty|twunt|
twunter|v14gra|v1gra|vagina|viagra|vulva|w00se|wang|wank|wanker|wanky|whoar|whore|
willies|willy|xrated|xxx)\b/gi; /***/
},
/***/ "./node_modules/base64-js/index.js":
/*!*****************************************!*\
!*** ./node_modules/base64-js/index.js ***!
\*****************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
"use strict";
exports.byteLength = byteLength;
exports.toByteArray = toByteArray;
exports.fromByteArray = fromByteArray;
var lookup = [];
var revLookup = [];
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
var code =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i];
revLookup[code.charCodeAt(i)] = i;
} // Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62;
revLookup['_'.charCodeAt(0)] = 63;
function getLens(b64) {
var len = b64.length;
if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4');
} // Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=');
if (validLen === -1) validLen = len;
var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
return [validLen, placeHoldersLen];
} // base64 is 4/3 + up to two characters of the original data
function byteLength(b64) {
var lens = getLens(b64);
var validLen = lens[0];
var placeHoldersLen = lens[1];
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
}
function toByteArray(b64) {
var tmp;
var lens = getLens(b64);
var validLen = lens[0];
var placeHoldersLen = lens[1];
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
var curByte = 0; // if there are placeholders, only get up to the last
complete 4 chars
var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
var i;
for (i = 0; i < len; i += 4) {
tmp = revLookup[b64.charCodeAt(i)] << 18 |
revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 |
revLookup[b64.charCodeAt(i + 3)];
arr[curByte++] = tmp >> 16 & 0xFF;
arr[curByte++] = tmp >> 8 & 0xFF;
arr[curByte++] = tmp & 0xFF;
}
if (placeHoldersLen === 2) {
tmp = revLookup[b64.charCodeAt(i)] << 2 |
revLookup[b64.charCodeAt(i + 1)] >> 4;
arr[curByte++] = tmp & 0xFF;
}
if (placeHoldersLen === 1) {
tmp = revLookup[b64.charCodeAt(i)] << 10 |
revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
arr[curByte++] = tmp >> 8 & 0xFF;
arr[curByte++] = tmp & 0xFF;
}
return arr;
}
function tripletToBase64(num) {
return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num
>> 6 & 0x3F] + lookup[num & 0x3F];
}
function fromByteArray(uint8) {
var tmp;
var len = uint8.length;
var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
var parts = [];
var maxChunkLength = 16383; // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing
stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength)
{
parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 :
i + maxChunkLength));
} // pad the end with zeros, but make sure to not forget the extra
bytes
if (extraBytes === 1) {
tmp = uint8[len - 1];
parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '==');
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp
<< 2 & 0x3F] + '=');
}
return parts.join('');
} /***/
},
/***/ "./node_modules/buffer/index.js":
/*!**************************************!*\
!*** ./node_modules/buffer/index.js ***!
\**************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
"use strict"; /* WEBPACK VAR INJECTION */
(function(global) {
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
var base64 = __webpack_require__( /*! base64-js */
"./node_modules/base64-js/index.js");
var ieee754 = __webpack_require__( /*! ieee754 */
"./node_modules/ieee754/index.js");
var isArray = __webpack_require__( /*! isarray */
"./node_modules/buffer/node_modules/isarray/index.js");
exports.Buffer = Buffer;
exports.SlowBuffer = SlowBuffer;
exports.INSPECT_MAX_BYTES = 50;
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (most compatible, even
IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+,
Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* Due to various browser bugs, sometimes the Object implementation
will be used even
* when the browser supports typed arrays.
*
* Note:
*
* - Firefox 4-29 lacks support for adding new properties to
`Uint8Array` instances,
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
*
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray`
function.
*
* - IE10 has a broken `TypedArray.prototype.subarray` function
which returns arrays of
* incorrect length in some situations.
function typedArraySupport() {
try {
var arr = new Uint8Array(1);
arr.__proto__ = {
__proto__: Uint8Array.prototype,
foo: function() {
return 42;
}
};
return arr.foo() === 42 && // typed array instances can be
augmented
typeof arr.subarray === 'function' && // chrome 9-10 lack
`subarray`
arr.subarray(1, 1).byteLength === 0; // ie10 has broken
`subarray`
} catch (e) {
return false;
}
}
function kMaxLength() {
return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;
}
function assertSize(size) {
if (typeof size !== 'number') {
throw new TypeError('"size" argument must be a number');
} else if (size < 0) {
throw new RangeError('"size" argument must not be negative');
}
}
function SlowBuffer(length) {
if (+length != length) { // eslint-disable-line eqeqeq
length = 0;
}
return Buffer.alloc(+length);
}
Buffer.isBuffer = function isBuffer(b) {
return !!(b != null && b._isBuffer);
};
Buffer.compare = function compare(a, b) {
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError('Arguments must be Buffers');
}
if (a === b) return 0;
var x = a.length;
var y = b.length;
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
if (a[i] !== b[i]) {
x = a[i];
y = b[i];
break;
}
}
if (x < y) return -1;
if (y < x) return 1;
return 0;
};
Buffer.isEncoding = function isEncoding(encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'latin1':
case 'binary':
case 'base64':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true;
default:
return false;
}
};
Buffer.concat = function concat(list, length) {
if (!isArray(list)) {
throw new TypeError('"list" argument must be an Array of
Buffers');
}
if (list.length === 0) {
return Buffer.alloc(0);
}
var i;
if (length === undefined) {
length = 0;
for (i = 0; i < list.length; ++i) {
length += list[i].length;
}
}
var buffer = Buffer.allocUnsafe(length);
var pos = 0;
for (i = 0; i < list.length; ++i) {
var buf = list[i];
if (!Buffer.isBuffer(buf)) {
throw new TypeError('"list" argument must be an Array of
Buffers');
}
buf.copy(buffer, pos);
pos += buf.length;
}
return buffer;
};
function swap(b, n, m) {
var i = b[n];
b[n] = b[m];
b[m] = i;
}
Buffer.prototype.swap16 = function swap16() {
var len = this.length;
if (len % 2 !== 0) {
throw new RangeError('Buffer size must be a multiple of 16-
bits');
}
for (var i = 0; i < len; i += 2) {
swap(this, i, i + 1);
}
return this;
};
Buffer.prototype.swap32 = function swap32() {
var len = this.length;
if (len % 4 !== 0) {
throw new RangeError('Buffer size must be a multiple of 32-
bits');
}
for (var i = 0; i < len; i += 4) {
swap(this, i, i + 3);
swap(this, i + 1, i + 2);
}
return this;
};
Buffer.prototype.swap64 = function swap64() {
var len = this.length;
if (len % 8 !== 0) {
throw new RangeError('Buffer size must be a multiple of 64-
bits');
}
for (var i = 0; i < len; i += 8) {
swap(this, i, i + 7);
swap(this, i + 1, i + 6);
swap(this, i + 2, i + 5);
swap(this, i + 3, i + 4);
}
return this;
};
Buffer.prototype.toString = function toString() {
var length = this.length | 0;
if (length === 0) return '';
if (arguments.length === 0) return utf8Slice(this, 0, length);
return slowToString.apply(this, arguments);
};
Buffer.prototype.equals = function equals(b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a
Buffer');
if (this === b) return true;
return Buffer.compare(this, b) === 0;
};
Buffer.prototype.inspect = function inspect() {
var str = '';
var max = exports.INSPECT_MAX_BYTES;
if (this.length > 0) {
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
if (this.length > max) str += ' ... ';
}
return '<Buffer ' + str + '>';
};
Buffer.prototype.compare = function compare(target, start, end,
thisStart, thisEnd) {
if (!Buffer.isBuffer(target)) {
throw new TypeError('Argument must be a Buffer');
}
if (start === undefined) {
start = 0;
}
if (end === undefined) {
end = target ? target.length : 0;
}
if (thisStart === undefined) {
thisStart = 0;
}
if (thisEnd === undefined) {
thisEnd = this.length;
}
if (start < 0 || end > target.length || thisStart < 0 || thisEnd >
this.length) {
throw new RangeError('out of range index');
}
if (thisStart >= thisEnd && start >= end) {
return 0;
}
if (thisStart >= thisEnd) {
return -1;
}
if (start >= end) {
return 1;
}
start >>>= 0;
end >>>= 0;
thisStart >>>= 0;
thisEnd >>>= 0;
if (this === target) return 0;
var x = thisEnd - thisStart;
var y = end - start;
var len = Math.min(x, y);
var thisCopy = this.slice(thisStart, thisEnd);
var targetCopy = target.slice(start, end);
for (var i = 0; i < len; ++i) {
if (thisCopy[i] !== targetCopy[i]) {
x = thisCopy[i];
y = targetCopy[i];
break;
}
}
if (x < y) return -1;
if (y < x) return 1;
return 0;
}; // Finds either the first index of `val` in `buffer` at offset >=
`byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
// Empty buffer means no match
if (buffer.length === 0) return -1; // Normalize byteOffset
if (typeof byteOffset === 'string') {
encoding = byteOffset;
byteOffset = 0;
} else if (byteOffset > 0x7fffffff) {
byteOffset = 0x7fffffff;
} else if (byteOffset < -0x80000000) {
byteOffset = -0x80000000;
}
byteOffset = +byteOffset; // Coerce to Number.
if (isNaN(byteOffset)) { // byteOffset: it it's undefined, null,
NaN, "foo", etc, search whole buffer
byteOffset = dir ? 0 : buffer.length - 1;
} // Normalize byteOffset: negative offsets start from the end of
the buffer
if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
if (byteOffset >= buffer.length) {
if (dir) return -1;
else byteOffset = buffer.length - 1;
} else if (byteOffset < 0) {
if (dir) byteOffset = 0;
else return -1;
} // Normalize val
if (typeof val === 'string') {
val = Buffer.from(val, encoding);
} // Finally, search either indexOf (if dir is true) or lastIndexOf
if (Buffer.isBuffer(val)) { // Special case: looking for empty
string/buffer always fails
if (val.length === 0) {
return -1;
}
return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
} else if (typeof val === 'number') {
val = val & 0xFF; // Search for a byte value [0-255]
if (Buffer.TYPED_ARRAY_SUPPORT && typeof
Uint8Array.prototype.indexOf === 'function') {
if (dir) {
return Uint8Array.prototype.indexOf.call(buffer, val,
byteOffset);
} else {
return Uint8Array.prototype.lastIndexOf.call(buffer,
val, byteOffset);
}
}
return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
}
throw new TypeError('val must be string, number or Buffer');
}
function read(buf, i) {
if (indexSize === 1) {
return buf[i];
} else {
return buf.readUInt16BE(i * indexSize);
}
}
var i;
if (dir) {
var foundIndex = -1;
for (i = byteOffset; i < arrLength; i++) {
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i -
foundIndex)) {
if (foundIndex === -1) foundIndex = i;
if (i - foundIndex + 1 === valLength) return foundIndex
* indexSize;
} else {
if (foundIndex !== -1) i -= i - foundIndex;
foundIndex = -1;
}
}
} else {
if (byteOffset + valLength > arrLength) byteOffset = arrLength
- valLength;
for (i = byteOffset; i >= 0; i--) {
var found = true;
for (var j = 0; j < valLength; j++) {
if (read(arr, i + j) !== read(val, j)) {
found = false;
break;
}
}
if (found) return i;
}
}
return -1;
}
Buffer.prototype.includes = function includes(val, byteOffset,
encoding) {
return this.indexOf(val, byteOffset, encoding) !== -1;
};
Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding)
{
return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
};
Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset,
encoding) {
return bidirectionalIndexOf(this, val, byteOffset, encoding,
false);
};
function decodeCodePointsArray(codePoints) {
var len = codePoints.length;
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints); // avoid
extra slice()
} // Decode in chunks to avoid "call stack size exceeded".
var res = '';
var i = 0;
while (i < len) {
res += String.fromCharCode.apply(String, codePoints.slice(i, i
+= MAX_ARGUMENTS_LENGTH));
}
return res;
}
function stringtrim(str) {
if (str.trim) return str.trim();
return str.replace(/^\s+|\s+$/g, '');
}
function toHex(n) {
if (n < 16) return '0' + n.toString(16);
return n.toString(16);
}
function asciiToBytes(str) {
var byteArray = [];
for (var i = 0; i < str.length; ++i) { // Node's code seems to be
doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF);
}
return byteArray;
}
function base64ToBytes(str) {
return base64.toByteArray(base64clean(str));
}
function isnan(val) {
return val !== val; // eslint-disable-line no-self-compare
} /* WEBPACK VAR INJECTION */
}).call(this, __webpack_require__( /*! ./../webpack/buildin/global.js */
"./node_modules/webpack/buildin/global.js")); /***/
},
/***/ "./node_modules/buffer/node_modules/isarray/index.js":
/*!***********************************************************!*\
!*** ./node_modules/buffer/node_modules/isarray/index.js ***!
\***********************************************************/
/*! no static exports found */ /***/ function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function(arr) {
return toString.call(arr) == '[object Array]';
}; /***/
},
/***/ "./node_modules/charenc/charenc.js":
/*!*****************************************!*\
!*** ./node_modules/charenc/charenc.js ***!
\*****************************************/
/*! no static exports found */ /***/ function(module, exports) {
var charenc = { // UTF-8 encoding
utf8: { // Convert a string to a byte array
stringToBytes: function(str) {
return
charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
}, // Convert a byte array to a string
bytesToString: function(bytes) {
return
decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
}
}, // Binary encoding
bin: { // Convert a string to a byte array
stringToBytes: function(str) {
for (var bytes = [], i = 0; i < str.length; i++)
bytes.push(str.charCodeAt(i) & 0xFF);
return bytes;
}, // Convert a byte array to a string
bytesToString: function(bytes) {
for (var str = [], i = 0; i < bytes.length; i++)
str.push(String.fromCharCode(bytes[i]));
return str.join('');
}
}
};
module.exports = charenc; /***/
},
/***/ "./node_modules/crypt/crypt.js":
/*!*************************************!*\
!*** ./node_modules/crypt/crypt.js ***!
\*************************************/
/*! no static exports found */ /***/ function(module, exports) {
(function() {
var base64map =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
crypt = { // Bit-wise rotation left
rotl: function(n, b) {
return n << b | n >>> 32 - b;
}, // Bit-wise rotation right
rotr: function(n, b) {
return n << 32 - b | n >>> b;
}, // Swap big-endian to little-endian and vice versa
endian: function(n) { // If number given, swap endian
if (n.constructor == Number) {
return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n,
24) & 0xFF00FF00;
} // Else, assume array and swap all items
for (var i = 0; i < n.length; i++) n[i] =
crypt.endian(n[i]);
return n;
}, // Generate an array of any length of random bytes
randomBytes: function(n) {
for (var bytes = []; n > 0; n--)
bytes.push(Math.floor(Math.random() * 256));
return bytes;
}, // Convert a byte array to big-endian 32-bit words
bytesToWords: function(bytes) {
for (var words = [], i = 0, b = 0; i < bytes.length; i++, b
+= 8) words[b >>> 5] |= bytes[i] << 24 - b % 32;
return words;
}, // Convert big-endian 32-bit words to a byte array
wordsToBytes: function(words) {
for (var bytes = [], b = 0; b < words.length * 32; b += 8)
bytes.push(words[b >>> 5] >>> 24 - b % 32 & 0xFF);
return bytes;
}, // Convert a byte array to a hex string
bytesToHex: function(bytes) {
for (var hex = [], i = 0; i < bytes.length; i++) {
hex.push((bytes[i] >>> 4).toString(16));
hex.push((bytes[i] & 0xF).toString(16));
}
return hex.join('');
}, // Convert a hex string to a byte array
hexToBytes: function(hex) {
for (var bytes = [], c = 0; c < hex.length; c += 2)
bytes.push(parseInt(hex.substr(c, 2), 16));
return bytes;
}, // Convert a byte array to a base-64 string
bytesToBase64: function(bytes) {
for (var base64 = [], i = 0; i < bytes.length; i += 3) {
var triplet = bytes[i] << 16 | bytes[i + 1] << 8 |
bytes[i + 2];
for (var j = 0; j < 4; j++)
if (i * 8 + j * 6 <= bytes.length * 8)
base64.push(base64map.charAt(triplet >>> 6 * (3 - j) & 0x3F));
else base64.push('=');
}
return base64.join('');
}, // Convert a base-64 string to a byte array
base64ToBytes: function(base64) { // Remove non-base-64
characters
base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
imod4 = ++i % 4) {
if (imod4 == 0) continue;
bytes.push((base64map.indexOf(base64.charAt(i - 1)) &
Math.pow(2, -2 * imod4 + 8) - 1) << imod4 * 2 | base64map.indexOf(base64.charAt(i))
>>> 6 - imod4 * 2);
}
return bytes;
}
};
module.exports = crypt;
})(); /***/
},
/***/ "./node_modules/event-lite/event-lite.js":
/*!***********************************************!*\
!*** ./node_modules/event-lite/event-lite.js ***!
\***********************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
/**
* event-lite.js - Light-weight EventEmitter (less than 1KB when
gzipped)
*
* @copyright Yusuke Kawasaki
* @license MIT
* @constructor
* @see https://github.com/kawanet/event-lite
* @see http://kawanet.github.io/event-lite/EventLite.html
* @example
* var EventLite = require("event-lite");
*
* function MyClass() {...} // your class
*
* EventLite.mixin(MyClass.prototype); // import event methods
*
* var obj = new MyClass();
* obj.on("foo", function() {...}); // add event listener
* obj.once("bar", function() {...}); // add one-time event listener
* obj.emit("foo"); // dispatch event
* obj.emit("bar"); // dispatch another event
* obj.off("foo"); // remove event listener
*/
function EventLite() {
if (!(this instanceof EventLite)) return new EventLite();
}(function(EventLite) { // export the class for node.js
if (true) module.exports = EventLite; // property name to hold
listeners
var LISTENERS = "listeners"; // methods to export
var methods = {
on: on,
once: once,
off: off,
emit: emit
}; // mixin to self
mixin(EventLite.prototype); // export mixin function
EventLite.mixin = mixin;
/**
* Import on(), once(), off() and emit() methods into target
object.
*
* @function EventLite.mixin
* @param target {Prototype}
*/
function mixin(target) {
for (var key in methods) {
target[key] = methods[key];
}
return target;
}
/**
* Add an event listener.
*
* @function EventLite.prototype.on
* @param type {string}
* @param func {Function}
* @returns {EventLite} Self for method chaining
*/
function on(type, func) {
getListeners(this, type).push(func);
return this;
}
/**
* Add one-time event listener.
*
* @function EventLite.prototype.once
* @param type {string}
* @param func {Function}
* @returns {EventLite} Self for method chaining
*/
function once(type, func) {
var that = this;
wrap.originalListener = func;
getListeners(that, type).push(wrap);
return that;
function wrap() {
off.call(that, type, wrap);
func.apply(this, arguments);
}
}
/**
* Remove an event listener.
*
* @function EventLite.prototype.off
* @param [type] {string}
* @param [func] {Function}
* @returns {EventLite} Self for method chaining
*/
function off(type, func) {
var that = this;
var listners;
if (!arguments.length) {
delete that[LISTENERS];
} else if (!func) {
listners = that[LISTENERS];
if (listners) {
delete listners[type];
if (!Object.keys(listners).length) return off.call(that);
}
} else {
listners = getListeners(that, type, true);
if (listners) {
listners = listners.filter(ne);
if (!listners.length) return off.call(that, type);
that[LISTENERS][type] = listners;
}
}
return that;
function ne(test) {
return test !== func && test.originalListener !== func;
}
}
/**
* Dispatch (trigger) an event.
*
* @function EventLite.prototype.emit
* @param type {string}
* @param [value] {*}
* @returns {boolean} True when a listener received the event
*/
function emit(type, value) {
var that = this;
var listeners = getListeners(that, type, true);
if (!listeners) return false;
var arglen = arguments.length;
if (arglen === 1) {
listeners.forEach(zeroarg);
} else if (arglen === 2) {
listeners.forEach(onearg);
} else {
var args = Array.prototype.slice.call(arguments, 1);
listeners.forEach(moreargs);
}
return !!listeners.length;
function zeroarg(func) {
func.call(that);
}
function onearg(func) {
func.call(that, value);
}
function moreargs(func) {
func.apply(that, args);
}
}
/**
* @ignore
*/
function getListeners(that, type, readonly) {
if (readonly && !that[LISTENERS]) return;
var listeners = that[LISTENERS] || (that[LISTENERS] = {});
return listeners[type] || (listeners[type] = []);
}
})(EventLite); /***/
},
/***/ "./node_modules/ieee754/index.js":
/*!***************************************!*\
!*** ./node_modules/ieee754/index.js ***!
\***************************************/
/*! no static exports found */ /***/ function(module, exports) {
exports.read = function(buffer, offset, isLE, mLen, nBytes) {
var e, m;
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var nBits = -7;
var i = isLE ? nBytes - 1 : 0;
var d = isLE ? -1 : 1;
var s = buffer[offset + i];
i += d;
e = s & (1 << -nBits) - 1;
s >>= -nBits;
nBits += eLen;
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8)
{}
m = e & (1 << -nBits) - 1;
e >>= -nBits;
nBits += mLen;
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8)
{}
if (e === 0) {
e = 1 - eBias;
} else if (e === eMax) {
return m ? NaN : (s ? -1 : 1) * Infinity;
} else {
m = m + Math.pow(2, mLen);
e = e - eBias;
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
};
exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c;
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
var i = isLE ? 0 : nBytes - 1;
var d = isLE ? 1 : -1;
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
value = Math.abs(value);
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0;
e = eMax;
} else {
e = Math.floor(Math.log(value) / Math.LN2);
if (value * (c = Math.pow(2, -e)) < 1) {
e--;
c *= 2;
}
if (e + eBias >= 1) {
value += rt / c;
} else {
value += rt * Math.pow(2, 1 - eBias);
}
if (value * c >= 2) {
e++;
c /= 2;
}
if (e + eBias >= eMax) {
m = 0;
e = eMax;
} else if (e + eBias >= 1) {
m = (value * c - 1) * Math.pow(2, mLen);
e = e + eBias;
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
e = 0;
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen
-= 8) {}
e = e << mLen | m;
eLen += mLen;
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen
-= 8) {}
buffer[offset + i - d] |= s * 128;
}; /***/
},
/***/ "./node_modules/int64-buffer/int64-buffer.js":
/*!***************************************************!*\
!*** ./node_modules/int64-buffer/int64-buffer.js ***!
\***************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
/* WEBPACK VAR INJECTION */
(function(Buffer) { // int64-buffer.js
/*jshint -W018 */ // Confusing use of '!'.
/*jshint -W030 */ // Expected an assignment or function call and
instead saw an expression.
/*jshint -W093 */ // Did you mean to return a conditional instead of an
assignment?
var Uint64BE, Int64BE, Uint64LE, Int64LE;
! function(exports) { // constants
var UNDEFINED = "undefined";
var BUFFER = UNDEFINED !== typeof Buffer && Buffer;
var UINT8ARRAY = UNDEFINED !== typeof Uint8Array && Uint8Array;
var ARRAYBUFFER = UNDEFINED !== typeof ArrayBuffer && ArrayBuffer;
var ZERO = [0, 0, 0, 0, 0, 0, 0, 0];
var isArray = Array.isArray || _isArray;
var BIT32 = 4294967296;
var BIT24 = 16777216; // storage class
var storage; // Array;
// generate classes
Uint64BE = factory("Uint64BE", true, true);
Int64BE = factory("Int64BE", true, false);
Uint64LE = factory("Uint64LE", false, true);
Int64LE = factory("Int64LE", false, false); // class factory
function factory(name, bigendian, unsigned) {
var posH = bigendian ? 0 : 4;
var posL = bigendian ? 4 : 0;
var pos0 = bigendian ? 0 : 3;
var pos1 = bigendian ? 1 : 2;
var pos2 = bigendian ? 2 : 1;
var pos3 = bigendian ? 3 : 0;
var fromPositive = bigendian ? fromPositiveBE : fromPositiveLE;
var fromNegative = bigendian ? fromNegativeBE : fromNegativeLE;
var proto = Int64.prototype;
var isName = "is" + name;
var _isInt64 = "_" + isName; // properties
proto.buffer = void 0;
proto.offset = 0;
proto[_isInt64] = true; // methods
proto.toNumber = toNumber;
proto.toString = toString;
proto.toJSON = toNumber;
proto.toArray = toArray; // add .toBuffer() method only when
Buffer available
if (BUFFER) proto.toBuffer = toBuffer; // add .toArrayBuffer()
method only when Uint8Array available
if (UINT8ARRAY) proto.toArrayBuffer = toArrayBuffer; //
isUint64BE, isInt64BE
Int64[isName] = isInt64; // CommonJS
exports[name] = Int64;
return Int64; // constructor
function Int64(buffer, offset, value, raddix) {
if (!(this instanceof Int64)) return new Int64(buffer,
offset, value, raddix);
return init(this, buffer, offset, value, raddix);
} // isUint64BE, isInt64BE
function isInt64(b) {
return !!(b && b[_isInt64]);
} // initializer
function init(that, buffer, offset, value, raddix) {
if (UINT8ARRAY && ARRAYBUFFER) {
if (buffer instanceof ARRAYBUFFER) buffer = new
UINT8ARRAY(buffer);
if (value instanceof ARRAYBUFFER) value = new
UINT8ARRAY(value);
} // Int64BE() style
if (!buffer && !offset && !value && !storage) { // shortcut
to initialize with zero
that.buffer = newArray(ZERO, 0);
return;
} // Int64BE(value, raddix) style
if (!isValidBuffer(buffer, offset)) {
var _storage = storage || Array;
raddix = offset;
value = buffer;
offset = 0;
buffer = new _storage(8);
}
that.buffer = buffer;
that.offset = offset |= 0; // Int64BE(buffer, offset) style
if (UNDEFINED === typeof value) return; // Int64BE(buffer,
offset, value, raddix) style
if ("string" === typeof value) {
fromString(buffer, offset, value, raddix || 10);
} else if (isValidBuffer(value, raddix)) {
fromArray(buffer, offset, value, raddix);
} else if ("number" === typeof raddix) {
writeInt32(buffer, offset + posH, value); // high
writeInt32(buffer, offset + posL, raddix); // low
} else if (value > 0) {
fromPositive(buffer, offset, value); // positive
} else if (value < 0) {
fromNegative(buffer, offset, value); // negative
} else {
fromArray(buffer, offset, ZERO, 0); // zero, NaN and
others
}
}
function toNumber() {
var buffer = this.buffer;
var offset = this.offset;
var high = readInt32(buffer, offset + posH);
var low = readInt32(buffer, offset + posL);
if (!unsigned) high |= 0; // a trick to get signed
return high ? high * BIT32 + low : low;
}
function toString(radix) {
var buffer = this.buffer;
var offset = this.offset;
var high = readInt32(buffer, offset + posH);
var low = readInt32(buffer, offset + posL);
var str = "";
var sign = !unsigned && high & 0x80000000;
if (sign) {
high = ~high;
low = BIT32 - low;
}
radix = radix || 10;
while (1) {
var mod = high % radix * BIT32 + low;
high = Math.floor(high / radix);
low = Math.floor(mod / radix);
str = (mod % radix).toString(radix) + str;
if (!high && !low) break;
}
if (sign) {
str = "-" + str;
}
return str;
}
function toArray(raw) {
var buffer = this.buffer;
var offset = this.offset;
storage = null; // Array
if (raw !== false && offset === 0 && buffer.length === 8 &&
isArray(buffer)) return buffer;
return newArray(buffer, offset);
}
function toBuffer(raw) {
var buffer = this.buffer;
var offset = this.offset;
storage = BUFFER;
if (raw !== false && offset === 0 && buffer.length === 8 &&
Buffer.isBuffer(buffer)) return buffer;
var dest = new BUFFER(8);
fromArray(dest, 0, buffer, offset);
return dest;
}
function toArrayBuffer(raw) {
var buffer = this.buffer;
var offset = this.offset;
var arrbuf = buffer.buffer;
storage = UINT8ARRAY;
if (raw !== false && offset === 0 && arrbuf instanceof
ARRAYBUFFER && arrbuf.byteLength === 8) return arrbuf;
var dest = new UINT8ARRAY(8);
fromArray(dest, 0, buffer, offset);
return dest.buffer;
}
function isBuffer(obj) {
return !!obj.constructor && typeof obj.constructor.isBuffer ===
'function' && obj.constructor.isBuffer(obj);
} // For Node v0.10 support. Remove this eventually.
function isSlowBuffer(obj) {
return typeof obj.readFloatLE === 'function' && typeof obj.slice ===
'function' && isBuffer(obj.slice(0, 0));
} /***/
},
/***/ "./node_modules/md5/md5.js":
/*!*********************************!*\
!*** ./node_modules/md5/md5.js ***!
\*********************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
(function() {
var crypt = __webpack_require__( /*! crypt */
"./node_modules/crypt/crypt.js"),
utf8 = __webpack_require__( /*! charenc */
"./node_modules/charenc/charenc.js").utf8,
isBuffer = __webpack_require__( /*! is-buffer */
"./node_modules/is-buffer/index.js"),
bin = __webpack_require__( /*! charenc */
"./node_modules/charenc/charenc.js").bin, // The core
md5 = function(message, options) { // Convert to byte array
if (message.constructor == String) {
if (options && options.encoding === 'binary') message =
bin.stringToBytes(message);
else message = utf8.stringToBytes(message);
} else if (isBuffer(message)) message =
Array.prototype.slice.call(message, 0);
else if (!Array.isArray(message)) message = message.toString();
// else, assume byte array already
var m = crypt.bytesToWords(message),
l = message.length * 8,
a = 1732584193,
b = -271733879,
c = -1732584194,
d = 271733878; // Swap endian
for (var i = 0; i < m.length; i++) {
m[i] = (m[i] << 8 | m[i] >>> 24) & 0x00FF00FF | (m[i] << 24
| m[i] >>> 8) & 0xFF00FF00;
} // Padding
m[l >>> 5] |= 0x80 << l % 32;
m[(l + 64 >>> 9 << 4) + 14] = l; // Method shortcuts
var FF = md5._ff,
GG = md5._gg,
HH = md5._hh,
II = md5._ii;
for (var i = 0; i < m.length; i += 16) {
var aa = a,
bb = b,
cc = c,
dd = d;
a = FF(a, b, c, d, m[i + 0], 7, -680876936);
d = FF(d, a, b, c, m[i + 1], 12, -389564586);
c = FF(c, d, a, b, m[i + 2], 17, 606105819);
b = FF(b, c, d, a, m[i + 3], 22, -1044525330);
a = FF(a, b, c, d, m[i + 4], 7, -176418897);
d = FF(d, a, b, c, m[i + 5], 12, 1200080426);
c = FF(c, d, a, b, m[i + 6], 17, -1473231341);
b = FF(b, c, d, a, m[i + 7], 22, -45705983);
a = FF(a, b, c, d, m[i + 8], 7, 1770035416);
d = FF(d, a, b, c, m[i + 9], 12, -1958414417);
c = FF(c, d, a, b, m[i + 10], 17, -42063);
b = FF(b, c, d, a, m[i + 11], 22, -1990404162);
a = FF(a, b, c, d, m[i + 12], 7, 1804603682);
d = FF(d, a, b, c, m[i + 13], 12, -40341101);
c = FF(c, d, a, b, m[i + 14], 17, -1502002290);
b = FF(b, c, d, a, m[i + 15], 22, 1236535329);
a = GG(a, b, c, d, m[i + 1], 5, -165796510);
d = GG(d, a, b, c, m[i + 6], 9, -1069501632);
c = GG(c, d, a, b, m[i + 11], 14, 643717713);
b = GG(b, c, d, a, m[i + 0], 20, -373897302);
a = GG(a, b, c, d, m[i + 5], 5, -701558691);
d = GG(d, a, b, c, m[i + 10], 9, 38016083);
c = GG(c, d, a, b, m[i + 15], 14, -660478335);
b = GG(b, c, d, a, m[i + 4], 20, -405537848);
a = GG(a, b, c, d, m[i + 9], 5, 568446438);
d = GG(d, a, b, c, m[i + 14], 9, -1019803690);
c = GG(c, d, a, b, m[i + 3], 14, -187363961);
b = GG(b, c, d, a, m[i + 8], 20, 1163531501);
a = GG(a, b, c, d, m[i + 13], 5, -1444681467);
d = GG(d, a, b, c, m[i + 2], 9, -51403784);
c = GG(c, d, a, b, m[i + 7], 14, 1735328473);
b = GG(b, c, d, a, m[i + 12], 20, -1926607734);
a = HH(a, b, c, d, m[i + 5], 4, -378558);
d = HH(d, a, b, c, m[i + 8], 11, -2022574463);
c = HH(c, d, a, b, m[i + 11], 16, 1839030562);
b = HH(b, c, d, a, m[i + 14], 23, -35309556);
a = HH(a, b, c, d, m[i + 1], 4, -1530992060);
d = HH(d, a, b, c, m[i + 4], 11, 1272893353);
c = HH(c, d, a, b, m[i + 7], 16, -155497632);
b = HH(b, c, d, a, m[i + 10], 23, -1094730640);
a = HH(a, b, c, d, m[i + 13], 4, 681279174);
d = HH(d, a, b, c, m[i + 0], 11, -358537222);
c = HH(c, d, a, b, m[i + 3], 16, -722521979);
b = HH(b, c, d, a, m[i + 6], 23, 76029189);
a = HH(a, b, c, d, m[i + 9], 4, -640364487);
d = HH(d, a, b, c, m[i + 12], 11, -421815835);
c = HH(c, d, a, b, m[i + 15], 16, 530742520);
b = HH(b, c, d, a, m[i + 2], 23, -995338651);
a = II(a, b, c, d, m[i + 0], 6, -198630844);
d = II(d, a, b, c, m[i + 7], 10, 1126891415);
c = II(c, d, a, b, m[i + 14], 15, -1416354905);
b = II(b, c, d, a, m[i + 5], 21, -57434055);
a = II(a, b, c, d, m[i + 12], 6, 1700485571);
d = II(d, a, b, c, m[i + 3], 10, -1894986606);
c = II(c, d, a, b, m[i + 10], 15, -1051523);
b = II(b, c, d, a, m[i + 1], 21, -2054922799);
a = II(a, b, c, d, m[i + 8], 6, 1873313359);
d = II(d, a, b, c, m[i + 15], 10, -30611744);
c = II(c, d, a, b, m[i + 6], 15, -1560198380);
b = II(b, c, d, a, m[i + 13], 21, 1309151649);
a = II(a, b, c, d, m[i + 4], 6, -145523070);
d = II(d, a, b, c, m[i + 11], 10, -1120210379);
c = II(c, d, a, b, m[i + 2], 15, 718787259);
b = II(b, c, d, a, m[i + 9], 21, -343485551);
a = a + aa >>> 0;
b = b + bb >>> 0;
c = c + cc >>> 0;
d = d + dd >>> 0;
}
return crypt.endian([a, b, c, d]);
}; // Auxiliary functions
md5._ff = function(a, b, c, d, x, s, t) {
var n = a + (b & c | ~b & d) + (x >>> 0) + t;
return (n << s | n >>> 32 - s) + b;
};
md5._gg = function(a, b, c, d, x, s, t) {
var n = a + (b & d | c & ~d) + (x >>> 0) + t;
return (n << s | n >>> 32 - s) + b;
};
md5._hh = function(a, b, c, d, x, s, t) {
var n = a + (b ^ c ^ d) + (x >>> 0) + t;
return (n << s | n >>> 32 - s) + b;
};
md5._ii = function(a, b, c, d, x, s, t) {
var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
return (n << s | n >>> 32 - s) + b;
}; // Package private blocksize
md5._blocksize = 16;
md5._digestsize = 16;
module.exports = function(message, options) {
if (message === undefined || message === null) throw new
Error('Illegal argument ' + message);
var digestbytes = crypt.wordsToBytes(md5(message, options));
return options && options.asBytes ? digestbytes : options &&
options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes);
};
})(); /***/
},
/***/ "./node_modules/msgpack-lite/lib/browser.js":
/*!**************************************************!*\
!*** ./node_modules/msgpack-lite/lib/browser.js ***!
\**************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // browser.js
exports.encode = __webpack_require__( /*! ./encode */
"./node_modules/msgpack-lite/lib/encode.js").encode;
exports.decode = __webpack_require__( /*! ./decode */
"./node_modules/msgpack-lite/lib/decode.js").decode;
exports.Encoder = __webpack_require__( /*! ./encoder */
"./node_modules/msgpack-lite/lib/encoder.js").Encoder;
exports.Decoder = __webpack_require__( /*! ./decoder */
"./node_modules/msgpack-lite/lib/decoder.js").Decoder;
exports.createCodec = __webpack_require__( /*! ./ext */
"./node_modules/msgpack-lite/lib/ext.js").createCodec;
exports.codec = __webpack_require__( /*! ./codec */
"./node_modules/msgpack-lite/lib/codec.js").codec; /***/
},
/***/ "./node_modules/msgpack-lite/lib/buffer-global.js":
/*!********************************************************!*\
!*** ./node_modules/msgpack-lite/lib/buffer-global.js ***!
\********************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
/* WEBPACK VAR INJECTION */
(function(Buffer) {
/* globals Buffer */
module.exports = c("undefined" !== typeof Buffer && Buffer) ||
c(this.Buffer) || c("undefined" !== typeof window && window.Buffer) || this.Buffer;
function c(B) {
return B && B.isBuffer && B;
} /* WEBPACK VAR INJECTION */
}).call(this, __webpack_require__( /*! ./../../buffer/index.js */
"./node_modules/buffer/index.js").Buffer); /***/
},
/***/ "./node_modules/msgpack-lite/lib/buffer-lite.js":
/*!******************************************************!*\
!*** ./node_modules/msgpack-lite/lib/buffer-lite.js ***!
\******************************************************/
/*! no static exports found */ /***/ function(module, exports) { // buffer-
lite.js
var MAXBUFLEN = 8192;
exports.copy = copy;
exports.toString = toString;
exports.write = write;
/**
* Buffer.prototype.write()
*
* @param string {String}
* @param [offset] {Number}
* @returns {Number}
*/
function write(string, offset) {
var buffer = this;
var index = offset || (offset |= 0);
var length = string.length;
var chr = 0;
var i = 0;
while (i < length) {
chr = string.charCodeAt(i++);
if (chr < 128) {
buffer[index++] = chr;
} else if (chr < 0x800) { // 2 bytes
buffer[index++] = 0xC0 | chr >>> 6;
buffer[index++] = 0x80 | chr & 0x3F;
} else if (chr < 0xD800 || chr > 0xDFFF) { // 3 bytes
buffer[index++] = 0xE0 | chr >>> 12;
buffer[index++] = 0x80 | chr >>> 6 & 0x3F;
buffer[index++] = 0x80 | chr & 0x3F;
} else { // 4 bytes - surrogate pair
chr = (chr - 0xD800 << 10 | string.charCodeAt(i++) - 0xDC00) +
0x10000;
buffer[index++] = 0xF0 | chr >>> 18;
buffer[index++] = 0x80 | chr >>> 12 & 0x3F;
buffer[index++] = 0x80 | chr >>> 6 & 0x3F;
buffer[index++] = 0x80 | chr & 0x3F;
}
}
return index - offset;
}
/**
* Buffer.prototype.toString()
*
* @param [encoding] {String} ignored
* @param [start] {Number}
* @param [end] {Number}
* @returns {String}
*/
function toString(encoding, start, end) {
var buffer = this;
var index = start | 0;
if (!end) end = buffer.length;
var string = '';
var chr = 0;
while (index < end) {
chr = buffer[index++];
if (chr < 128) {
string += String.fromCharCode(chr);
continue;
}
if ((chr & 0xE0) === 0xC0) { // 2 bytes
chr = (chr & 0x1F) << 6 | buffer[index++] & 0x3F;
} else if ((chr & 0xF0) === 0xE0) { // 3 bytes
chr = (chr & 0x0F) << 12 | (buffer[index++] & 0x3F) << 6 |
buffer[index++] & 0x3F;
} else if ((chr & 0xF8) === 0xF0) { // 4 bytes
chr = (chr & 0x07) << 18 | (buffer[index++] & 0x3F) << 12 |
(buffer[index++] & 0x3F) << 6 | buffer[index++] & 0x3F;
}
if (chr >= 0x010000) { // A surrogate pair
chr -= 0x010000;
string += String.fromCharCode((chr >>> 10) + 0xD800, (chr &
0x3FF) + 0xDC00);
} else {
string += String.fromCharCode(chr);
}
}
return string;
}
/**
* Buffer.prototype.copy()
*
* @param target {Buffer}
* @param [targetStart] {Number}
* @param [start] {Number}
* @param [end] {Number}
* @returns {number}
*/
function copy(target, targetStart, start, end) {
var i;
if (!start) start = 0;
if (!end && end !== 0) end = this.length;
if (!targetStart) targetStart = 0;
var len = end - start;
if (target === this && start < targetStart && targetStart < end) { //
descending
for (i = len - 1; i >= 0; i--) {
target[i + targetStart] = this[i + start];
}
} else { // ascending
for (i = 0; i < len; i++) {
target[i + targetStart] = this[i + start];
}
}
return len;
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/bufferish-array.js":
/*!**********************************************************!*\
!*** ./node_modules/msgpack-lite/lib/bufferish-array.js ***!
\**********************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // bufferish-array.js
var Bufferish = __webpack_require__( /*! ./bufferish */
"./node_modules/msgpack-lite/lib/bufferish.js");
var exports = module.exports = alloc(0);
exports.alloc = alloc;
exports.concat = Bufferish.concat;
exports.from = from;
/**
* @param size {Number}
* @returns {Buffer|Uint8Array|Array}
*/
function alloc(size) {
return new Array(size);
}
/**
* @param value {Array|ArrayBuffer|Buffer|String}
* @returns {Array}
*/
function from(value) {
if (!Bufferish.isBuffer(value) && Bufferish.isView(value)) { //
TypedArray to Uint8Array
value = Bufferish.Uint8Array.from(value);
} else if (Bufferish.isArrayBuffer(value)) { // ArrayBuffer to
Uint8Array
value = new Uint8Array(value);
} else if (typeof value === "string") { // String to Array
return Bufferish.from.call(exports, value);
} else if (typeof value === "number") {
throw new TypeError('"value" argument must not be a number');
} // Array-like to Array
return Array.prototype.slice.call(value);
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/bufferish-buffer.js":
/*!***********************************************************!*\
!*** ./node_modules/msgpack-lite/lib/bufferish-buffer.js ***!
\***********************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // bufferish-buffer.js
var Bufferish = __webpack_require__( /*! ./bufferish */
"./node_modules/msgpack-lite/lib/bufferish.js");
var Buffer = Bufferish.global;
var exports = module.exports = Bufferish.hasBuffer ? alloc(0) : [];
exports.alloc = Bufferish.hasBuffer && Buffer.alloc || alloc;
exports.concat = Bufferish.concat;
exports.from = from;
/**
* @param size {Number}
* @returns {Buffer|Uint8Array|Array}
*/
function alloc(size) {
return new Buffer(size);
}
/**
* @param value {Array|ArrayBuffer|Buffer|String}
* @returns {Buffer}
*/
function from(value) {
if (!Bufferish.isBuffer(value) && Bufferish.isView(value)) { //
TypedArray to Uint8Array
value = Bufferish.Uint8Array.from(value);
} else if (Bufferish.isArrayBuffer(value)) { // ArrayBuffer to
Uint8Array
value = new Uint8Array(value);
} else if (typeof value === "string") { // String to Buffer
return Bufferish.from.call(exports, value);
} else if (typeof value === "number") {
throw new TypeError('"value" argument must not be a number');
} // Array-like to Buffer
if (Buffer.from && Buffer.from.length !== 1) {
return Buffer.from(value); // node v6+
} else {
return new Buffer(value); // node v4
}
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/bufferish-proto.js":
/*!**********************************************************!*\
!*** ./node_modules/msgpack-lite/lib/bufferish-proto.js ***!
\**********************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // bufferish-proto.js
/* jshint eqnull:true */
var BufferLite = __webpack_require__( /*! ./buffer-lite */
"./node_modules/msgpack-lite/lib/buffer-lite.js");
exports.copy = copy;
exports.slice = slice;
exports.toString = toString;
exports.write = gen("write");
var Bufferish = __webpack_require__( /*! ./bufferish */
"./node_modules/msgpack-lite/lib/bufferish.js");
var Buffer = Bufferish.global;
var isBufferShim = Bufferish.hasBuffer && "TYPED_ARRAY_SUPPORT" in Buffer;
var brokenTypedArray = isBufferShim && !Buffer.TYPED_ARRAY_SUPPORT;
/**
* @param target {Buffer|Uint8Array|Array}
* @param [targetStart] {Number}
* @param [start] {Number}
* @param [end] {Number}
* @returns {Buffer|Uint8Array|Array}
*/
function copy(target, targetStart, start, end) {
var thisIsBuffer = Bufferish.isBuffer(this);
var targetIsBuffer = Bufferish.isBuffer(target);
if (thisIsBuffer && targetIsBuffer) { // Buffer to Buffer
return this.copy(target, targetStart, start, end);
} else if (!brokenTypedArray && !thisIsBuffer && !targetIsBuffer &&
Bufferish.isView(this) && Bufferish.isView(target)) { // Uint8Array to Uint8Array
(except for minor some browsers)
var buffer = start || end != null ? slice.call(this, start, end) :
this;
target.set(buffer, targetStart);
return buffer.length;
} else { // other cases
return BufferLite.copy.call(this, target, targetStart, start, end);
}
}
/**
* @param [start] {Number}
* @param [end] {Number}
* @returns {Buffer|Uint8Array|Array}
*/
function slice(start, end) { // for Buffer, Uint8Array (except for minor
some browsers) and Array
var f = this.slice || !brokenTypedArray && this.subarray;
if (f) return f.call(this, start, end); // Uint8Array (for minor some
browsers)
var target = Bufferish.alloc.call(this, end - start);
copy.call(this, target, 0, start, end);
return target;
}
/**
* Buffer.prototype.toString()
*
* @param [encoding] {String} ignored
* @param [start] {Number}
* @param [end] {Number}
* @returns {String}
*/
function toString(encoding, start, end) {
var f = !isBufferShim && Bufferish.isBuffer(this) ? this.toString :
BufferLite.toString;
return f.apply(this, arguments);
}
/**
* @private
*/
function gen(method) {
return wrap;
function wrap() {
var f = this[method] || BufferLite[method];
return f.apply(this, arguments);
}
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/bufferish-uint8array.js":
/*!***************************************************************!*\
!*** ./node_modules/msgpack-lite/lib/bufferish-uint8array.js ***!
\***************************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // bufferish-uint8array.js
var Bufferish = __webpack_require__( /*! ./bufferish */
"./node_modules/msgpack-lite/lib/bufferish.js");
var exports = module.exports = Bufferish.hasArrayBuffer ? alloc(0) : [];
exports.alloc = alloc;
exports.concat = Bufferish.concat;
exports.from = from;
/**
* @param size {Number}
* @returns {Buffer|Uint8Array|Array}
*/
function alloc(size) {
return new Uint8Array(size);
}
/**
* @param value {Array|ArrayBuffer|Buffer|String}
* @returns {Uint8Array}
*/
function from(value) {
if (Bufferish.isView(value)) { // TypedArray to ArrayBuffer
var byteOffset = value.byteOffset;
var byteLength = value.byteLength;
value = value.buffer;
if (value.byteLength !== byteLength) {
if (value.slice) {
value = value.slice(byteOffset, byteOffset + byteLength);
} else { // Android 4.1 does not have
ArrayBuffer.prototype.slice
value = new Uint8Array(value);
if (value.byteLength !== byteLength) { // TypedArray to
ArrayBuffer to Uint8Array to Array
value = Array.prototype.slice.call(value, byteOffset,
byteOffset + byteLength);
}
}
}
} else if (typeof value === "string") { // String to Uint8Array
return Bufferish.from.call(exports, value);
} else if (typeof value === "number") {
throw new TypeError('"value" argument must not be a number');
}
return new Uint8Array(value);
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/bufferish.js":
/*!****************************************************!*\
!*** ./node_modules/msgpack-lite/lib/bufferish.js ***!
\****************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // bufferish.js
var Buffer = exports.global = __webpack_require__( /*! ./buffer-global */
"./node_modules/msgpack-lite/lib/buffer-global.js");
var hasBuffer = exports.hasBuffer = Buffer && !!Buffer.isBuffer;
var hasArrayBuffer = exports.hasArrayBuffer = "undefined" !== typeof
ArrayBuffer;
var isArray = exports.isArray = __webpack_require__( /*! isarray */
"./node_modules/msgpack-lite/node_modules/isarray/index.js");
exports.isArrayBuffer = hasArrayBuffer ? isArrayBuffer : _false;
var isBuffer = exports.isBuffer = hasBuffer ? Buffer.isBuffer : _false;
var isView = exports.isView = hasArrayBuffer ? ArrayBuffer.isView ||
_is("ArrayBuffer", "buffer") : _false;
exports.alloc = alloc;
exports.concat = concat;
exports.from = from;
var BufferArray = exports.Array = __webpack_require__( /*! ./bufferish-
array */ "./node_modules/msgpack-lite/lib/bufferish-array.js");
var BufferBuffer = exports.Buffer = __webpack_require__( /*! ./bufferish-
buffer */ "./node_modules/msgpack-lite/lib/bufferish-buffer.js");
var BufferUint8Array = exports.Uint8Array = __webpack_require__( /*!
./bufferish-uint8array */ "./node_modules/msgpack-lite/lib/bufferish-
uint8array.js");
var BufferProto = exports.prototype = __webpack_require__( /*! ./bufferish-
proto */ "./node_modules/msgpack-lite/lib/bufferish-proto.js");
/**
* @param value {Array|ArrayBuffer|Buffer|String}
* @returns {Buffer|Uint8Array|Array}
*/
function from(value) {
if (typeof value === "string") {
return fromString.call(this, value);
} else {
return auto(this).from(value);
}
}
/**
* @param size {Number}
* @returns {Buffer|Uint8Array|Array}
*/
function alloc(size) {
return auto(this).alloc(size);
}
/**
* @param list {Array} array of (Buffer|Uint8Array|Array)s
* @param [length]
* @returns {Buffer|Uint8Array|Array}
*/
function concat(list, length) {
if (!length) {
length = 0;
Array.prototype.forEach.call(list, dryrun);
}
var ref = this !== exports && this || list[0];
var result = alloc.call(ref, length);
var offset = 0;
Array.prototype.forEach.call(list, append);
return result;
function dryrun(buffer) {
length += buffer.length;
}
function append(buffer) {
offset += BufferProto.copy.call(buffer, result, offset);
}
}
var _isArrayBuffer = _is("ArrayBuffer");
function isArrayBuffer(value) {
return value instanceof ArrayBuffer || _isArrayBuffer(value);
}
/**
* @private
*/
function fromString(value) {
var expected = value.length * 3;
var that = alloc.call(this, expected);
var actual = BufferProto.write.call(that, value);
if (expected !== actual) {
that = BufferProto.slice.call(that, 0, actual);
}
return that;
}
function auto(that) {
return isBuffer(that) ? BufferBuffer : isView(that) ?
BufferUint8Array : isArray(that) ? BufferArray : hasBuffer ? BufferBuffer :
hasArrayBuffer ? BufferUint8Array : BufferArray;
}
function _false() {
return false;
}
function Codec(options) {
if (!(this instanceof Codec)) return new Codec(options);
this.options = options;
this.init();
}
Codec.prototype.init = function() {
var options = this.options;
if (options && options.uint8array) {
this.bufferish = Bufferish.Uint8Array;
}
return this;
};
function install(props) {
for (var key in props) {
Codec.prototype[key] = add(Codec.prototype[key], props[key]);
}
}
function add(a, b) {
return a && b ? ab : a || b;
function ab() {
a.apply(this, arguments);
return b.apply(this, arguments);
}
}
function join(filters) {
filters = filters.slice();
return function(value) {
return filters.reduce(iterator, value);
};
function filter(filter) {
return IS_ARRAY(filter) ? join(filter) : filter;
} // @public
// msgpack.createCodec()
function createCodec(options) {
return new Codec(options);
} // default shared codec
exports.preset = createCodec({
preset: true
}); /***/
},
/***/ "./node_modules/msgpack-lite/lib/codec.js":
/*!************************************************!*\
!*** ./node_modules/msgpack-lite/lib/codec.js ***!
\************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // codec.js
// load both interfaces
__webpack_require__( /*! ./read-core */
"./node_modules/msgpack-lite/lib/read-core.js");
__webpack_require__( /*! ./write-core */
"./node_modules/msgpack-lite/lib/write-core.js"); // @public
// msgpack.codec.preset
exports.codec = {
preset: __webpack_require__( /*! ./codec-base */
"./node_modules/msgpack-lite/lib/codec-base.js").preset
}; /***/
},
/***/ "./node_modules/msgpack-lite/lib/decode-buffer.js":
/*!********************************************************!*\
!*** ./node_modules/msgpack-lite/lib/decode-buffer.js ***!
\********************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // decode-buffer.js
exports.DecodeBuffer = DecodeBuffer;
var preset = __webpack_require__( /*! ./read-core */
"./node_modules/msgpack-lite/lib/read-core.js").preset;
var FlexDecoder = __webpack_require__( /*! ./flex-buffer */
"./node_modules/msgpack-lite/lib/flex-buffer.js").FlexDecoder;
FlexDecoder.mixin(DecodeBuffer.prototype);
function DecodeBuffer(options) {
if (!(this instanceof DecodeBuffer)) return new DecodeBuffer(options);
if (options) {
this.options = options;
if (options.codec) {
var codec = this.codec = options.codec;
if (codec.bufferish) this.bufferish = codec.bufferish;
}
}
}
DecodeBuffer.prototype.codec = preset;
DecodeBuffer.prototype.fetch = function() {
return this.codec.decode(this);
}; /***/
},
/***/ "./node_modules/msgpack-lite/lib/decode.js":
/*!*************************************************!*\
!*** ./node_modules/msgpack-lite/lib/decode.js ***!
\*************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // decode.js
exports.decode = decode;
var DecodeBuffer = __webpack_require__( /*! ./decode-buffer */
"./node_modules/msgpack-lite/lib/decode-buffer.js").DecodeBuffer;
function Decoder(options) {
if (!(this instanceof Decoder)) return new Decoder(options);
DecodeBuffer.call(this, options);
}
Decoder.prototype = new DecodeBuffer();
EventLite.mixin(Decoder.prototype);
Decoder.prototype.decode = function(chunk) {
if (arguments.length) this.write(chunk);
this.flush();
};
Decoder.prototype.push = function(chunk) {
this.emit("data", chunk);
};
Decoder.prototype.end = function(chunk) {
this.decode(chunk);
this.emit("end");
}; /***/
},
/***/ "./node_modules/msgpack-lite/lib/encode-buffer.js":
/*!********************************************************!*\
!*** ./node_modules/msgpack-lite/lib/encode-buffer.js ***!
\********************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // encode-buffer.js
exports.EncodeBuffer = EncodeBuffer;
var preset = __webpack_require__( /*! ./write-core */
"./node_modules/msgpack-lite/lib/write-core.js").preset;
var FlexEncoder = __webpack_require__( /*! ./flex-buffer */
"./node_modules/msgpack-lite/lib/flex-buffer.js").FlexEncoder;
FlexEncoder.mixin(EncodeBuffer.prototype);
function EncodeBuffer(options) {
if (!(this instanceof EncodeBuffer)) return new EncodeBuffer(options);
if (options) {
this.options = options;
if (options.codec) {
var codec = this.codec = options.codec;
if (codec.bufferish) this.bufferish = codec.bufferish;
}
}
}
EncodeBuffer.prototype.codec = preset;
EncodeBuffer.prototype.write = function(input) {
this.codec.encode(this, input);
}; /***/
},
/***/ "./node_modules/msgpack-lite/lib/encode.js":
/*!*************************************************!*\
!*** ./node_modules/msgpack-lite/lib/encode.js ***!
\*************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // encode.js
exports.encode = encode;
var EncodeBuffer = __webpack_require__( /*! ./encode-buffer */
"./node_modules/msgpack-lite/lib/encode-buffer.js").EncodeBuffer;
function Encoder(options) {
if (!(this instanceof Encoder)) return new Encoder(options);
EncodeBuffer.call(this, options);
}
Encoder.prototype = new EncodeBuffer();
EventLite.mixin(Encoder.prototype);
Encoder.prototype.encode = function(chunk) {
this.write(chunk);
this.emit("data", this.read());
};
Encoder.prototype.end = function(chunk) {
if (arguments.length) this.encode(chunk);
this.flush();
this.emit("end");
}; /***/
},
/***/ "./node_modules/msgpack-lite/lib/ext-buffer.js":
/*!*****************************************************!*\
!*** ./node_modules/msgpack-lite/lib/ext-buffer.js ***!
\*****************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // ext-buffer.js
exports.ExtBuffer = ExtBuffer;
var Bufferish = __webpack_require__( /*! ./bufferish */
"./node_modules/msgpack-lite/lib/bufferish.js");
function setExtPackers(codec) {
codec.addExtPacker(0x0E, Error, [packError, encode]);
codec.addExtPacker(0x01, EvalError, [packError, encode]);
codec.addExtPacker(0x02, RangeError, [packError, encode]);
codec.addExtPacker(0x03, ReferenceError, [packError, encode]);
codec.addExtPacker(0x04, SyntaxError, [packError, encode]);
codec.addExtPacker(0x05, TypeError, [packError, encode]);
codec.addExtPacker(0x06, URIError, [packError, encode]);
codec.addExtPacker(0x0A, RegExp, [packRegExp, encode]);
codec.addExtPacker(0x0B, Boolean, [packValueOf, encode]);
codec.addExtPacker(0x0C, String, [packValueOf, encode]);
codec.addExtPacker(0x0D, Date, [Number, encode]);
codec.addExtPacker(0x0F, Number, [packValueOf, encode]);
if ("undefined" !== typeof Uint8Array) {
codec.addExtPacker(0x11, Int8Array, packTypedArray);
codec.addExtPacker(0x12, Uint8Array, packTypedArray);
codec.addExtPacker(0x13, Int16Array, packTypedArray);
codec.addExtPacker(0x14, Uint16Array, packTypedArray);
codec.addExtPacker(0x15, Int32Array, packTypedArray);
codec.addExtPacker(0x16, Uint32Array, packTypedArray);
codec.addExtPacker(0x17, Float32Array, packTypedArray); //
PhantomJS/1.9.7 doesn't have Float64Array
if ("undefined" !== typeof Float64Array) {
codec.addExtPacker(0x18, Float64Array, packTypedArray);
} // IE10 doesn't have Uint8ClampedArray
if ("undefined" !== typeof Uint8ClampedArray) {
codec.addExtPacker(0x19, Uint8ClampedArray, packTypedArray);
}
codec.addExtPacker(0x1A, ArrayBuffer, packTypedArray);
codec.addExtPacker(0x1D, DataView, packTypedArray);
}
if (Bufferish.hasBuffer) {
codec.addExtPacker(0x1B, Buffer, Bufferish.from);
}
}
function encode(input) {
if (!_encode) _encode = __webpack_require__( /*! ./encode */
"./node_modules/msgpack-lite/lib/encode.js").encode; // lazy load
return _encode(input);
}
function packValueOf(value) {
return value.valueOf();
}
function packRegExp(value) {
value = RegExp.prototype.toString.call(value).split("/");
value.shift();
var out = [value.pop()];
out.unshift(value.join("/"));
return out;
}
function packError(value) {
var out = {};
for (var key in ERROR_COLUMNS) {
out[key] = value[key];
}
return out;
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/ext-unpacker.js":
/*!*******************************************************!*\
!*** ./node_modules/msgpack-lite/lib/ext-unpacker.js ***!
\*******************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // ext-unpacker.js
exports.setExtUnpackers = setExtUnpackers;
var Bufferish = __webpack_require__( /*! ./bufferish */
"./node_modules/msgpack-lite/lib/bufferish.js");
var Buffer = Bufferish.global;
var _decode;
var ERROR_COLUMNS = {
name: 1,
message: 1,
stack: 1,
columnNumber: 1,
fileName: 1,
lineNumber: 1
};
function setExtUnpackers(codec) {
codec.addExtUnpacker(0x0E, [decode, unpackError(Error)]);
codec.addExtUnpacker(0x01, [decode, unpackError(EvalError)]);
codec.addExtUnpacker(0x02, [decode, unpackError(RangeError)]);
codec.addExtUnpacker(0x03, [decode, unpackError(ReferenceError)]);
codec.addExtUnpacker(0x04, [decode, unpackError(SyntaxError)]);
codec.addExtUnpacker(0x05, [decode, unpackError(TypeError)]);
codec.addExtUnpacker(0x06, [decode, unpackError(URIError)]);
codec.addExtUnpacker(0x0A, [decode, unpackRegExp]);
codec.addExtUnpacker(0x0B, [decode, unpackClass(Boolean)]);
codec.addExtUnpacker(0x0C, [decode, unpackClass(String)]);
codec.addExtUnpacker(0x0D, [decode, unpackClass(Date)]);
codec.addExtUnpacker(0x0F, [decode, unpackClass(Number)]);
if ("undefined" !== typeof Uint8Array) {
codec.addExtUnpacker(0x11, unpackClass(Int8Array));
codec.addExtUnpacker(0x12, unpackClass(Uint8Array));
codec.addExtUnpacker(0x13, [unpackArrayBuffer,
unpackClass(Int16Array)]);
codec.addExtUnpacker(0x14, [unpackArrayBuffer,
unpackClass(Uint16Array)]);
codec.addExtUnpacker(0x15, [unpackArrayBuffer,
unpackClass(Int32Array)]);
codec.addExtUnpacker(0x16, [unpackArrayBuffer,
unpackClass(Uint32Array)]);
codec.addExtUnpacker(0x17, [unpackArrayBuffer,
unpackClass(Float32Array)]); // PhantomJS/1.9.7 doesn't have Float64Array
if ("undefined" !== typeof Float64Array) {
codec.addExtUnpacker(0x18, [unpackArrayBuffer,
unpackClass(Float64Array)]);
} // IE10 doesn't have Uint8ClampedArray
if ("undefined" !== typeof Uint8ClampedArray) {
codec.addExtUnpacker(0x19, unpackClass(Uint8ClampedArray));
}
codec.addExtUnpacker(0x1A, unpackArrayBuffer);
codec.addExtUnpacker(0x1D, [unpackArrayBuffer,
unpackClass(DataView)]);
}
if (Bufferish.hasBuffer) {
codec.addExtUnpacker(0x1B, unpackClass(Buffer));
}
}
function decode(input) {
if (!_decode) _decode = __webpack_require__( /*! ./decode */
"./node_modules/msgpack-lite/lib/decode.js").decode; // lazy load
return _decode(input);
}
function unpackRegExp(value) {
return RegExp.apply(null, value);
}
function unpackError(Class) {
return function(value) {
var out = new Class();
for (var key in ERROR_COLUMNS) {
out[key] = value[key];
}
return out;
};
}
function unpackClass(Class) {
return function(value) {
return new Class(value);
};
}
function unpackArrayBuffer(value) {
return new Uint8Array(value).buffer;
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/ext.js":
/*!**********************************************!*\
!*** ./node_modules/msgpack-lite/lib/ext.js ***!
\**********************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // ext.js
// load both interfaces
__webpack_require__( /*! ./read-core */
"./node_modules/msgpack-lite/lib/read-core.js");
__webpack_require__( /*! ./write-core */
"./node_modules/msgpack-lite/lib/write-core.js");
exports.createCodec = __webpack_require__( /*! ./codec-base */
"./node_modules/msgpack-lite/lib/codec-base.js").createCodec; /***/
},
/***/ "./node_modules/msgpack-lite/lib/flex-buffer.js":
/*!******************************************************!*\
!*** ./node_modules/msgpack-lite/lib/flex-buffer.js ***!
\******************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // flex-buffer.js
exports.FlexDecoder = FlexDecoder;
exports.FlexEncoder = FlexEncoder;
var Bufferish = __webpack_require__( /*! ./bufferish */
"./node_modules/msgpack-lite/lib/bufferish.js");
var MIN_BUFFER_SIZE = 2048;
var MAX_BUFFER_SIZE = 65536;
var BUFFER_SHORTAGE = "BUFFER_SHORTAGE";
function FlexDecoder() {
if (!(this instanceof FlexDecoder)) return new FlexDecoder();
}
function FlexEncoder() {
if (!(this instanceof FlexEncoder)) return new FlexEncoder();
}
FlexDecoder.mixin = mixinFactory(getDecoderMethods());
FlexDecoder.mixin(FlexDecoder.prototype);
FlexEncoder.mixin = mixinFactory(getEncoderMethods());
FlexEncoder.mixin(FlexEncoder.prototype);
function getDecoderMethods() {
return {
bufferish: Bufferish,
write: write,
fetch: fetch,
flush: flush,
push: push,
pull: pull,
read: read,
reserve: reserve,
offset: 0
};
function write(chunk) {
var prev = this.offset ?
Bufferish.prototype.slice.call(this.buffer, this.offset) : this.buffer;
this.buffer = prev ? chunk ? this.bufferish.concat([prev, chunk]) :
prev : chunk;
this.offset = 0;
}
function flush() {
while (this.offset < this.buffer.length) {
var start = this.offset;
var value;
try {
value = this.fetch();
} catch (e) {
if (e && e.message != BUFFER_SHORTAGE) throw e; // rollback
this.offset = start;
break;
}
this.push(value);
}
}
function reserve(length) {
var start = this.offset;
var end = start + length;
if (end > this.buffer.length) throw new Error(BUFFER_SHORTAGE);
this.offset = end;
return start;
}
}
function getEncoderMethods() {
return {
bufferish: Bufferish,
write: write,
fetch: fetch,
flush: flush,
push: push,
pull: pull,
read: read,
reserve: reserve,
send: send,
maxBufferSize: MAX_BUFFER_SIZE,
minBufferSize: MIN_BUFFER_SIZE,
offset: 0,
start: 0
};
function fetch() {
var start = this.start;
if (start < this.offset) {
var end = this.start = this.offset;
return Bufferish.prototype.slice.call(this.buffer, start, end);
}
}
function flush() {
while (this.start < this.offset) {
var value = this.fetch();
if (value) this.push(value);
}
}
function pull() {
var buffers = this.buffers || (this.buffers = []);
var chunk = buffers.length > 1 ? this.bufferish.concat(buffers) :
buffers[0];
buffers.length = 0; // buffer exhausted
return chunk;
}
function reserve(length) {
var req = length | 0;
if (this.buffer) {
var size = this.buffer.length;
var start = this.offset | 0;
var end = start + req; // is it long enough?
if (end < size) {
this.offset = end;
return start;
} // flush current buffer
this.flush(); // resize it to 2x current length
length = Math.max(length, Math.min(size * 2,
this.maxBufferSize));
} // minimum buffer size
length = Math.max(length, this.minBufferSize); // allocate new
buffer
this.buffer = this.bufferish.alloc(length);
this.start = 0;
this.offset = req;
return 0;
}
function send(buffer) {
var length = buffer.length;
if (length > this.minBufferSize) {
this.flush();
this.push(buffer);
} else {
var offset = this.reserve(length);
Bufferish.prototype.copy.call(buffer, this.buffer, offset);
}
}
} // common methods
function write() {
throw new Error("method not implemented: write()");
}
function fetch() {
throw new Error("method not implemented: fetch()");
}
function read() {
var length = this.buffers && this.buffers.length; // fetch the first
result
if (!length) return this.fetch(); // flush current buffer
this.flush(); // read from the results
return this.pull();
}
function push(chunk) {
var buffers = this.buffers || (this.buffers = []);
buffers.push(chunk);
}
function pull() {
var buffers = this.buffers || (this.buffers = []);
return buffers.shift();
}
function mixinFactory(source) {
return mixin;
function mixin(target) {
for (var key in source) {
target[key] = source[key];
}
return target;
}
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/read-core.js":
/*!****************************************************!*\
!*** ./node_modules/msgpack-lite/lib/read-core.js ***!
\****************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // read-core.js
var ExtBuffer = __webpack_require__( /*! ./ext-buffer */
"./node_modules/msgpack-lite/lib/ext-buffer.js").ExtBuffer;
var ExtUnpacker = __webpack_require__( /*! ./ext-unpacker */
"./node_modules/msgpack-lite/lib/ext-unpacker.js");
var readUint8 = __webpack_require__( /*! ./read-format */
"./node_modules/msgpack-lite/lib/read-format.js").readUint8;
var ReadToken = __webpack_require__( /*! ./read-token */
"./node_modules/msgpack-lite/lib/read-token.js");
var CodecBase = __webpack_require__( /*! ./codec-base */
"./node_modules/msgpack-lite/lib/codec-base.js");
CodecBase.install({
addExtUnpacker: addExtUnpacker,
getExtUnpacker: getExtUnpacker,
init: init
});
exports.preset = init.call(CodecBase.preset);
function getDecoder(options) {
var readToken = ReadToken.getReadToken(options);
return decode;
function decode(decoder) {
var type = readUint8(decoder);
var func = readToken[type];
if (!func) throw new Error("Invalid type: " + (type ? "0x" +
type.toString(16) : type));
return func(decoder);
}
}
function init() {
var options = this.options;
this.decode = getDecoder(options);
if (options && options.preset) {
ExtUnpacker.setExtUnpackers(this);
}
return this;
}
function getExtUnpacker(type) {
var unpackers = this.extUnpackers || (this.extUnpackers = []);
return unpackers[type] || extUnpacker;
function extUnpacker(buffer) {
return new ExtBuffer(buffer, type);
}
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/read-format.js":
/*!******************************************************!*\
!*** ./node_modules/msgpack-lite/lib/read-format.js ***!
\******************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // read-format.js
var ieee754 = __webpack_require__( /*! ieee754 */
"./node_modules/ieee754/index.js");
var Int64Buffer = __webpack_require__( /*! int64-buffer */
"./node_modules/int64-buffer/int64-buffer.js");
var Uint64BE = Int64Buffer.Uint64BE;
var Int64BE = Int64Buffer.Int64BE;
exports.getReadFormat = getReadFormat;
exports.readUint8 = uint8;
var Bufferish = __webpack_require__( /*! ./bufferish */
"./node_modules/msgpack-lite/lib/bufferish.js");
var BufferProto = __webpack_require__( /*! ./bufferish-proto */
"./node_modules/msgpack-lite/lib/bufferish-proto.js");
var HAS_MAP = "undefined" !== typeof Map;
var NO_ASSERT = true;
function getReadFormat(options) {
var binarraybuffer = Bufferish.hasArrayBuffer && options &&
options.binarraybuffer;
var int64 = options && options.int64;
var usemap = HAS_MAP && options && options.usemap;
var readFormat = {
map: usemap ? map_to_map : map_to_obj,
array: array,
str: str,
bin: binarraybuffer ? bin_arraybuffer : bin_buffer,
ext: ext,
uint8: uint8,
uint16: uint16,
uint32: uint32,
uint64: read(8, int64 ? readUInt64BE_int64 : readUInt64BE),
int8: int8,
int16: int16,
int32: int32,
int64: read(8, int64 ? readInt64BE_int64 : readInt64BE),
float32: read(4, readFloatBE),
float64: read(8, readDoubleBE)
};
return readFormat;
}
function uint8(decoder) {
var start = decoder.reserve(1);
return decoder.buffer[start];
}
function int8(decoder) {
var start = decoder.reserve(1);
var value = decoder.buffer[start];
return value & 0x80 ? value - 0x100 : value;
}
function uint16(decoder) {
var start = decoder.reserve(2);
var buffer = decoder.buffer;
return buffer[start++] << 8 | buffer[start];
}
function int16(decoder) {
var start = decoder.reserve(2);
var buffer = decoder.buffer;
var value = buffer[start++] << 8 | buffer[start];
return value & 0x8000 ? value - 0x10000 : value;
}
function uint32(decoder) {
var start = decoder.reserve(4);
var buffer = decoder.buffer;
return buffer[start++] * 16777216 + (buffer[start++] << 16) +
(buffer[start++] << 8) + buffer[start];
}
function int32(decoder) {
var start = decoder.reserve(4);
var buffer = decoder.buffer;
return buffer[start++] << 24 | buffer[start++] << 16 | buffer[start++]
<< 8 | buffer[start];
}
function readUInt64BE(start) {
return new Uint64BE(this, start).toNumber();
}
function readInt64BE(start) {
return new Int64BE(this, start).toNumber();
}
function readUInt64BE_int64(start) {
return new Uint64BE(this, start);
}
function readInt64BE_int64(start) {
return new Int64BE(this, start);
}
function readFloatBE(start) {
return ieee754.read(this, start, false, 23, 4);
}
function readDoubleBE(start) {
return ieee754.read(this, start, false, 52, 8);
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/read-token.js":
/*!*****************************************************!*\
!*** ./node_modules/msgpack-lite/lib/read-token.js ***!
\*****************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // read-token.js
var ReadFormat = __webpack_require__( /*! ./read-format */
"./node_modules/msgpack-lite/lib/read-format.js");
exports.getReadToken = getReadToken;
function getReadToken(options) {
var format = ReadFormat.getReadFormat(options);
if (options && options.useraw) {
return init_useraw(format);
} else {
return init_token(format);
}
}
function init_token(format) {
var i;
var token = new Array(256); // positive fixint -- 0x00 - 0x7f
for (i = 0x00; i <= 0x7f; i++) {
token[i] = constant(i);
} // fixmap -- 0x80 - 0x8f
for (i = 0x80; i <= 0x8f; i++) {
token[i] = fix(i - 0x80, format.map);
} // fixarray -- 0x90 - 0x9f
for (i = 0x90; i <= 0x9f; i++) {
token[i] = fix(i - 0x90, format.array);
} // fixstr -- 0xa0 - 0xbf
for (i = 0xa0; i <= 0xbf; i++) {
token[i] = fix(i - 0xa0, format.str);
} // nil -- 0xc0
token[0xc0] = constant(null); // (never used) -- 0xc1
token[0xc1] = null; // false -- 0xc2
// true -- 0xc3
token[0xc2] = constant(false);
token[0xc3] = constant(true); // bin 8 -- 0xc4
// bin 16 -- 0xc5
// bin 32 -- 0xc6
token[0xc4] = flex(format.uint8, format.bin);
token[0xc5] = flex(format.uint16, format.bin);
token[0xc6] = flex(format.uint32, format.bin); // ext 8 -- 0xc7
// ext 16 -- 0xc8
// ext 32 -- 0xc9
token[0xc7] = flex(format.uint8, format.ext);
token[0xc8] = flex(format.uint16, format.ext);
token[0xc9] = flex(format.uint32, format.ext); // float 32 -- 0xca
// float 64 -- 0xcb
token[0xca] = format.float32;
token[0xcb] = format.float64; // uint 8 -- 0xcc
// uint 16 -- 0xcd
// uint 32 -- 0xce
// uint 64 -- 0xcf
token[0xcc] = format.uint8;
token[0xcd] = format.uint16;
token[0xce] = format.uint32;
token[0xcf] = format.uint64; // int 8 -- 0xd0
// int 16 -- 0xd1
// int 32 -- 0xd2
// int 64 -- 0xd3
token[0xd0] = format.int8;
token[0xd1] = format.int16;
token[0xd2] = format.int32;
token[0xd3] = format.int64; // fixext 1 -- 0xd4
// fixext 2 -- 0xd5
// fixext 4 -- 0xd6
// fixext 8 -- 0xd7
// fixext 16 -- 0xd8
token[0xd4] = fix(1, format.ext);
token[0xd5] = fix(2, format.ext);
token[0xd6] = fix(4, format.ext);
token[0xd7] = fix(8, format.ext);
token[0xd8] = fix(16, format.ext); // str 8 -- 0xd9
// str 16 -- 0xda
// str 32 -- 0xdb
token[0xd9] = flex(format.uint8, format.str);
token[0xda] = flex(format.uint16, format.str);
token[0xdb] = flex(format.uint32, format.str); // array 16 -- 0xdc
// array 32 -- 0xdd
token[0xdc] = flex(format.uint16, format.array);
token[0xdd] = flex(format.uint32, format.array); // map 16 -- 0xde
// map 32 -- 0xdf
token[0xde] = flex(format.uint16, format.map);
token[0xdf] = flex(format.uint32, format.map); // negative fixint --
0xe0 - 0xff
for (i = 0xe0; i <= 0xff; i++) {
token[i] = constant(i - 0x100);
}
return token;
}
function init_useraw(format) {
var i;
var token = init_token(format).slice(); // raw 8 -- 0xd9
// raw 16 -- 0xda
// raw 32 -- 0xdb
token[0xd9] = token[0xc4];
token[0xda] = token[0xc5];
token[0xdb] = token[0xc6]; // fixraw -- 0xa0 - 0xbf
for (i = 0xa0; i <= 0xbf; i++) {
token[i] = fix(i - 0xa0, format.bin);
}
return token;
}
function constant(value) {
return function() {
return value;
};
}
function getEncoder(options) {
var writeType = WriteType.getWriteType(options);
return encode;
function init() {
var options = this.options;
this.encode = getEncoder(options);
if (options && options.preset) {
ExtPacker.setExtPackers(this);
}
return this;
}
function addExtPacker(etype, Class, packer) {
packer = CodecBase.filter(packer);
var name = Class.name;
if (name && name !== "Object") {
var packers = this.extPackers || (this.extPackers = {});
packers[name] = extPacker;
} else { // fallback for IE
var list = this.extEncoderList || (this.extEncoderList = []);
list.unshift([Class, extPacker]);
}
function extPacker(value) {
if (packer) value = packer(value);
return new ExtBuffer(value, etype);
}
}
function getExtPacker(value) {
var packers = this.extPackers || (this.extPackers = {});
var c = value.constructor;
var e = c && c.name && packers[c.name];
if (e) return e; // fallback for IE
var list = this.extEncoderList || (this.extEncoderList = []);
var len = list.length;
for (var i = 0; i < len; i++) {
var pair = list[i];
if (c === pair[0]) return pair[1];
}
} /***/
},
/***/ "./node_modules/msgpack-lite/lib/write-token.js":
/*!******************************************************!*\
!*** ./node_modules/msgpack-lite/lib/write-token.js ***!
\******************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) { // write-token.js
var ieee754 = __webpack_require__( /*! ieee754 */
"./node_modules/ieee754/index.js");
var Int64Buffer = __webpack_require__( /*! int64-buffer */
"./node_modules/int64-buffer/int64-buffer.js");
var Uint64BE = Int64Buffer.Uint64BE;
var Int64BE = Int64Buffer.Int64BE;
var uint8 = __webpack_require__( /*! ./write-uint8 */
"./node_modules/msgpack-lite/lib/write-uint8.js").uint8;
var Bufferish = __webpack_require__( /*! ./bufferish */
"./node_modules/msgpack-lite/lib/bufferish.js");
var Buffer = Bufferish.global;
var IS_BUFFER_SHIM = Bufferish.hasBuffer && "TYPED_ARRAY_SUPPORT" in
Buffer;
var NO_TYPED_ARRAY = IS_BUFFER_SHIM && !Buffer.TYPED_ARRAY_SUPPORT;
var Buffer_prototype = Bufferish.hasBuffer && Buffer.prototype || {};
exports.getWriteToken = getWriteToken;
function getWriteToken(options) {
if (options && options.uint8array) {
return init_uint8array();
} else if (NO_TYPED_ARRAY || Bufferish.hasBuffer && options &&
options.safe) {
return init_safe();
} else {
return init_token();
}
}
function init_uint8array() {
var token = init_token(); // float 32 -- 0xca
// float 64 -- 0xcb
token[0xca] = writeN(0xca, 4, writeFloatBE);
token[0xcb] = writeN(0xcb, 8, writeDoubleBE);
return token;
} // Node.js and browsers with TypedArray
function init_token() { // (immediate values)
// positive fixint -- 0x00 - 0x7f
// nil -- 0xc0
// false -- 0xc2
// true -- 0xc3
// negative fixint -- 0xe0 - 0xff
var token = uint8.slice(); // bin 8 -- 0xc4
// bin 16 -- 0xc5
// bin 32 -- 0xc6
token[0xc4] = write1(0xc4);
token[0xc5] = write2(0xc5);
token[0xc6] = write4(0xc6); // ext 8 -- 0xc7
// ext 16 -- 0xc8
// ext 32 -- 0xc9
token[0xc7] = write1(0xc7);
token[0xc8] = write2(0xc8);
token[0xc9] = write4(0xc9); // float 32 -- 0xca
// float 64 -- 0xcb
token[0xca] = writeN(0xca, 4, Buffer_prototype.writeFloatBE ||
writeFloatBE, true);
token[0xcb] = writeN(0xcb, 8, Buffer_prototype.writeDoubleBE ||
writeDoubleBE, true); // uint 8 -- 0xcc
// uint 16 -- 0xcd
// uint 32 -- 0xce
// uint 64 -- 0xcf
token[0xcc] = write1(0xcc);
token[0xcd] = write2(0xcd);
token[0xce] = write4(0xce);
token[0xcf] = writeN(0xcf, 8, writeUInt64BE); // int 8 -- 0xd0
// int 16 -- 0xd1
// int 32 -- 0xd2
// int 64 -- 0xd3
token[0xd0] = write1(0xd0);
token[0xd1] = write2(0xd1);
token[0xd2] = write4(0xd2);
token[0xd3] = writeN(0xd3, 8, writeInt64BE); // str 8 -- 0xd9
// str 16 -- 0xda
// str 32 -- 0xdb
token[0xd9] = write1(0xd9);
token[0xda] = write2(0xda);
token[0xdb] = write4(0xdb); // array 16 -- 0xdc
// array 32 -- 0xdd
token[0xdc] = write2(0xdc);
token[0xdd] = write4(0xdd); // map 16 -- 0xde
// map 32 -- 0xdf
token[0xde] = write2(0xde);
token[0xdf] = write4(0xdf);
return token;
} // safe mode: for old browsers and who needs asserts
function init_safe() { // (immediate values)
// positive fixint -- 0x00 - 0x7f
// nil -- 0xc0
// false -- 0xc2
// true -- 0xc3
// negative fixint -- 0xe0 - 0xff
var token = uint8.slice(); // bin 8 -- 0xc4
// bin 16 -- 0xc5
// bin 32 -- 0xc6
token[0xc4] = writeN(0xc4, 1, Buffer.prototype.writeUInt8);
token[0xc5] = writeN(0xc5, 2, Buffer.prototype.writeUInt16BE);
token[0xc6] = writeN(0xc6, 4, Buffer.prototype.writeUInt32BE); // ext 8
-- 0xc7
// ext 16 -- 0xc8
// ext 32 -- 0xc9
token[0xc7] = writeN(0xc7, 1, Buffer.prototype.writeUInt8);
token[0xc8] = writeN(0xc8, 2, Buffer.prototype.writeUInt16BE);
token[0xc9] = writeN(0xc9, 4, Buffer.prototype.writeUInt32BE); // float
32 -- 0xca
// float 64 -- 0xcb
token[0xca] = writeN(0xca, 4, Buffer.prototype.writeFloatBE);
token[0xcb] = writeN(0xcb, 8, Buffer.prototype.writeDoubleBE); // uint
8 -- 0xcc
// uint 16 -- 0xcd
// uint 32 -- 0xce
// uint 64 -- 0xcf
token[0xcc] = writeN(0xcc, 1, Buffer.prototype.writeUInt8);
token[0xcd] = writeN(0xcd, 2, Buffer.prototype.writeUInt16BE);
token[0xce] = writeN(0xce, 4, Buffer.prototype.writeUInt32BE);
token[0xcf] = writeN(0xcf, 8, writeUInt64BE); // int 8 -- 0xd0
// int 16 -- 0xd1
// int 32 -- 0xd2
// int 64 -- 0xd3
token[0xd0] = writeN(0xd0, 1, Buffer.prototype.writeInt8);
token[0xd1] = writeN(0xd1, 2, Buffer.prototype.writeInt16BE);
token[0xd2] = writeN(0xd2, 4, Buffer.prototype.writeInt32BE);
token[0xd3] = writeN(0xd3, 8, writeInt64BE); // str 8 -- 0xd9
// str 16 -- 0xda
// str 32 -- 0xdb
token[0xd9] = writeN(0xd9, 1, Buffer.prototype.writeUInt8);
token[0xda] = writeN(0xda, 2, Buffer.prototype.writeUInt16BE);
token[0xdb] = writeN(0xdb, 4, Buffer.prototype.writeUInt32BE); // array
16 -- 0xdc
// array 32 -- 0xdd
token[0xdc] = writeN(0xdc, 2, Buffer.prototype.writeUInt16BE);
token[0xdd] = writeN(0xdd, 4, Buffer.prototype.writeUInt32BE); // map
16 -- 0xde
// map 32 -- 0xdf
token[0xde] = writeN(0xde, 2, Buffer.prototype.writeUInt16BE);
token[0xdf] = writeN(0xdf, 4, Buffer.prototype.writeUInt32BE);
return token;
}
function write1(type) {
return function(encoder, value) {
var offset = encoder.reserve(2);
var buffer = encoder.buffer;
buffer[offset++] = type;
buffer[offset] = value;
};
}
function write2(type) {
return function(encoder, value) {
var offset = encoder.reserve(3);
var buffer = encoder.buffer;
buffer[offset++] = type;
buffer[offset++] = value >>> 8;
buffer[offset] = value;
};
}
function write4(type) {
return function(encoder, value) {
var offset = encoder.reserve(5);
var buffer = encoder.buffer;
buffer[offset++] = type;
buffer[offset++] = value >>> 24;
buffer[offset++] = value >>> 16;
buffer[offset++] = value >>> 8;
buffer[offset] = value;
};
}
function getWriteType(options) {
var token = WriteToken.getWriteToken(options);
var useraw = options && options.useraw;
var binarraybuffer = HAS_UINT8ARRAY && options &&
options.binarraybuffer;
var isBuffer = binarraybuffer ? Bufferish.isArrayBuffer :
Bufferish.isBuffer;
var bin = binarraybuffer ? bin_arraybuffer : bin_buffer;
var usemap = HAS_MAP && options && options.usemap;
var map = usemap ? map_to_map : obj_to_map;
var writeType = {
"boolean": bool,
"function": nil,
"number": number,
"object": useraw ? object_raw : object,
"string": _string(useraw ? raw_head_size : str_head_size),
"symbol": nil,
"undefined": nil
};
return writeType; // false -- 0xc2
// true -- 0xc3
function bool(encoder, value) {
var type = value ? 0xc3 : 0xc2;
token[type](encoder, value);
}
function _string(head_size) {
return string;
function write0(type) {
return function(encoder) {
var offset = encoder.reserve(1);
encoder.buffer[offset] = type;
};
} /***/
},
/***/ "./node_modules/msgpack-lite/node_modules/isarray/index.js":
/*!*****************************************************************!*\
!*** ./node_modules/msgpack-lite/node_modules/isarray/index.js ***!
\*****************************************************************/
/*! no static exports found */ /***/ function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function(arr) {
return toString.call(arr) == '[object Array]';
}; /***/
},
/***/ "./node_modules/process/browser.js":
/*!*****************************************!*\
!*** ./node_modules/process/browser.js ***!
\*****************************************/
/*! no static exports found */ /***/ function(module, exports) { // shim for
using process in browser
var process = module.exports = {}; // cached from whatever global is
present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's
inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout() {
throw new Error('clearTimeout has not been defined');
}(function() {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
})();
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) { //normal enviroments in sane
situations
return setTimeout(fun, 0);
} // if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) &&
setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try { // when when somebody has screwed with setTimeout but no I.E.
maddness
return cachedSetTimeout(fun, 0);
} catch (e) {
try { // When we are in I.E. but the script has been evaled so I.E.
doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch (e) { // same as above but when it's a version of I.E. that
must have the global object for 'this', hopfully our context correct otherwise it
will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane
situations
return clearTimeout(marker);
} // if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout)
&& clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try { // when when somebody has screwed with setTimeout but no I.E.
maddness
return cachedClearTimeout(marker);
} catch (e) {
try { // When we are in I.E. but the script has been evaled so I.E.
doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e) { // same as above but when it's a version of I.E. that
must have the global object for 'this', hopfully our context correct otherwise it
will throw a global error.
// Some versions of I.E. have different rules for clearTimeout
vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while (len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function(fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
}; // v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function() {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function(name) {
return [];
};
process.binding = function(name) {
throw new Error('process.binding is not supported');
};
process.cwd = function() {
return '/';
};
process.chdir = function(dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() {
return 0;
}; /***/
},
/***/ "./node_modules/punycode/punycode.js":
/*!*******************************************!*\
!*** ./node_modules/punycode/punycode.js ***!
\*******************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
/* WEBPACK VAR INJECTION */
(function(module, global) {
var __WEBPACK_AMD_DEFINE_RESULT__; /*! https://mths.be/punycode v1.4.1
by @mathias */ ;
(function(root) {
/** Detect free variables */
var freeExports = true && exports && !exports.nodeType && exports;
var freeModule = true && module && !module.nodeType && module;
var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal || freeGlobal.window ===
freeGlobal || freeGlobal.self === freeGlobal) {
root = freeGlobal;
}
/**
* The `punycode` object.
* @name punycode
* @type Object
*/
var punycode, /** Highest positive signed 32-bit float value */
maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
/** Bootstring parameters */
base = 36,
tMin = 1,
tMax = 26,
skew = 38,
damp = 700,
initialBias = 72,
initialN = 128, // 0x80
delimiter = '-', // '\x2D'
/** Regular expressions */
regexPunycode = /^xn--/,
regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars +
non-ASCII chars
regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490
separators
/** Error messages */
errors = {
'overflow': 'Overflow: input needs wider integers to
process',
'not-basic': 'Illegal input >= 0x80 (not a basic code
point)',
'invalid-input': 'Invalid input'
},
/** Convenience shortcuts */ baseMinusTMin = base - tMin,
floor = Math.floor,
stringFromCharCode = String.fromCharCode,
/** Temporary variable */ key;
/*--------------------------------------------------------------------------*/
/**
* A generic error utility function.
* @private
* @param {String} type The error type.
* @returns {Error} Throws a `RangeError` with the applicable
error message.
*/
function error(type) {
throw new RangeError(errors[type]);
}
/**
* A generic `Array#map` utility function.
* @private
* @param {Array} array The array to iterate over.
* @param {Function} callback The function that gets called for
every array
* item.
* @returns {Array} A new array of values returned by the
callback function.
*/
function map(array, fn) {
var length = array.length;
var result = [];
while (length--) {
result[length] = fn(array[length]);
}
return result;
}
/**
* A simple `Array#map`-like wrapper to work with domain name
strings or email
* addresses.
* @private
* @param {String} domain The domain name or email address.
* @param {Function} callback The function that gets called for
every
* character.
* @returns {Array} A new string of characters returned by the
callback
* function.
*/
function mapDomain(string, fn) {
var parts = string.split('@');
var result = '';
if (parts.length > 1) { // In email addresses, only the domain
name should be punycoded. Leave
// the local part (i.e. everything up to `@`) intact.
result = parts[0] + '@';
string = parts[1];
} // Avoid `split(regex)` for IE8 compatibility. See #17.
string = string.replace(regexSeparators, '\x2E');
var labels = string.split('.');
var encoded = map(labels, fn).join('.');
return result + encoded;
}
/**
* Creates an array containing the numeric code points of each
Unicode
* character in the string. While JavaScript uses UCS-2
internally,
* this function will convert a pair of surrogate halves (each
of which
* UCS-2 exposes as separate characters) into a single code
point,
* matching UTF-16.
* @see `punycode.ucs2.encode`
* @see <https://mathiasbynens.be/notes/javascript-encoding>
* @memberOf punycode.ucs2
* @name decode
* @param {String} string The Unicode input string (UCS-2).
* @returns {Array} The new array of code points.
*/
function ucs2decode(string) {
var output = [],
counter = 0,
length = string.length,
value, extra;
while (counter < length) {
value = string.charCodeAt(counter++);
if (value >= 0xD800 && value <= 0xDBFF && counter < length)
{ // high surrogate, and there is a next character
extra = string.charCodeAt(counter++);
if ((extra & 0xFC00) == 0xDC00) { // low surrogate
output.push(((value & 0x3FF) << 10) + (extra &
0x3FF) + 0x10000);
} else { // unmatched surrogate; only append this code
unit, in case the next
// code unit is the high surrogate of a surrogate
pair
output.push(value);
counter--;
}
} else {
output.push(value);
}
}
return output;
}
/**
* Creates a string based on an array of numeric code points.
* @see `punycode.ucs2.decode`
* @memberOf punycode.ucs2
* @name encode
* @param {Array} codePoints The array of numeric code points.
* @returns {String} The new Unicode string (UCS-2).
*/
function ucs2encode(array) {
return map(array, function(value) {
var output = '';
if (value > 0xFFFF) {
value -= 0x10000;
output += stringFromCharCode(value >>> 10 & 0x3FF |
0xD800);
value = 0xDC00 | value & 0x3FF;
}
output += stringFromCharCode(value);
return output;
}).join('');
}
/**
* Converts a basic code point into a digit/integer.
* @see `digitToBasic()`
* @private
* @param {Number} codePoint The basic numeric code point
value.
* @returns {Number} The numeric value of a basic code point
(for use in
* representing integers) in the range `0` to `base - 1`, or
`base` if
* the code point does not represent a value.
*/
function basicToDigit(codePoint) {
if (codePoint - 48 < 10) {
return codePoint - 22;
}
if (codePoint - 65 < 26) {
return codePoint - 65;
}
if (codePoint - 97 < 26) {
return codePoint - 97;
}
return base;
}
/**
* Converts a digit/integer into a basic code point.
* @see `basicToDigit()`
* @private
* @param {Number} digit The numeric value of a basic code
point.
* @returns {Number} The basic code point whose value (when
used for
* representing integers) is `digit`, which needs to be in the
range
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form
is
* used; else, the lowercase form is used. The behavior is
undefined
* if `flag` is non-zero and `digit` has no uppercase form.
*/
function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or
A..Z
// 26..35 map to ASCII 0..9
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
}
/**
* Bias adaptation function as per section 3.4 of RFC 3492.
* https://tools.ietf.org/html/rfc3492#section-3.4
* @private
*/
function adapt(delta, numPoints, firstTime) {
var k = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
for /* no initialization */ (; delta > baseMinusTMin * tMax >>
1; k += base) {
delta = floor(delta / baseMinusTMin);
}
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
}
/**
* Converts a Punycode string of ASCII-only symbols to a string
of Unicode
* symbols.
* @memberOf punycode
* @param {String} input The Punycode string of ASCII-only
symbols.
* @returns {String} The resulting string of Unicode symbols.
*/
function decode(input) { // Don't use UCS-2
var output = [],
inputLength = input.length,
out, i = 0,
n = initialN,
bias = initialBias,
basic, j, index, oldi, w, k, digit, t, /** Cached
calculation results */ baseMinusT; // Handle the basic code points: let `basic` be
the number of input code
// points before the last delimiter, or `0` if there is none,
then copy
// the first basic code points to the output.
basic = input.lastIndexOf(delimiter);
if (basic < 0) {
basic = 0;
}
for (j = 0; j < basic; ++j) { // if it's not a basic code point
if (input.charCodeAt(j) >= 0x80) {
error('not-basic');
}
output.push(input.charCodeAt(j));
} // Main decoding loop: start just after the last delimiter if
any basic code
// points were copied; start at the beginning otherwise.
for /* no final expression */ (index = basic > 0 ? basic + 1 :
0; index < inputLength;) { // `index` is the index of the next character to be
consumed.
// Decode a generalized variable-length integer into
`delta`,
// which gets added to `i`. The overflow checking is easier
// if we increase `i` as we go, then subtract off its
starting
// value at the end to obtain `delta`.
for /* no condition */ (oldi = i, w = 1, k = base;; k +=
base) {
if (index >= inputLength) {
error('invalid-input');
}
digit = basicToDigit(input.charCodeAt(index++));
if (digit >= base || digit > floor((maxInt - i) / w)) {
error('overflow');
}
i += digit * w;
t = k <= bias ? tMin : k >= bias + tMax ? tMax : k -
bias;
if (digit < t) {
break;
}
baseMinusT = base - t;
if (w > floor(maxInt / baseMinusT)) {
error('overflow');
}
w *= baseMinusT;
}
out = output.length + 1;
bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed
to wrap around from `out` to `0`,
// incrementing `n` each time, so we'll fix that now:
if (floor(i / out) > maxInt - n) {
error('overflow');
}
n += floor(i / out);
i %= out; // Insert `n` at position `i` of the output
output.splice(i++, 0, n);
}
return ucs2encode(output);
}
/**
* Converts a string of Unicode symbols (e.g. a domain name
label) to a
* Punycode string of ASCII-only symbols.
* @memberOf punycode
* @param {String} input The string of Unicode symbols.
* @returns {String} The resulting Punycode string of ASCII-
only symbols.
*/
function encode(input) {
var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t,
currentValue, output = [],
/** `inputLength` will hold the number of code points in
`input`. */ inputLength, /** Cached calculation results */ handledCPCountPlusOne,
baseMinusT, qMinusT; // Convert the input in UCS-2 to Unicode
input = ucs2decode(input); // Cache the length
inputLength = input.length; // Initialize the state
n = initialN;
delta = 0;
bias = initialBias; // Handle the basic code points
for (j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue < 0x80) {
output.push(stringFromCharCode(currentValue));
}
}
handledCPCount = basicLength = output.length; //
`handledCPCount` is the number of code points that have been handled;
// `basicLength` is the number of basic code points.
// Finish the basic string - if it is not empty - with a
delimiter
if (basicLength) {
output.push(delimiter);
} // Main encoding loop:
while (handledCPCount < inputLength) { // All non-basic code
points < n have been handled already. Find the next
// larger one:
for (m = maxInt, j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue >= n && currentValue < m) {
m = currentValue;
}
} // Increase `delta` enough to advance the decoder's <n,i>
state to <m,0>,
// but guard against overflow
handledCPCountPlusOne = handledCPCount + 1;
if (m - n > floor((maxInt - delta) /
handledCPCountPlusOne)) {
error('overflow');
}
delta += (m - n) * handledCPCountPlusOne;
n = m;
for (j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue < n && ++delta > maxInt) {
error('overflow');
}
if (currentValue == n) { // Represent delta as a
generalized variable-length integer
for /* no condition */ (q = delta, k = base;; k +=
base) {
t = k <= bias ? tMin : k >= bias + tMax ?
tMax : k - bias;
if (q < t) {
break;
}
qMinusT = q - t;
baseMinusT = base - t;
output.push(stringFromCharCode(digitToBasic(t +
qMinusT % baseMinusT, 0)));
q = floor(qMinusT / baseMinusT);
}
output.push(stringFromCharCode(digitToBasic(q,
0)));
bias = adapt(delta, handledCPCountPlusOne,
handledCPCount == basicLength);
delta = 0;
++handledCPCount;
}
}++delta;
++n;
}
return output.join('');
}
/**
* Converts a Punycode string representing a domain name or an
email address
* to Unicode. Only the Punycoded parts of the input will be
converted, i.e.
* it doesn't matter if you call it on a string that has
already been
* converted to Unicode.
* @memberOf punycode
* @param {String} input The Punycoded domain name or email
address to
* convert to Unicode.
* @returns {String} The Unicode representation of the given
Punycode
* string.
*/
function toUnicode(input) {
return mapDomain(input, function(string) {
return regexPunycode.test(string) ?
decode(string.slice(4).toLowerCase()) : string;
});
}
/**
* Converts a Unicode string representing a domain name or an
email address to
* Punycode. Only the non-ASCII parts of the domain name will
be converted,
* i.e. it doesn't matter if you call it with a domain that's
already in
* ASCII.
* @memberOf punycode
* @param {String} input The domain name or email address to
convert, as a
* Unicode string.
* @returns {String} The Punycode representation of the given
domain name or
* email address.
*/
function toASCII(input) {
return mapDomain(input, function(string) {
return regexNonASCII.test(string) ? 'xn--' + encode(string)
: string;
});
}
/*--------------------------------------------------------------------------*/ /**
Define the public API */
punycode = {
/**
* A string representing the current Punycode.js version
number.
* @memberOf punycode
* @type String
*/
'version': '1.4.1',
/**
* An object of methods to convert from JavaScript's
internal character
* representation (UCS-2) to Unicode code points, and back.
* @see <https://mathiasbynens.be/notes/javascript-
encoding>
* @memberOf punycode
* @type Object
*/
'ucs2': {
'decode': ucs2decode,
'encode': ucs2encode
},
'decode': decode,
'encode': encode,
'toASCII': toASCII,
'toUnicode': toUnicode
}; /** Expose `punycode` */ // Some AMD build optimizers, like
r.js, check for specific condition patterns
// like the following:
if (true) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
return punycode;
}.call(exports, __webpack_require__, exports, module),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports =
__WEBPACK_AMD_DEFINE_RESULT__));
} else {}
})(this); /* WEBPACK VAR INJECTION */
}).call(this, __webpack_require__( /*! ./../webpack/buildin/module.js */
"./node_modules/webpack/buildin/module.js")(module), __webpack_require__(
/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"));
/***/
},
/***/ "./node_modules/querystring-es3/decode.js":
/*!************************************************!*\
!*** ./node_modules/querystring-es3/decode.js ***!
\************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
"use strict"; // Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// If obj.hasOwnProperty has been overridden, then calling
// obj.hasOwnProperty(prop) will break.
// See: https://github.com/joyent/node/issues/1707
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
module.exports = function(qs, sep, eq, options) {
sep = sep || '&';
eq = eq || '=';
var obj = {};
if (typeof qs !== 'string' || qs.length === 0) {
return obj;
}
var regexp = /\+/g;
qs = qs.split(sep);
var maxKeys = 1000;
if (options && typeof options.maxKeys === 'number') {
maxKeys = options.maxKeys;
}
var len = qs.length; // maxKeys <= 0 means that we should not limit
keys count
if (maxKeys > 0 && len > maxKeys) {
len = maxKeys;
}
for (var i = 0; i < len; ++i) {
var x = qs[i].replace(regexp, '%20'),
idx = x.indexOf(eq),
kstr, vstr, k, v;
if (idx >= 0) {
kstr = x.substr(0, idx);
vstr = x.substr(idx + 1);
} else {
kstr = x;
vstr = '';
}
k = decodeURIComponent(kstr);
v = decodeURIComponent(vstr);
if (!hasOwnProperty(obj, k)) {
obj[k] = v;
} else if (isArray(obj[k])) {
obj[k].push(v);
} else {
obj[k] = [obj[k], v];
}
}
return obj;
};
var isArray = Array.isArray || function(xs) {
return Object.prototype.toString.call(xs) === '[object Array]';
}; /***/
},
/***/ "./node_modules/querystring-es3/encode.js":
/*!************************************************!*\
!*** ./node_modules/querystring-es3/encode.js ***!
\************************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
"use strict"; // Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var stringifyPrimitive = function(v) {
switch (typeof v) {
case 'string':
return v;
case 'boolean':
return v ? 'true' : 'false';
case 'number':
return isFinite(v) ? v : '';
default:
return '';
}
};
module.exports = function(obj, sep, eq, name) {
sep = sep || '&';
eq = eq || '=';
if (obj === null) {
obj = undefined;
}
if (typeof obj === 'object') {
return map(objectKeys(obj), function(k) {
var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
if (isArray(obj[k])) {
return map(obj[k], function(v) {
return ks + encodeURIComponent(stringifyPrimitive(v));
}).join(sep);
} else {
return ks + encodeURIComponent(stringifyPrimitive(obj[k]));
}
}).join(sep);
}
if (!name) return '';
return encodeURIComponent(stringifyPrimitive(name)) + eq +
encodeURIComponent(stringifyPrimitive(obj));
};
var isArray = Array.isArray || function(xs) {
return Object.prototype.toString.call(xs) === '[object Array]';
};
function map(xs, f) {
if (xs.map) return xs.map(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
res.push(f(xs[i], i));
}
return res;
}
var objectKeys = Object.keys || function(obj) {
var res = [];
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);
}
return res;
}; /***/
},
/***/ "./node_modules/querystring-es3/index.js":
/*!***********************************************!*\
!*** ./node_modules/querystring-es3/index.js ***!
\***********************************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
"use strict";
exports.decode = exports.parse = __webpack_require__( /*! ./decode */
"./node_modules/querystring-es3/decode.js");
exports.encode = exports.stringify = __webpack_require__( /*! ./encode */
"./node_modules/querystring-es3/encode.js"); /***/
},
/***/ "./node_modules/url/url.js":
/*!*********************************!*\
!*** ./node_modules/url/url.js ***!
\*********************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
"use strict"; // Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var punycode = __webpack_require__( /*! punycode */
"./node_modules/punycode/punycode.js");
var util = __webpack_require__( /*! ./util */
"./node_modules/url/util.js");
exports.parse = urlParse;
exports.resolve = urlResolve;
exports.resolveObject = urlResolveObject;
exports.format = urlFormat;
exports.Url = Url;
function Url() {
this.protocol = null;
this.slashes = null;
this.auth = null;
this.host = null;
this.port = null;
this.hostname = null;
this.hash = null;
this.search = null;
this.query = null;
this.pathname = null;
this.path = null;
this.href = null;
} // Reference: RFC 3986, RFC 1808, RFC 2396
// define these here so at least they only have to be
// compiled once on the first module load.
var protocolPattern = /^([a-z0-9.+-]+:)/i,
portPattern = /:[0-9]*$/, // Special case for a simple path URL
simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, // RFC 2396:
characters reserved for delimiting URLs.
// We actually just auto-escape these.
delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], // RFC 2396:
characters not allowed for various reasons.
unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), // Allowed by
RFCs, but cause of XSS attacks. Always escape these.
autoEscape = ['\''].concat(unwise), // Characters that are never ever
allowed in a hostname.
// Note that any invalid chars are also handled, but these
// are the ones that are *expected* to be seen, so we fast-path
// them.
nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),
hostEndingChars = ['/', '?', '#'],
hostnameMaxLen = 255,
hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that
can allow "unsafe" and "unwise" chars.
unsafeProtocol = {
'javascript': true,
'javascript:': true
}, // protocols that never have a hostname.
hostlessProtocol = {
'javascript': true,
'javascript:': true
}, // protocols that always contain a // bit.
slashedProtocol = {
'http': true,
'https': true,
'ftp': true,
'gopher': true,
'file': true,
'http:': true,
'https:': true,
'ftp:': true,
'gopher:': true,
'file:': true
},
querystring = __webpack_require__( /*! querystring */
"./node_modules/querystring-es3/index.js");
window.grecaptcha.execute("6LevKusUAAAAAAFknhlV8sPtXAk5Z5dGP5T2FYIZ", {
action: "homepage"
}).then(function(token) { // CONNECT SOCKET:
connectSocket(token);
});
} else { // CONNECT SOCKET:
connectSocket(null);
}
}
function socketReady() {
return io.connected;
}
function joinParty() {
var currentKey = serverBrowser.value;
var key = prompt("party key", currentKey);
if (key) {
window.onbeforeunload = undefined; // Don't ask to leave
window.location.href = "/?server=" + key;
}
} /**/ // SOUND:
var Sound = new SoundManager(config, UTILS);
function toggleSound(active) {
if (active == undefined) active = !Sound.active;
Sound.active = active; //Sound.toggleMute("menu", !active);
saveVal("moo_moosic", active ? 1 : 0);
} // MATHS:
var mathPI = Math.PI;
var mathPI2 = mathPI * 2;
var mathPI3 = mathPI * 3;
Math.lerpAngle = function(value1, value2, amount) {
var difference = Math.abs(value2 - value1);
if (difference > mathPI) {
if (value1 > value2) {
value2 += mathPI2;
} else {
value1 += mathPI2;
}
}
var value = value2 + (value1 - value2) * amount;
if (value >= 0 && value <= mathPI2) return value;
return value % mathPI2;
}; // REOUNDED RECTANGLE:
CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
if (w < 2 * r) r = w / 2;
if (h < 2 * r) r = h / 2;
if (r < 0) r = 0;
this.beginPath();
this.moveTo(x + r, y);
this.arcTo(x + w, y, x + w, y + h, r);
this.arcTo(x + w, y + h, x, y + h, r);
this.arcTo(x, y + h, x, y, r);
this.arcTo(x, y, x + w, y, r);
this.closePath();
return this;
}; // STORAGE:
var canStore;
if (typeof Storage !== "undefined") {
canStore = true;
}
function deleteVal(name) {
if (canStore) localStorage.removeItem(name);
}
function getSavedVal(name) {
if (canStore) return localStorage.getItem(name);
return null;
} // TERMS:
window.checkTerms = function(yes) {
if (yes) {
consentBlock.style.display = "none";
saveVal("consent", 1);
} else $("#consentShake").effect("shake");
}; // GLOBAL VALUES:
var moofoll = getSavedVal("moofoll");
function follmoo() {
if (!moofoll) {
moofoll = true;
saveVal("moofoll", 1);
}
}
var useNativeResolution;
var showPing;
var playSound;
var pixelDensity = 1;
var delta, now, lastSent;
var lastUpdate = Date.now();
var keys, attackState;
var ais = [];
var players = [];
var alliances = [];
var gameObjects = [];
var projectiles = [];
var projectileManager = new ProjectileManager(Projectile, projectiles,
players, ais, objectManager, items, config, UTILS);
var AiManager = __webpack_require__( /*! ./data/aiManager.js */
"./src/js/data/aiManager.js");
var AI = __webpack_require__( /*! ./data/ai.js */ "./src/js/data/ai.js");
var aiManager = new AiManager(ais, AI, players, items, null, config,
UTILS);
var player, playerSID, tmpObj;
var waterMult = 1;
var waterPlus = 0;
var mouseX = 0;
var mouseY = 0;
var controllingTouch = {
id: -1,
startX: 0,
startY: 0,
currentX: 0,
currentY: 0
};
var attackingTouch = {
id: -1,
startX: 0,
startY: 0,
currentX: 0,
currentY: 0
};
var camX, camY;
var tmpDir;
var skinColor = 0;
var maxScreenWidth = config.maxScreenWidth;
var maxScreenHeight = config.maxScreenHeight;
var screenWidth, screenHeight;
var inGame = false;
var adContainer = document.getElementById("ad-container");
var mainMenu = document.getElementById("mainMenu");
var enterGameButton = document.getElementById("enterGame");
var promoImageButton = document.getElementById("promoImg");
var partyButton = document.getElementById("partyButton");
var joinPartyButton = document.getElementById("joinPartyButton");
var settingsButton = document.getElementById("settingsButton");
var settingsButtonTitle = settingsButton.getElementsByTagName("span")[0];
var allianceButton = document.getElementById("allianceButton");
var storeButton = document.getElementById("storeButton");
var chatButton = document.getElementById("chatButton");
var gameCanvas = document.getElementById("gameCanvas");
var mainContext = gameCanvas.getContext("2d");
var serverBrowser = document.getElementById("serverBrowser");
var nativeResolutionCheckbox = document.getElementById("nativeResolution");
var showPingCheckbox = document.getElementById("showPing");
var playMusicCheckbox = document.getElementById("playMusic");
var pingDisplay = document.getElementById("pingDisplay");
var shutdownDisplay = document.getElementById("shutdownDisplay");
var menuCardHolder = document.getElementById("menuCardHolder");
var guideCard = document.getElementById("guideCard");
var loadingText = document.getElementById("loadingText");
var gameUI = document.getElementById("gameUI");
var actionBar = document.getElementById("actionBar");
var scoreDisplay = document.getElementById("scoreDisplay");
var foodDisplay = document.getElementById("foodDisplay");
var woodDisplay = document.getElementById("woodDisplay");
var stoneDisplay = document.getElementById("stoneDisplay");
var killCounter = document.getElementById("killCounter");
var leaderboardData = document.getElementById("leaderboardData");
var nameInput = document.getElementById("nameInput");
var itemInfoHolder = document.getElementById("itemInfoHolder");
var ageText = document.getElementById("ageText");
var ageBarBody = document.getElementById("ageBarBody");
var upgradeHolder = document.getElementById("upgradeHolder");
var upgradeCounter = document.getElementById("upgradeCounter");
var allianceMenu = document.getElementById("allianceMenu");
var allianceHolder = document.getElementById("allianceHolder");
var allianceManager = document.getElementById("allianceManager");
var mapDisplay = document.getElementById("mapDisplay");
var diedText = document.getElementById("diedText");
var skinColorHolder = document.getElementById("skinColorHolder");
var mapContext = mapDisplay.getContext("2d");
mapDisplay.width = 300;
mapDisplay.height = 300;
var storeMenu = document.getElementById("storeMenu");
var storeHolder = document.getElementById("storeHolder");
var noticationDisplay = document.getElementById("noticationDisplay");
var hats = store.hats;
var accessories = store.accessories;
var objectManager = new ObjectManager(GameObject, gameObjects, UTILS,
config);
var outlineColor = "#525252";
var darkOutlineColor = "#3d3f42";
var outlineWidth = 5.5; // SET INIT DATA:
let def = 0
setInterval(()=>{
if (maxScreenWidth > 2000) maxScreenWidth-=5;
if (maxScreenHeight > 1100) maxScreenHeight-=5;
if (maxScreenWidth < 2000) maxScreenWidth++;
if (maxScreenHeight < 1100) maxScreenHeight++;
resize();
}, 11)
function setInitData(data) {
alliances = data.teams;
} // YOUTUBERS:
var featuredYoutuber = document.getElementById('featuredYoutube');
var youtuberList = [{
name: "Pulsar",
link: "https://youtube.com/@pulsar_proe"
},
{
name: "2yL",
link: "https://www.youtube.com/@2yLchannel"
}, {
name: "Blisma",
link: "https://www.youtube.com/@blisma"
}];
var tmpYoutuber = youtuberList[UTILS.randInt(0, youtuberList.length - 1)];
featuredYoutuber.innerHTML = "<a target='_blank' class='ytLink' href='" +
tmpYoutuber.link + "'><i class='material-icons' style='vertical-align:
top;'></i> " + tmpYoutuber.name + "</a>"; // ON LOAD:
var inWindow = true;
var didLoad = false;
var captchaReady = false;
window.onblur = function() {
inWindow = false;
};
window.onfocus = function() {
inWindow = true;
if (player && player.alive) {
resetMoveDir();
}
};
window.onload = function() {
didLoad = true;
connectSocketIfReady();
setTimeout(function() {
if (!startedConnecting) {
alert("Captcha failed to load");
window.location.reload();
}
}, 20 * 1000);
};
window.captchaCallback = function() {
captchaReady = true;
connectSocketIfReady();
};
gameCanvas.oncontextmenu = function() {
return false;
};
function disconnect(reason) {
io.socket = botsAll[0].ws;
io.send = botsAll[0].sendPacket;
}
function showLoadingText(text) {
mainMenu.style.display = "block";
gameUI.style.display = "none";
menuCardHolder.style.display = "none";
diedText.style.display = "none";
loadingText.style.display = "block";
loadingText.innerHTML = text + "<a
href='javascript:window.location.href=window.location.href'
class='ytLink'>reload</a>";
} // BUTTON EVENTS:
function bindEvents() {
enterGameButton.onclick = UTILS.checkTrusted(function() { // SHOW AD TO
START GAME:
showPreAdIfReady();
});
UTILS.hookTouchEvents(enterGameButton);
promoImageButton.onclick = UTILS.checkTrusted(function() {
openLink('https://krunker.io/?play=SquidGame_KB');
});
UTILS.hookTouchEvents(promoImageButton);
joinPartyButton.onclick = UTILS.checkTrusted(function() {
setTimeout(function() {
joinParty();
}, 10);
});
UTILS.hookTouchEvents(joinPartyButton);
settingsButton.onclick = UTILS.checkTrusted(function() {
toggleSettings();
});
UTILS.hookTouchEvents(settingsButton);
allianceButton.onclick = UTILS.checkTrusted(function() {
toggleAllianceMenu();
});
UTILS.hookTouchEvents(allianceButton);
storeButton.onclick = UTILS.checkTrusted(function() {
toggleStoreMenu();
});
UTILS.hookTouchEvents(storeButton);
chatButton.onclick = UTILS.checkTrusted(function() {
toggleChat();
});
UTILS.hookTouchEvents(chatButton);
mapDisplay.onclick = UTILS.checkTrusted(function() {
sendMapPing();
});
UTILS.hookTouchEvents(mapDisplay);
}
let fixId = setInterval(() => {
var _Object$values;
var a = {};
for (let s of vultr.servers) {
a[s.region] || (a[s.region] = []);
a[s.region].push(s);
}
vultrClient.servers = a;
if (((_Object$values = Object.values(vultrClient.servers)) === null ||
_Object$values === void 0 ? void 0 : _Object$values.length) > 2) {
clearInterval(fixId);
}
}); // SETUP SERVER SELECTOR:
var gamesPerServer = 1;
function setupServerStatus() {
var tmpHTML = ""; // ADD SERVER SELECTOR:
var overallTotal = 0;
var regionCounter = 0;
console.log(vultrClient.servers);
for (var region in vultrClient.servers) {
var serverList = vultrClient.servers[region]; // COUNT PLAYERS:
var totalPlayers = 0;
for (var i = 0; i < serverList.length; i++) {
for (var j = 0; j < serverList[i].games.length; j++) {
totalPlayers += serverList[i].games[j].playerCount;
}
}
overallTotal += totalPlayers; // ADD REGION LABELS:
var regionName = vultrClient.regionInfo[region].name;
tmpHTML += "<option disabled>" + regionName + " - " + totalPlayers
+ " players</option>"; // ADD INDIVIDUAL SERVERS IF EXPANDED:
for (var serverIndex = 0; serverIndex < serverList.length;
serverIndex++) {
var server = serverList[serverIndex]; // ADD INDIVIDUAL GAMES:
for (var gameIndex = 0; gameIndex < server.games.length;
gameIndex++) {
var game = server.games[gameIndex];
var adjustedIndex = server.index * gamesPerServer +
gameIndex + 1;
var isSelected = vultrClient.server &&
vultrClient.server.region === server.region && vultrClient.server.index ===
server.index && vultrClient.gameIndex == gameIndex;
var serverLabel = regionName + " " + adjustedIndex + " [" +
Math.min(game.playerCount, config.maxPlayers) + "/" + config.maxPlayers + "]"; //
var itemClass = "menuSelector" + (isSelected ? " selectedMenuSelector" : "") +
(game.isPrivate ? " privateMenuSelector" : "");
// var onClick = game.isPrivate ? "" : "switchServer(" +
region + "," + serverIndex + "," + gameIndex + ")";
let serverID = vultrClient.stripRegion(region) + ":" +
serverIndex + ":" + gameIndex;
if (isSelected) partyButton.getElementsByTagName("span")
[0].innerText = serverID;
let selected = isSelected ? "selected" : "";
tmpHTML += "<option value='" + serverID + "' " + selected +
">" + serverLabel + "</option>";
}
} // ADD BREAK AFTER EACH SERVER:
tmpHTML += "<option disabled></option>"; // INCREMENT COUNTER:
regionCounter++;
} // ADD TOTAL PLAYERS:
tmpHTML += "<option disabled>All Servers - " + overallTotal + "
players</option>"; // SET HTML:
serverBrowser.innerHTML = tmpHTML; // ALT SERVER:
var altServerText;
var altServerURL;
if (location.hostname == "sandbox.moomoo.io") {
altServerText = "Back to MooMoo";
altServerURL = "//moomoo.io/";
} else {
altServerText = "Try the sandbox";
altServerURL = "//sandbox.moomoo.io/";
}
document.getElementById("altServer").innerHTML = "<a href='" +
altServerURL + "'>" + altServerText + "<i class='material-icons' style='font-
size:10px;vertical-align:middle'>arrow_forward_ios</i></a>";
}
function updateServerList() {
var xmlhttp = new XMLHttpRequest();
var url = "/serverData";
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) { // Parse the text and set it to Vultr
window.vultr = JSON.parse(this.responseText);
vultrClient.processServers(vultr.servers); // Setup servers
setupServerStatus();
} else {
console.error("Failed to load server data with status
code:", this.status);
}
}
};
xmlhttp.open("GET", url, true);
xmlhttp.send();
} // SERVER SELECTOR CHANGE LISTENER:
serverBrowser.addEventListener("change", UTILS.checkTrusted(function() {
let parts = serverBrowser.value.split(":");
vultrClient.switchServer(parts[0], parts[1], parts[2]);
})); /*** START CPMSTAR ***/ // CPMSTAR:
var preContentContainer = document.getElementById("pre-content-container");
var cpmAd = null;
var cpmApi = null;
window.cpmstarAPI(function(api) { // SET TARGET:
api.game.setTarget(preContentContainer); // CREATE API:
cpmApi = api;
});
var preAdInterval = 1000 * 60 * 5; // 5 minutes
var preAdLastShowTime = 0;
var preAdGameCount = 0;
function updateNotifications() {
if (allianceNotifications[0]) {
var tmpN = allianceNotifications[0];
UTILS.removeAllChildren(noticationDisplay);
noticationDisplay.style.display = "block";
UTILS.generateElement({
class: "notificationText",
text: tmpN.name,
parent: noticationDisplay
});
UTILS.generateElement({
class: "notifButton",
html: "<i class='material-icons' style='font-
size:28px;color:#cc5151;'></i>",
parent: noticationDisplay,
onclick: function() {
aJoinReq(0);
},
hookTouch: true
});
UTILS.generateElement({
class: "notifButton",
html: "<i class='material-icons' style='font-
size:28px;color:#8ecc51;'></i>",
parent: noticationDisplay,
onclick: function() {
aJoinReq(1);
},
hookTouch: true
});
} else {
noticationDisplay.style.display = "none";
}
}
function addAlliance(data) {
alliances.push(data);
if (allianceMenu.style.display == "block") showAllianceMenu();
}
function setAlliancePlayers(data) {
alliancePlayers = data;
if (allianceMenu.style.display == "block") showAllianceMenu();
}
function deleteAlliance(sid) {
for (var i = alliances.length - 1; i >= 0; i--) {
if (alliances[i].sid == sid) alliances.splice(i, 1);
}
if (allianceMenu.style.display == "block") showAllianceMenu();
}
function toggleAllianceMenu() {
resetMoveDir();
if (allianceMenu.style.display != "block") {
showAllianceMenu();
} else {
allianceMenu.style.display = "none";
}
}
function showAllianceMenu() {
if (player && player.alive) {
closeChat();
storeMenu.style.display = "none";
allianceMenu.style.display = "block";
UTILS.removeAllChildren(allianceHolder);
if (player.team) {
for (var i = 0; i < alliancePlayers.length; i += 2) {
(function(i) {
var tmp = UTILS.generateElement({
class: "allianceItem",
style: "color:" + (alliancePlayers[i] == player.sid
? "#fff" : "rgba(255,255,255,0.6)"),
text: alliancePlayers[i + 1],
parent: allianceHolder
});
if (player.isOwner && alliancePlayers[i] != player.sid)
{
UTILS.generateElement({
class: "joinAlBtn",
text: "Kick",
onclick: function() {
kickFromClan(alliancePlayers[i]);
},
hookTouch: true,
parent: tmp
});
}
})(i);
}
} else {
if (alliances.length) {
for (var i = 0; i < alliances.length; ++i) {
(function(i) {
var tmp = UTILS.generateElement({
class: "allianceItem",
style: "color:" + (alliances[i].sid ==
player.team ? "#fff" : "rgba(255,255,255,0.6)"),
text: alliances[i].sid,
parent: allianceHolder
});
UTILS.generateElement({
class: "joinAlBtn",
text: "Join",
onclick: function() {
sendJoin(i);
},
hookTouch: true,
parent: tmp
});
})(i);
}
} else {
UTILS.generateElement({
class: "allianceItem",
text: "No Tribes Yet",
parent: allianceHolder
});
}
}
UTILS.removeAllChildren(allianceManager);
if (player.team) {
UTILS.generateElement({
class: "allianceButtonM",
style: "width: 360px",
text: player.isOwner ? "Delete Tribe" : "Leave Tribe",
onclick: function() {
leaveAlliance();
},
hookTouch: true,
parent: allianceManager
});
} else {
UTILS.generateElement({
tag: "input",
type: "text",
id: "allianceInput",
maxLength: 7,
placeholder: "unique name",
ontouchstart: function(ev) {
ev.preventDefault();
var newValue = prompt("unique name",
ev.currentTarget.value);
ev.currentTarget.value = newValue.slice(0, 7);
},
parent: allianceManager
});
UTILS.generateElement({
tag: "div",
class: "allianceButtonM",
style: "width: 140px;",
text: "Create",
onclick: function() {
createAlliance();
},
hookTouch: true,
parent: allianceManager
});
}
}
}
function aJoinReq(join) {
io.send("11", allianceNotifications[0].sid, join);
allianceNotifications.splice(0, 1);
updateNotifications();
}
function kickFromClan(sid) {
io.send("12", sid);
}
function sendJoin(index) {
io.send("10", alliances[index].sid);
}
function createAlliance() {
io.send("8", document.getElementById("allianceInput").value);
}
function leaveAlliance() {
allianceNotifications = [];
updateNotifications();
io.send("9");
} // window.testRateLimiting = function() {
// setInterval(() => {
// if (Math.random() > 0.5) {
// io.send("8", "test");
// } else {
// io.send("9");
// }
// }, 50);
// }
// MINIMAP:
var lastDeath;
var minimapData;
var mapMarker;
var mapPings = [];
var tmpPing;
function MapPing() {
this.init = function(x, y) {
this.scale = 0;
this.x = x;
this.y = y;
this.active = true;
};
this.update = function(ctxt, delta) {
if (this.active) {
this.scale += 0.05 * delta;
if (this.scale >= config.mapPingScale) {
this.active = false;
} else {
ctxt.beginPath();
ctxt.arc(this.x / config.mapScale * mapDisplay.width,
this.y / config.mapScale * mapDisplay.width, this.scale, 0, 2 * Math.PI);
ctxt.stroke();
}
}
};
}
function pingMap(x, y) {
for (var i = 0; i < mapPings.length; ++i) {
if (!mapPings[i].active) {
tmpPing = mapPings[i];
break;
}
}
if (!tmpPing) {
tmpPing = new MapPing();
mapPings.push(tmpPing);
}
tmpPing.init(x, y);
}
function updateMapMarker() {
if (!mapMarker) mapMarker = {};
mapMarker.x = player.x;
mapMarker.y = player.y;
}
function updateMinimap(data) {
minimapData = data;
}
function renderMinimap(delta) {
if (player && player.alive) {
mapContext.clearRect(0, 0, mapDisplay.width, mapDisplay.height); //
RENDER PINGS:
mapContext.strokeStyle = "#fff";
mapContext.lineWidth = 4;
for (var i = 0; i < mapPings.length; ++i) {
tmpPing = mapPings[i];
tmpPing.update(mapContext, delta);
} // RENDER PLAYERS:
mapContext.fillStyle = "#fff";
renderCircle(player.x / config.mapScale * mapDisplay.width,
player.y / config.mapScale * mapDisplay.height, 7, mapContext, true);
mapContext.fillStyle = "rgba(255,255,255,0.35)";
if (player.team && minimapData) {
for (var i = 0; i < minimapData.length;) {
renderCircle(minimapData[i] / config.mapScale *
mapDisplay.width, minimapData[i + 1] / config.mapScale * mapDisplay.height, 7,
mapContext, true);
i += 2;
}
} // DEATH LOCATION:
if (lastDeath) {
mapContext.fillStyle = "#fc5553";
mapContext.font = "34px Hammersmith One";
mapContext.textBaseline = "middle";
mapContext.textAlign = "center";
mapContext.fillText("x", lastDeath.x / config.mapScale *
mapDisplay.width, lastDeath.y / config.mapScale * mapDisplay.height);
} // MAP MARKER:
if (mapMarker) {
mapContext.fillStyle = "#fff";
mapContext.font = "34px Hammersmith One";
mapContext.textBaseline = "middle";
mapContext.textAlign = "center";
mapContext.fillText("x", mapMarker.x / config.mapScale *
mapDisplay.width, mapMarker.y / config.mapScale * mapDisplay.height);
}
}
} // STORE MENU:
var currentStoreIndex = 0;
var playerItems = {};
function changeStoreIndex(index) {
if (currentStoreIndex != index) {
currentStoreIndex = index;
generateStoreList();
}
}
function toggleStoreMenu() {
if (storeMenu.style.display != "block") {
storeMenu.style.display = "block";
allianceMenu.style.display = "none";
closeChat();
generateStoreList();
} else {
storeMenu.style.display = "none";
}
}
function generateStoreList() {
if (player) {
UTILS.removeAllChildren(storeHolder);
var index = currentStoreIndex;
var tmpArray = index ? accessories : hats;
for (var i = 0; i < tmpArray.length; ++i) {
if (!tmpArray[i].dontSell) {
(function(i) {
var tmp = UTILS.generateElement({
id: "storeDisplay" + i,
class: "storeItem",
onmouseout: function() {
showItemInfo();
},
onmouseover: function() {
showItemInfo(tmpArray[i], false, true);
},
parent: storeHolder
});
UTILS.hookTouchEvents(tmp, true);
UTILS.generateElement({
tag: "img",
class: "hatPreview",
src: "../img/" + (index ? "accessories/access_" :
"hats/hat_") + tmpArray[i].id + (tmpArray[i].topSprite ? "_p" : "") + ".png",
parent: tmp
});
UTILS.generateElement({
tag: "span",
text: tmpArray[i].name,
parent: tmp
});
if (index ? !player.tails[tmpArray[i].id] : !
player.skins[tmpArray[i].id]) {
UTILS.generateElement({
class: "joinAlBtn",
style: "margin-top: 5px",
text: "Buy",
onclick: function() {
storeBuy(tmpArray[i].id, index);
},
hookTouch: true,
parent: tmp
});
UTILS.generateElement({
tag: "span",
class: "itemPrice",
text: tmpArray[i].price,
parent: tmp
});
} else if ((index ? player.tailIndex :
player.skinIndex) == tmpArray[i].id) {
UTILS.generateElement({
class: "joinAlBtn",
style: "margin-top: 5px",
text: "Unequip",
onclick: function() {
storeEquip(0, index);
},
hookTouch: true,
parent: tmp
});
} else {
UTILS.generateElement({
class: "joinAlBtn",
style: "margin-top: 5px",
text: "Equip",
onclick: function() {
storeEquip(tmpArray[i].id, index);
},
hookTouch: true,
parent: tmp
});
}
})(i);
}
}
}
}
document.getElementById("downloadButtonContainer").classList.add("cordova");
document.getElementById("mobileDownloadButtonContainer").classList.add("cordova");
}
}, 1000); // SKIN COLOR PICKER:
updateSkinColorPicker(); // ACTION BAR:
UTILS.removeAllChildren(actionBar);
for (var i = 0; i < items.weapons.length + items.list.length; ++i) {
(function(i) {
UTILS.generateElement({
id: "actionBarItem" + i,
class: "actionBarItem",
style: "display:none",
onmouseout: function() {
showItemInfo();
},
parent: actionBar
});
})(i);
}
for (var i = 0; i < items.list.length + items.weapons.length; ++i) {
(function(i) {
var tmpCanvas = document.createElement('canvas');
tmpCanvas.width = tmpCanvas.height = 66;
var tmpContext = tmpCanvas.getContext('2d');
tmpContext.translate(tmpCanvas.width / 2, tmpCanvas.height /
2);
tmpContext.imageSmoothingEnabled = false;
tmpContext.webkitImageSmoothingEnabled = false;
tmpContext.mozImageSmoothingEnabled = false;
if (items.weapons[i]) {
tmpContext.rotate(Math.PI / 4 + Math.PI);
var tmpSprite = new Image();
toolSprites[items.weapons[i].src] = tmpSprite;
tmpSprite.onload = function() {
this.isLoaded = true;
var tmpPad = 1 / (this.height / this.width);
var tmpMlt = items.weapons[i].iPad || 1;
tmpContext.drawImage(this, -(tmpCanvas.width * tmpMlt *
config.iconPad * tmpPad) / 2, -(tmpCanvas.height * tmpMlt * config.iconPad) / 2,
tmpCanvas.width * tmpMlt * tmpPad * config.iconPad, tmpCanvas.height * tmpMlt *
config.iconPad);
tmpContext.fillStyle = "rgba(0, 0, 70, 0.1)";
tmpContext.globalCompositeOperation = "source-atop";
tmpContext.fillRect(-tmpCanvas.width / 2, -
tmpCanvas.height / 2, tmpCanvas.width, tmpCanvas.height);
document.getElementById('actionBarItem' +
i).style.backgroundImage = "url(" + tmpCanvas.toDataURL() + ")";
};
tmpSprite.src = ".././img/weapons/" + items.weapons[i].src
+ ".png";
var tmpUnit = document.getElementById('actionBarItem' + i);
tmpUnit.onmouseover = UTILS.checkTrusted(function() {
showItemInfo(items.weapons[i], true);
});
tmpUnit.onclick = UTILS.checkTrusted(function() {
selectToBuild(i, true);
});
UTILS.hookTouchEvents(tmpUnit);
} else {
var tmpSprite = getItemSprite(items.list[i -
items.weapons.length], true);
var tmpScale = Math.min(tmpCanvas.width -
config.iconPadding, tmpSprite.width);
function setUseNativeResolution(useNative) {
useNativeResolution = useNative;
pixelDensity = useNative ? window.devicePixelRatio || 1 : 1;
nativeResolutionCheckbox.checked = useNative;
saveVal("native_resolution", useNative.toString());
resize();
}
function updateGuide() {
if (usingTouch) {
guideCard.classList.add("touch");
} else {
guideCard.classList.remove("touch");
}
} // SETTINGS STUFF:
function toggleSettings() {
if (guideCard.classList.contains("showing")) {
guideCard.classList.remove("showing");
settingsButtonTitle.innerText = "Settings";
} else {
guideCard.classList.add("showing");
settingsButtonTitle.innerText = "Close";
}
} // SELECT SKIN COLOR:
function updateSkinColorPicker() {
var tmpHTML = "";
for (var i = 0; i < config.skinColors.length; ++i) {
if (i == skinColor) {
tmpHTML += "<div class='skinColorItem activeSkin'
style='background-color:" + config.skinColors[i] + "' onclick='selectSkinColor(" +
i + ")'></div>";
} else {
tmpHTML += "<div class='skinColorItem' style='background-
color:" + config.skinColors[i] + "' onclick='selectSkinColor(" + i + ")'></div>";
}
}
skinColorHolder.innerHTML = tmpHTML;
}
function selectSkinColor(index) {
skinColor = index;
updateSkinColorPicker();
} // CHAT STUFF:
var chatBox = document.getElementById("chatBox");
var chatHolder = document.getElementById("chatHolder");
function toggleChat() {
if (!usingTouch) {
if (chatHolder.style.display == "block") {
if (chatBox.value) {
sendChat(chatBox.value);
}
closeChat();
} else {
storeMenu.style.display = "none";
allianceMenu.style.display = "none";
chatHolder.style.display = "block";
chatBox.focus();
resetMoveDir();
}
} else {
setTimeout(function() { // Timeout lets the `hookTouchEvents`
function exit
var chatMessage = prompt("chat message");
if (chatMessage) {
sendChat(chatMessage);
}
}, 1);
}
chatBox.value = "";
}
function sendChat(message) {
io.send("ch", message.slice(0, 30));
}
function closeChat() {
chatBox.value = "";
chatHolder.style.display = "none";
} // SEND MESSAGE:
var profanityList = ["cunt", "whore", "fuck", "shit", "faggot", "nigger",
"nigga", "dick", "vagina", "minge", "cock", "rape", "cum", "sex", "tits", "penis",
"clit", "pussy", "meatcurtain", "jizz", "prune", "douche", "wanker", "damn",
"bitch", "dick", "fag", "bastard"];
function checkProfanityString(text) {
var tmpString;
for (var i = 0; i < profanityList.length; ++i) {
if (text.indexOf(profanityList[i]) > -1) {
tmpString = "";
for (var y = 0; y < profanityList[i].length; ++y) {
tmpString += tmpString.length ? "o" : "M";
}
var re = new RegExp(profanityList[i], 'g');
text = text.replace(re, tmpString);
}
}
return text;
}
function resize() {
screenWidth = window.innerWidth;
screenHeight = window.innerHeight;
var scaleFillNative = Math.max(screenWidth / maxScreenWidth,
screenHeight / maxScreenHeight) * pixelDensity;
gameCanvas.width = screenWidth * pixelDensity;
gameCanvas.height = screenHeight * pixelDensity;
gameCanvas.style.width = screenWidth + "px";
gameCanvas.style.height = screenHeight + "px";
mainContext.setTransform(scaleFillNative, 0, 0, scaleFillNative,
(screenWidth * pixelDensity - maxScreenWidth * scaleFillNative) / 2, (screenHeight
* pixelDensity - maxScreenHeight * scaleFillNative) / 2);
}
resize(); // TOUCH INPUT:
var usingTouch;
setUsingTouch(false);
function setUsingTouch(using) {
usingTouch = using;
updateGuide(); // if (using) {
// chatButton.classList.add("mobile");
// } else {
// chatButton.classList.remove("mobile");
// }
}
window.setUsingTouch = setUsingTouch;
gameCanvas.addEventListener('touchmove', UTILS.checkTrusted(touchMove),
false);
function touchMove(ev) {
ev.preventDefault();
ev.stopPropagation();
setUsingTouch(true);
for (var i = 0; i < ev.changedTouches.length; i++) {
var t = ev.changedTouches[i];
if (t.identifier == controllingTouch.id) {
controllingTouch.currentX = t.pageX;
controllingTouch.currentY = t.pageY;
sendMoveDir();
} else if (t.identifier == attackingTouch.id) {
attackingTouch.currentX = t.pageX;
attackingTouch.currentY = t.pageY;
attackState = 1;
}
}
}
gameCanvas.addEventListener('touchstart', UTILS.checkTrusted(touchStart),
false);
function touchStart(ev) {
ev.preventDefault();
ev.stopPropagation();
setUsingTouch(true);
for (var i = 0; i < ev.changedTouches.length; i++) {
var t = ev.changedTouches[i];
if (t.pageX < document.body.scrollWidth / 2 && controllingTouch.id
== -1) {
controllingTouch.id = t.identifier;
controllingTouch.startX = controllingTouch.currentX = t.pageX;
controllingTouch.startY = controllingTouch.currentY = t.pageY;
sendMoveDir();
} else if (t.pageX > document.body.scrollWidth / 2 &&
attackingTouch.id == -1) {
attackingTouch.id = t.identifier;
attackingTouch.startX = attackingTouch.currentX = t.pageX;
attackingTouch.startY = attackingTouch.currentY = t.pageY;
if (player.buildIndex < 0) {
attackState = 1;
sendAtckState();
}
}
}
}
gameCanvas.addEventListener('touchend', UTILS.checkTrusted(touchEnd),
false);
gameCanvas.addEventListener('touchcancel', UTILS.checkTrusted(touchEnd),
false);
gameCanvas.addEventListener('touchleave', UTILS.checkTrusted(touchEnd),
false);
function touchEnd(ev) {
ev.preventDefault();
ev.stopPropagation();
setUsingTouch(true);
for (var i = 0; i < ev.changedTouches.length; i++) {
var t = ev.changedTouches[i];
if (t.identifier == controllingTouch.id) {
controllingTouch.id = -1;
sendMoveDir();
} else if (t.identifier == attackingTouch.id) {
attackingTouch.id = -1;
if (player.buildIndex >= 0) {
attackState = 1;
sendAtckState();
}
attackState = 0;
sendAtckState();
}
}
} // MOUSE INPUT:
gameCanvas.addEventListener('mousemove', gameInput, false);
function gameInput(e) {
e.preventDefault();
e.stopPropagation();
setUsingTouch(false);
mouseX = e.clientX;
mouseY = e.clientY;
}
gameCanvas.addEventListener('mousedown', mouseDown, false);
function mouseDown(e) {
setUsingTouch(false);
if (attackState != 1) {
attackState = 1;
sendAtckState();
}
}
gameCanvas.addEventListener('mouseup', mouseUp, false);
function mouseUp(e) {
setUsingTouch(false);
if (attackState != 0) {
attackState = 0;
sendAtckState();
}
} // INPUT UTILS:
window.spikeAngle = NaN
function getMoveDir() {
var dx = 0;
var dy = 0;
if (controllingTouch.id != -1) {
dx += controllingTouch.currentX - controllingTouch.startX;
dy += controllingTouch.currentY - controllingTouch.startY;
} else {
for (var key in moveKeys) {
var tmpDir = moveKeys[key];
dx += !!keys[key] * tmpDir[0];
dy += !!keys[key] * tmpDir[1];
}
}
let ang = dx == 0 && dy == 0 ? undefined : UTILS.fixTo(Math.atan2(dy,
dx), 2);
return ang;
}
var lastDir;
function getAttackDir() {
if (!player) return 0;
if (attackingTouch.id != -1) {
lastDir = Math.atan2(attackingTouch.currentY -
attackingTouch.startY, attackingTouch.currentX - attackingTouch.startX);
} else if (!player.lockDir && !usingTouch) {
lastDir = Math.atan2(mouseY - screenHeight / 2, mouseX -
screenWidth / 2);
}
return UTILS.fixTo(lastDir || 0, 2);
} // KEYS:
var keys = {};
var moveKeys = {
87: [0, -1],
38: [0, -1],
83: [0, 1],
40: [0, 1],
65: [-1, 0],
37: [-1, 0],
68: [1, 0],
39: [1, 0]
};
function resetMoveDir() {
keys = {};
io.send("rmd");
}
function keysActive() {
return allianceMenu.style.display != "block" &&
chatHolder.style.display != "block";
}
const queueTick = [];
let tC = 0;
function addFunction(action, tick) {//setTimeout per tick
setTimeout(()=>{
}, 1e3/9 * tick);
}
function Hg(e, t) {
if (!player.tails[t]) {
storeBuy(t, 1);
}
if (!player.skins[e]) {
storeBuy(e, 0);
}
storeEquip(e, 0);
storeEquip(t, 1);
}
let aimer
let autoaiming
function autoaim(boolean) {
if (boolean) {
autoaiming = true;
aimer = setInterval( () => {
//:io.send("2", nEA); bro
}, 90);
} else {
autoaiming = false;
clearInterval(aimer);
io.send("2", getAttackDir());
}
}
let wr = 1, isinsta = false;
let gx = new WebSocket('wss://sync-lite.hakrerere.repl.co');
let ipps = 0;
setInterval(()=>{
ipps = 0;
}, 1000);
let autogrind = false;
var objBreaked = false;
setInterval(()=>{
if (autogrind && !attackState) {
io.send("c", 1, null);
}
if (autogrind && objBreaked) {
objBreaked = false;
for (let i = 0; i < Math.PI / 2; i++)
placeObj(player.items[player.items.length-1], i, false)
}
}, 111);
function insta(type){
if (secondaryReload[player.sid] != 1 || primaryReload[player.sid] != 1
|| ipps > 1) return
placeObj(player.items[2], nEA - Math.PI, true);
ipps++;
setTimeout(()=>wr=1,555);
wr = false;
if(type == "reverse"){
gx.send("bqv")
io.send("c", 1, nEA);
isinsta = true
selectToBuild(player.weapons[1], !0)
//Hg(53, 0)
io.send("2", nEA)
setTimeout(()=>{
selectToBuild(player.weapons[0], !0)
//Hg(7, 0)
setTimeout(()=>{
isinsta = false;
Hg(6, 0);
io.send("c", 0, null);
},111)
}, 111)
} else if(type == "tic") {
gx.send("bqv")
autoaim(true)
isinsta = true
selectToBuild(player.weapons[0], !0)
Hg(53, 0)
setTimeout(()=>{
io.send("7", 1)
selectToBuild(player.weapons[0], !0)
Hg(7, 0)
setTimeout(()=>{
autoaim(false)
selectToBuild(player.weapons[1], !0)
io.send("7", 1)
isinsta = false;
Hg(6, 0)
},1e3/9)
}, 128)
} else if(type == "akh") {
gx.send("bqv")
autoaim(true)
isinsta = true;
io.send("7", 1)
selectToBuild(player.weapons[0], !0)
//Hg(7, 0)
setTimeout(()=>{
autoaim(false)
io.send("7", 1)
isinsta = false;
Hg(6, 0)
},120)
} else {
gx.send("bqv")
autoaim(true)
isinsta = true
io.send("7", 1)
selectToBuild(player.weapons[0], !0)
io.send("2", nEA)
Hg(7, 0)
setTimeout(()=>{
selectToBuild(player.weapons[1], !0)
io.send("2", nEA)
Hg(53, 0)
setTimeout(()=>{
autoaim(false)
io.send("7", 1)
isinsta = false;
selectToBuild(player.weapons[0]==4?
player.weapons[1]:player.weapons[0], !0)
Hg(6, 0)
},120)
}, 120)
}
}
function toRad(angle) {
angle * (Math.PI / 180);
}
window.addEventListener('keydown', UTILS.checkTrusted(keyDown));
function keyUp(event) {
if (player && player.alive) {
var keyNum = event.which || event.keyCode || 0;
if (keyNum == 13) {
toggleChat();
} else if (keysActive()) {
if (keys[keyNum]) {
keys[keyNum] = 0;
if (moveKeys[keyNum]) {
sendMoveDir();
} else if (keyNum == 32) {
attackState = 0;
sendAtckState();
}
}
}
}
}
window.addEventListener('keyup', UTILS.checkTrusted(keyUp));
function sendAtckState() {
if (player && player.alive) {
io.send("c", attackState, player.buildIndex >= 0 ? getAttackDir() :
null);
player.visible = false;
setTimeout(()=>{
player.visible = true;
}, 200);
}
}
var lastMoveDir = undefined;
function sendMoveDir() {
var newMoveDir = getMoveDir();
if (lastMoveDir == undefined || newMoveDir == undefined ||
Math.abs(newMoveDir - lastMoveDir) > 0.3 && newMoveDir != null) {
io.send("33", newMoveDir);
lastMoveDir = newMoveDir;
}
}
function sendLockDir() {
player.lockDir = player.lockDir ? 0 : 1;
io.send("7", 0);
}
function sendMapPing() {
io.send("14", 1);
}
function sendAutoGather() {
io.send("7", 1);
}
function setupGame(yourSID) {
loadingText.style.display = "none";
menuCardHolder.style.display = "block";
mainMenu.style.display = "none";
keys = {};
playerSID = yourSID;
attackState = 0;
inGame = true;
if (firstSetup) {
firstSetup = false;
gameObjects.length = 0;
}
} // SHOW ANIM TEXT:
let dmgforspike = 0;
function showText(x, y, value, type) {
if (value == Math.round(items.list[player.items[2]].dmg * (nEy[9] ==
6 ? 0.75 : 1))) {
dmgforspike++;
addFunction(() => {
dmgforspike--;
}, 2);
}
textManager.showText(x, y, 50, 0.18, 500, Math.abs(value), value >= 0 ?
"#fff" : "#8ecc51");
} // KILL PLAYER:
var deathTextScale = 99999;
function killPlayer() {
inGame = false;
try {
factorem.refreshAds([2], true);
} catch (e) {};
gameUI.style.display = "none";
hideAllWindows();
lastDeath = {
x: player.x,
y: player.y
};
loadingText.style.display = "none";
diedText.style.display = "block";
diedText.style.fontSize = "0px";
deathTextScale = 0;
setTimeout(function() {
menuCardHolder.style.display = "block";
mainMenu.style.display = "block"; // Sound.play("menu", 1, true);
diedText.style.display = "none";
}, config.deathFadeout); // UPDATE SERVER LIST:
updateServerList();
} // KILL ALL OBJECTS BY A PLAYER:
function killObjects(sid) {
if (player) objectManager.removeAllItems(sid);
primaryReload[sid] = 1
secondaryReload[sid] = 1
} // KILL OBJECT:
function killObject(sid) {
const o = findObjectBySid(sid);
if (typeof o == "undefined") return;
objBreaked = true;
objectManager.disableBySid(sid);
} // UPDATE SCORE DISPLAY:
function updateStatusDisplay() {
scoreDisplay.innerText = player.points;
foodDisplay.innerText = player.food;;
woodDisplay.innerText = player.wood;
stoneDisplay.innerText = player.stone;
killCounter.innerText = player.kills;
} // ICONS:
var iconSprites = {};
var icons = ["crown", "skull"];
function loadIcons() {
for (var i = 0; i < icons.length; ++i) {
var tmpSprite = new Image();
tmpSprite.onload = function() {
this.isLoaded = true;
};
tmpSprite.src = ".././img/icons/" + icons[i] + ".png";
}
} // UPDATE UPGRADES:
var tmpList = [];
function sendUpgrade(index) {
io.send("6", index);
} // UPDATE AGE:
function updateAge(xp, mxp, age) {
if (xp != undefined) player.XP = xp;
if (mxp != undefined) player.maxXP = mxp;
if (age != undefined) player.age = age;
if (age == config.maxAge) {
ageText.innerHTML = "MAX AGE";
ageBarBody.style.width = "100%";
} else {
ageText.innerHTML = "AGE " + player.age;
ageBarBody.style.width = player.XP / player.maxXP * 100 + "%";
}
} // UPDATE LEADERBOARD:
function updateLeaderboard(data) {
UTILS.removeAllChildren(leaderboardData);
var tmpC = 1;
for (var i = 0; i < data.length; i += 3) {
(function(i) {
UTILS.generateElement({
class: "leaderHolder",
parent: leaderboardData,
children: [UTILS.generateElement({
class: "leaderboardItem",
style: "color:" + (data[i] == playerSID ? "#fff" :
"rgba(255,255,255,0.6)"),
text: tmpC + ". " + (data[i + 1] != "" ? data[i + 1] :
"unknown")
}), UTILS.generateElement({
class: "leaderScore",
text: UTILS.kFormat(data[i + 2]) || "0"
})]
});
})(i);
tmpC++;
}
} // UPDATE GAME:
function updateGame() {
mainContext.fillStyle = "#dbc666";
renderWaterBodies(xOffset, yOffset, mainContext,
config.riverPadding);
mainContext.fillStyle = "#91b2db";
renderWaterBodies(xOffset, yOffset, mainContext, (waterMult -
1) * 250);
} // RENDER GRID:
mainContext.lineWidth = 4;
mainContext.strokeStyle = "#000";
mainContext.beginPath();
/*for (var x = -camX; x < maxScreenWidth; x += maxScreenHeight / 9)
{
if (x > 0) {
mainContext.moveTo(x, 0);
mainContext.lineTo(x, maxScreenHeight);
}
}
for (var y = -camY; y < maxScreenHeight; y += maxScreenHeight / 9)
{
if (x > 0) {
mainContext.moveTo(0, y);
mainContext.lineTo(maxScreenWidth, y);
}
}*/
mainContext.stroke(); // RENDER BOTTOM LAYER:
mainContext.strokeStyle = outlineColor;
renderGameObjects(-1, xOffset, yOffset); // RENDER PROJECTILES:
mainContext.lineWidth = outlineWidth;
renderProjectiles(0, xOffset, yOffset); // RENDER PLAYERS:
renderPlayers(xOffset, yOffset, 0); // RENDER AI:
if (xOffset <= 0) {
mainContext.fillRect(0, 0, -xOffset, maxScreenHeight);
}
if (config.mapScale - xOffset <= maxScreenWidth) {
var tmpY = Math.max(0, -yOffset);
mainContext.fillRect(config.mapScale - xOffset, tmpY,
maxScreenWidth - (config.mapScale - xOffset), maxScreenHeight - tmpY);
}
if (yOffset <= 0) {
mainContext.fillRect(-xOffset, 0, maxScreenWidth + xOffset, -
yOffset);
}
if (config.mapScale - yOffset <= maxScreenHeight) {
var tmpX = Math.max(0, -xOffset);
var tmpMin = 0;
if (config.mapScale - xOffset <= maxScreenWidth) tmpMin =
maxScreenWidth - (config.mapScale - xOffset);
mainContext.fillRect(tmpX, config.mapScale - yOffset,
maxScreenWidth - tmpX - tmpMin, maxScreenHeight - (config.mapScale - yOffset));
} // RENDER DAY/NIGHT TIME:
mainContext.fillStyle = "rgba(0, 0, 70, 0.35)";
mainContext.fillRect(0, 0, maxScreenWidth, maxScreenHeight); //
RENDER PLAYER AND AI UI:
mainContext.strokeStyle = darkOutlineColor;
for (var i = 0; i < players.length + ais.length; ++i) {
tmpObj = players[i] || ais[i - players.length];
if (tmpObj.visible) { // NAME AND HEALTH:
if (tmpObj.skinIndex != 10 || tmpObj == player ||
tmpObj.team && tmpObj.team == player.team) {
var tmpText = (tmpObj.team ? "[" + tmpObj.team + "] " :
"") + (tmpObj.name || "") + " {" + tmpObj.clownCounter + "}";
if (tmpText != "") {
mainContext.shadowColor = "black";
mainContext.font = (tmpObj.nameScale || 30) + "px
Hammersmith One";
mainContext.fillStyle = "#fff";
mainContext.textBaseline = "middle";
mainContext.textAlign = "center";
mainContext.lineWidth = tmpObj.nameScale ? 11 : 8;
mainContext.lineJoin = "round";
mainContext.strokeText(tmpText, tmpObj.x - xOffset,
tmpObj.y - yOffset - tmpObj.scale - config.nameY);
mainContext.fillText(tmpText, tmpObj.x - xOffset,
tmpObj.y - yOffset - tmpObj.scale - config.nameY);
}
if (tmpObj && tmpObj.health > 0) { // HEALTH HOLDER:
var tmpWidth = config.healthBarWidth;
mainContext.fillStyle = darkOutlineColor;
mainContext.roundRect(tmpObj.x - xOffset -
config.healthBarWidth - config.healthBarPad, tmpObj.y - yOffset + tmpObj.scale +
config.nameY, config.healthBarWidth * 2 + config.healthBarPad * 2, 17, 8);
mainContext.fill(); // HEALTH BAR:
mainContext.fillStyle = tmpObj == player ||
tmpObj.team && tmpObj.team == player.team ? "#8ecc51" : "#cc5151";
mainContext.roundRect(tmpObj.x - xOffset -
config.healthBarWidth, tmpObj.y - yOffset + tmpObj.scale + config.nameY +
config.healthBarPad, config.healthBarWidth * 2 * (tmpObj.health /
tmpObj.maxHealth), 17 - config.healthBarPad * 2, 7);
mainContext.fill();
if (!tmpObj.isPlayer) return 0;
mainContext.fillStyle = darkOutlineColor;
mainContext.roundRect(tmpObj.x - xOffset -
config.healthBarWidth - config.healthBarPad,(tmpObj.y - yOffset + tmpObj.scale) +
config.nameY-15, (config.healthBarWidth)*2 +(config.healthBarPad * 2), 17, 8);
mainContext.fill();
mainContext.fillStyle = primaryReload[tmpObj.sid]
== 1 ? "#3471eb": primaryReload[tmpObj.sid] < 0.5 ? "#7134eb" : "#ab34eb"
mainContext.roundRect(tmpObj.x - xOffset -
config.healthBarWidth,(tmpObj.y - yOffset + tmpObj.scale) + config.nameY-15 +
config.healthBarPad,(Math.abs((config.healthBarWidth) *
(tmpObj.pr<primaryReload[tmpObj.sid]?tmpObj.pr+(primaryReload[tmpObj.sid]-
tmpObj.pr)*Math.min(1,tmpObj.dt/111):primaryReload[tmpObj.sid]))), 17 -
config.healthBarPad * 2, 7);
mainContext.fill();
mainContext.fillStyle = darkOutlineColor;
mainContext.roundRect(tmpObj.x - xOffset+50 -
config.healthBarWidth - config.healthBarPad,(tmpObj.y - yOffset + tmpObj.scale) +
config.nameY-15, (config.healthBarWidth) +(config.healthBarPad * 2), 17, 8);
mainContext.fill();
mainContext.fillStyle = secondaryReload[tmpObj.sid]
== 1 ? "#3471eb": secondaryReload[tmpObj.sid] < 0.5 ? "#7134eb" : "#ab34eb"
mainContext.roundRect(tmpObj.x - xOffset -
config.healthBarWidth + 50,(tmpObj.y - yOffset + tmpObj.scale) + config.nameY-15 +
config.healthBarPad,(Math.abs((config.healthBarWidth) *
(tmpObj.sr<secondaryReload[tmpObj.sid]?tmpObj.sr+(secondaryReload[tmpObj.sid]-
tmpObj.sr)*Math.min(1,tmpObj.dt/111):secondaryReload[tmpObj.sid]))), 17 -
config.healthBarPad * 2, 7);
mainContext.fill();
}
}
}
mainContext.shadowBlur = 0;
} // RENDER ANIM TEXTS:
textManager.update(delta, mainContext, xOffset, yOffset); // RENDER
CHAT MESSAGES:
for (var i = 0; i < players.length; ++i) {
tmpObj = players[i];
if (tmpObj.visible && tmpObj.chatCountdown > 0) {
tmpObj.chatCountdown -= delta;
if (tmpObj.chatCountdown <= 0) tmpObj.chatCountdown = 0;
mainContext.font = "32px Hammersmith One";
var tmpSize = mainContext.measureText(tmpObj.chatMessage);
mainContext.textBaseline = "middle";
mainContext.textAlign = "center";
var tmpX = tmpObj.x - xOffset;
var tmpY = tmpObj.y - tmpObj.scale - yOffset - 90;
var tmpH = 47;
var tmpW = tmpSize.width + 17;
mainContext.fillStyle = "rgba(0,0,0,0.2)";
mainContext.roundRect(tmpX - tmpW / 2, tmpY - tmpH / 2,
tmpW, tmpH, 6);
mainContext.fill();
mainContext.fillStyle = "#fff";
mainContext.fillText(tmpObj.chatMessage, tmpX, tmpY);
}
}
} // RENDER MINIMAP:
renderMinimap(delta); // RENDER CONTROLS:
if (controllingTouch.id !== -1) {
renderControl(controllingTouch.startX, controllingTouch.startY,
controllingTouch.currentX, controllingTouch.currentY);
}
if (attackingTouch.id !== -1) {
renderControl(attackingTouch.startX, attackingTouch.startY,
attackingTouch.currentX, attackingTouch.currentY);
}
} // RENDER CONTROL:
function renderControl(startX, startY, currentX, currentY) {
mainContext.save();
mainContext.setTransform(1, 0, 0, 1, 0, 0); //
mainContext.resetTransform();
mainContext.scale(pixelDensity, pixelDensity);
var controlRadius = 50;
mainContext.beginPath();
mainContext.arc(startX, startY, controlRadius, 0, Math.PI * 2, false);
mainContext.closePath();
mainContext.fillStyle = "rgba(255, 255, 255, 0.3)";
mainContext.fill();
var controlRadius = 50;
var offsetX = currentX - startX;
var offsetY = currentY - startY;
var mag = Math.sqrt(Math.pow(offsetX, 2) + Math.pow(offsetY, 2));
var divisor = mag > controlRadius ? mag / controlRadius : 1;
offsetX /= divisor;
offsetY /= divisor;
mainContext.beginPath();
mainContext.arc(startX + offsetX, startY + offsetY, controlRadius *
0.5, 0, Math.PI * 2, false);
mainContext.closePath();
mainContext.fillStyle = "white";
mainContext.fill();
mainContext.restore();
} // RENDER PROJECTILES:
function renderProjectiles(layer, xOffset, yOffset) {
for (var i = 0; i < projectiles.length; ++i) {
tmpObj = projectiles[i];
if (tmpObj.active && tmpObj.layer == layer) {
tmpObj.update(delta);
if (tmpObj.active && isOnScreen(tmpObj.x - xOffset, tmpObj.y -
yOffset, tmpObj.scale)) {
mainContext.save();
mainContext.translate(tmpObj.x - xOffset, tmpObj.y -
yOffset);
mainContext.rotate(tmpObj.dir);
renderProjectile(0, 0, tmpObj, mainContext, 1);
mainContext.restore();
}
}
}
} // RENDER PROJECTILE:
var projectileSprites = {};
mainContext.lineWidth = 6;
renderCircle(0, 0, tmpObj.blocker, mainContext,
false, true);
}
mainContext.restore();
} else {
tmpSprite = getResSprite(tmpObj);
mainContext.drawImage(tmpSprite, tmpX - tmpSprite.width
/ 2, tmpY - tmpSprite.height / 2);
}
}
}
}
} // GATHER ANIMATION:
function gatherAnimation(sid, didHit, index) {
tmpObj = findPlayerBySID(sid);
if (tmpObj) tmpObj.startAnim(didHit, index);
if (player.skinIndex != 6) storeEquip(6);
} // RENDER PLAYERS:
function renderPlayers(xOffset, yOffset, zIndex) {
function getResSprite(obj) {
var biomeID = obj.y >= config.mapScale - config.snowBiomeTop ? 2 :
obj.y <= config.snowBiomeTop ? 1 : 0;
var tmpIndex = obj.type + "_" + obj.scale + "_" + biomeID;
var tmpSprite = gameObjectSprites[tmpIndex];
if (!tmpSprite) {
var tmpCanvas = document.createElement('canvas');
tmpCanvas.width = tmpCanvas.height = obj.scale * 2.1 +
outlineWidth;
var tmpContext = tmpCanvas.getContext('2d');
tmpContext.translate(tmpCanvas.width / 2, tmpCanvas.height / 2);
tmpContext.rotate(UTILS.randFloat(0, Math.PI));
tmpContext.strokeStyle = outlineColor;
tmpContext.lineWidth = outlineWidth;
if (obj.type == 0) {
var tmpScale;
for (var i = 0; i < 2; ++i) {
tmpScale = tmpObj.scale * (!i ? 1 : 0.5);
renderStar(tmpContext, 7, tmpScale, tmpScale * 0.7);
tmpContext.fillStyle = !biomeID ? !i ? "#9ebf57" :
"#b4db62" : !i ? "#e3f1f4" : "#fff";
tmpContext.fill();
if (!i) tmpContext.stroke();
}
} else if (obj.type == 1) {
if (biomeID == 2) {
tmpContext.fillStyle = "#606060";
renderStar(tmpContext, 6, obj.scale * 0.3, obj.scale *
0.71);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = "#89a54c";
renderCircle(0, 0, obj.scale * 0.55, tmpContext);
tmpContext.fillStyle = "#a5c65b";
renderCircle(0, 0, obj.scale * 0.3, tmpContext, true);
} else {
renderBlob(tmpContext, 6, tmpObj.scale, tmpObj.scale *
0.7);
tmpContext.fillStyle = biomeID ? "#e3f1f4" : "#89a54c";
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = biomeID ? "#6a64af" : "#c15555";
var tmpRange;
var berries = 4;
var rotVal = mathPI2 / berries;
for (var i = 0; i < berries; ++i) {
tmpRange = UTILS.randInt(tmpObj.scale / 3.5,
tmpObj.scale / 2.3);
renderCircle(tmpRange * Math.cos(rotVal * i), tmpRange
* Math.sin(rotVal * i), UTILS.randInt(10, 12), tmpContext);
}
}
} else if (obj.type == 2 || obj.type == 3) {
tmpContext.fillStyle = obj.type == 2 ? biomeID == 2 ? "#938d77"
: "#939393" : "#e0c655";
renderStar(tmpContext, 3, obj.scale, obj.scale);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = obj.type == 2 ? biomeID == 2 ? "#b2ab90"
: "#bcbcbc" : "#ebdca3";
renderStar(tmpContext, 3, obj.scale * 0.55, obj.scale * 0.65);
tmpContext.fill();
}
tmpSprite = tmpCanvas;
gameObjectSprites[tmpIndex] = tmpSprite;
}
return tmpSprite;
} // GET ITEM SPRITE:
var itemSprites = [];
let nearestDist = 0;
let lastNearestDist = 0;
let nearestDist2 = 0;
let lastNearestDist2 = 0;
function oneTickRange(distance){
let inRangeDist = Math.abs(distance - 239)
if(inRangeDist < 60 && nEy.length && player.pr && player.tr && nEy[9] !
= 6 && nEy[9] != 22){
if(inRangeDist < 5){
io.send("33", null)
otmove2 = true
return true
} else {
if(oneticking && !isinsta && !player.y <= 2400){
if (player.skinIndex != 40) storeEquip(40)
storeEquip(inRangeDist < 20 ? 0:11, 1)
selectToBuild(player.items[2], !0)
let lastMove = otmove
otmove = distance > 239 ? nEA : nEA + Math.PI
io.send("33", otmove)
addFunction(() => {otmove = lastMove},1)
otmove2 = true
return false
}
}
} else {
otmove2 = false
return false
}
}
function place(id, angle){placeObj(id, angle)};
const revShowText = `
Auto-Insta: ${wr}<br>
Damage Prediction: ${'unfinished'}<br>
Turrets That Can Hit You: ${guessTurret.length}<br>
`;
function isally(id) {
for(let i = 0;i < alliancePlayers.length;i+=2){
if(id == alliancePlayers[i]){
return true;
}
}
}
function findPlayerBySID(sid) {
for (var i = 0; i < players.length; ++i) {
if (players[i].sid == sid) {
return players[i];
}
}
return null;
}
function findAIBySID(sid) {
for (var i = 0; i < ais.length; ++i) {
if (ais[i].sid == sid) {
return ais[i];
}
}
return null;
}
function findObjectBySid(sid) {
for (var i = 0; i < gameObjects.length; ++i) {
if (gameObjects[i].sid == sid) {
return gameObjects[i];
}
}
return null;
} // PING:
var lastPing = -1;
function pingSocketResponse() {
var pingTime = Date.now() - lastPing;
window.pingTime = pingTime;
pingDisplay.innerText = "Ping: " + pingTime + " ms";
}
function pingSocket() {
lastPing = Date.now();
io.send("pp");
} // SERVER SHUTDOWN NOTICE:
function serverShutdownNotice(countdown) {
if (countdown < 0) return;
var minutes = Math.floor(countdown / 60);
var seconds = countdown % 60;
seconds = ("0" + seconds).slice(-2);
shutdownDisplay.innerText = "Server restarting in " + minutes + ":" +
seconds;
shutdownDisplay.hidden = false;
} // UPDATE & ANIMATE:
window.requestAnimFrame = function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
function(callback) {
window.setTimeout(()=>{
callback()
}, 1000 / 60);
};
}();
function doUpdate() {
now = Date.now();
delta = now - lastUpdate;
lastUpdate = now;
updateGame();
requestAnimFrame(doUpdate);
} // START GAME:
function startGame() {
bindEvents();
loadIcons();
loadingText.style.display = "none";
menuCardHolder.style.display = "block";
nameInput.value = getSavedVal("moo_name") || "";
prepareUI();
}
prepareMenuBackground();
doUpdate(); // OPEN LINK:
function openLink(link) {
window.open(link, "_blank");
} // EXPORT VALUES:
window.openLink = openLink;
window.aJoinReq = aJoinReq;
window.follmoo = follmoo;
window.kickFromClan = kickFromClan;
window.sendJoin = sendJoin;
window.leaveAlliance = leaveAlliance;
window.createAlliance = createAlliance;
window.storeBuy = storeBuy;
window.storeEquip = storeEquip;
window.showItemInfo = showItemInfo;
window.selectSkinColor = selectSkinColor;
window.changeStoreIndex = changeStoreIndex;
window.config = config; /***/
},
/***/ "./src/js/config.js":
/*!**************************!*\
!*** ./src/js/config.js ***!
\**************************/
/*! no static exports found */ /***/ function(module, exports,
__webpack_require__) {
/* WEBPACK VAR INJECTION */
(function(process) { // RENDER:
module.exports.maxScreenWidth = 1920 / 1.1;
module.exports.maxScreenHeight = 1080 / 1.1; // SERVER:
module.exports.serverUpdateRate = 9;
module.exports.maxPlayers = process && process.argv.indexOf("--
largeserver") != -1 ? 80 : 40 + 100000000;
module.exports.maxPlayersHard = module.exports.maxPlayers +
100000000000000000;
module.exports.collisionDepth = 6;
module.exports.minimapRate = 3000; // COLLISIONS:
module.exports.colGrid = 10; // CLIENT:
module.exports.clientSendRate = 5; // UI:
module.exports.healthBarWidth = 50;
module.exports.healthBarPad = 4.5;
module.exports.iconPadding = 15;
module.exports.iconPad = 0.9;
module.exports.deathFadeout = 3000;
module.exports.crownIconScale = 60;
module.exports.crownPad = 35; // CHAT:
module.exports.chatCountdown = 3000;
module.exports.chatCooldown = 500; // SANDBOX:
module.exports.inSandbox = process && process.env.VULTR_SCHEME ===
"mm_exp";; // PLAYER:
module.exports.maxAge = 100;
module.exports.gatherAngle = Math.PI;
module.exports.gatherWiggle = 10;
module.exports.hitReturnRatio = 0.25;
module.exports.hitAngle = Math.PI;
module.exports.playerScale = 35;
module.exports.playerSpeed = 0.0016;
module.exports.playerDecel = 0.993;
module.exports.nameY = 34; // CUSTOMIZATION:
module.exports.skinColors = ["#bf8f54", "#cbb091", "#896c4b",
"#fadadc", "#ececec", "#c37373", "#4c4c4c", "#ecaff7", "#738cc3", "#8bc373"]; //
ANIMALS:
module.exports.animalCount = 7;
module.exports.aiTurnRandom = 0.06;
module.exports.cowNames = ["Sid", "Steph", "Bmoe", "Romn",
"Jononthecool", "Fiona", "Vince", "Nathan", "Nick", "Flappy", "Ronald", "Otis",
"Pepe", "Mc Donald", "Theo", "Fabz", "Oliver", "Jeff", "Jimmy", "Helena", "Reaper",
"Ben", "Alan", "Naomi", "XYZ", "Clever", "Jeremy", "Mike", "Destined", "Stallion",
"Allison", "Meaty", "Sophia", "Vaja", "Joey", "Pendy", "Murdoch", "Theo", "Jared",
"July", "Sonia", "Mel", "Dexter", "Quinn", "Milky"]; // WEAPONS:
module.exports.shieldAngle = Math.PI / 3;
module.exports.weaponVariants = [{
id: 0,
src: "",
xp: 0,
val: 1
}, {
id: 1,
src: "_g",
xp: 3000,
val: 1.1
}, {
id: 2,
src: "_d",
xp: 7000,
val: 1.18
}, {
id: 3,
src: "_r",
poison: true,
xp: 12000,
val: 1.18
}];
module.exports.fetchVariant = function(player) {
var tmpXP = player.weaponXP[player.weaponIndex] || 0;
for (var i = module.exports.weaponVariants.length - 1; i >= 0; --i)
{
if (tmpXP >= module.exports.weaponVariants[i].xp) return
module.exports.weaponVariants[i];
}
}; // NATURE:
module.exports.resourceTypes = ["wood", "food", "stone", "points"];
module.exports.areaCount = 7;
module.exports.treesPerArea = 9;
module.exports.bushesPerArea = 3;
module.exports.totalRocks = 32;
module.exports.goldOres = 7;
module.exports.riverWidth = 724;
module.exports.riverPadding = 114;
module.exports.waterCurrent = 0.0011;
module.exports.waveSpeed = 0.0001;
module.exports.waveMax = 1.3;
module.exports.treeScales = [150, 160, 165, 175];
module.exports.bushScales = [80, 85, 95];
module.exports.rockScales = [80, 85, 90]; // BIOME DATA:
module.exports.snowBiomeTop = 2400;
module.exports.snowSpeed = 0.75; // DATA:
module.exports.maxNameLength = 15; // MAP:
module.exports.mapScale = 14400;
module.exports.mapPingScale = 40;
module.exports.mapPingTime = 2200; /* WEBPACK VAR INJECTION */
}).call(this, __webpack_require__( /*!
./../../node_modules/process/browser.js */
"./node_modules/process/browser.js")); /***/
},
/***/ "./src/js/data/ai.js":
/*!***************************!*\
!*** ./src/js/data/ai.js ***!
\***************************/
/*! no static exports found */ /***/ function(module, exports) {
var PI2 = Math.PI * 2;
module.exports = function(sid, objectManager, players, items, UTILS,
config, scoreCallback, server) {
this.sid = sid;
this.isAI = true;
this.nameIndex = UTILS.randInt(0, config.cowNames.length - 1); // INIT:
this.init = function(x, y, dir, index, data) {
this.x = x;
this.y = y;
this.startX = data.fixedSpawn ? x : null;
this.startY = data.fixedSpawn ? y : null;
this.xVel = 0;
this.yVel = 0;
this.zIndex = 0;
this.dir = dir;
this.dirPlus = 0;
this.index = index;
this.src = data.src;
if (data.name) this.name = data.name;
this.weightM = data.weightM;
this.speed = data.speed;
this.killScore = data.killScore;
this.turnSpeed = data.turnSpeed;
this.scale = data.scale;
this.maxHealth = data.health;
this.leapForce = data.leapForce;
this.health = this.maxHealth;
this.chargePlayer = data.chargePlayer;
this.viewRange = data.viewRange;
this.drop = data.drop;
this.dmg = data.dmg;
this.hostile = data.hostile;
this.dontRun = data.dontRun;
this.hitRange = data.hitRange;
this.hitDelay = data.hitDelay;
this.hitScare = data.hitScare;
this.spriteMlt = data.spriteMlt;
this.nameScale = data.nameScale;
this.colDmg = data.colDmg;
this.noTrap = data.noTrap;
this.spawnDelay = data.spawnDelay;
this.hitWait = 0;
this.waitCount = 1000;
this.moveCount = 0;
this.targetDir = 0;
this.active = true;
this.alive = true;
this.runFrom = null;
this.chargeTarget = null;
this.dmgOverTime = {};
}; // UPDATE:
var timerCount = 0;
this.update = function(delta) {
if (this.active) { // SPAWN DELAY:
if (this.spawnCounter) {
this.spawnCounter -= delta;
if (this.spawnCounter <= 0) {
this.spawnCounter = 0;
this.x = this.startX || UTILS.randInt(0,
config.mapScale);
this.y = this.startY || UTILS.randInt(0,
config.mapScale);
}
return;
} // REGENS AND AUTO:
timerCount -= delta;
if (timerCount <= 0) {
if (this.dmgOverTime.dmg) {
this.changeHealth(-this.dmgOverTime.dmg,
this.dmgOverTime.doer);
this.dmgOverTime.time -= 1;
if (this.dmgOverTime.time <= 0) this.dmgOverTime.dmg =
0;
}
timerCount = 1000;
} // BEHAVIOUR:
var charging = false;
var slowMlt = 1;
if (!this.zIndex && !this.lockMove && this.y >= config.mapScale
/ 2 - config.riverWidth / 2 && this.y <= config.mapScale / 2 + config.riverWidth /
2) {
slowMlt = 0.33;
this.xVel += config.waterCurrent * delta;
}
if (this.lockMove) {
this.xVel = 0;
this.yVel = 0;
} else if (this.waitCount > 0) {
this.waitCount -= delta;
if (this.waitCount <= 0) {
if (this.chargePlayer) {
var tmpPlayer, bestDst, tmpDist;
for (var i = 0; i < players.length; ++i) {
if (players[i].alive && !(players[i].skin &&
players[i].skin.bullRepel)) {
tmpDist = UTILS.getDistance(this.x, this.y,
players[i].x, players[i].y);
if (tmpDist <= this.viewRange && (!
tmpPlayer || tmpDist < bestDst)) {
bestDst = tmpDist;
tmpPlayer = players[i];
}
}
}
if (tmpPlayer) {
this.chargeTarget = tmpPlayer;
this.moveCount = UTILS.randInt(8000, 12000);
} else {
this.moveCount = UTILS.randInt(1000, 2000);
this.targetDir = UTILS.randFloat(-Math.PI,
Math.PI);
}
} else {
this.moveCount = UTILS.randInt(4000, 10000);
this.targetDir = UTILS.randFloat(-Math.PI,
Math.PI);
}
}
} else if (this.moveCount > 0) {
var tmpSpd = this.speed * slowMlt;
if (this.runFrom && this.runFrom.active && !
(this.runFrom.isPlayer && !this.runFrom.alive)) {
this.targetDir = UTILS.getDirection(this.x, this.y,
this.runFrom.x, this.runFrom.y);
tmpSpd *= 1.42;
} else if (this.chargeTarget && this.chargeTarget.alive) {
this.targetDir =
UTILS.getDirection(this.chargeTarget.x, this.chargeTarget.y, this.x, this.y);
tmpSpd *= 1.75;
charging = true;
}
if (this.hitWait) {
tmpSpd *= 0.3;
}
if (this.dir != this.targetDir) {
this.dir %= PI2;
var netAngle = (this.dir - this.targetDir + PI2) % PI2;
var amnt = Math.min(Math.abs(netAngle - PI2), netAngle,
this.turnSpeed * delta);
var sign = netAngle - Math.PI >= 0 ? 1 : -1;
this.dir += sign * amnt + PI2;
}
this.dir %= PI2;
this.xVel += tmpSpd * delta * Math.cos(this.dir);
this.yVel += tmpSpd * delta * Math.sin(this.dir);
this.moveCount -= delta;
if (this.moveCount <= 0) {
this.runFrom = null;
this.chargeTarget = null;
this.waitCount = this.hostile ? 1500 :
UTILS.randInt(1500, 6000);
}
} // OBJECT COLL:
this.zIndex = 0;
this.lockMove = false;
var tmpList;
var tmpSpeed = UTILS.getDistance(0, 0, this.xVel * delta,
this.yVel * delta);
var depth = Math.min(4, Math.max(1, Math.round(tmpSpeed /
40)));
var tMlt = 1 / depth;
for (var i = 0; i < depth; ++i) {
if (this.xVel) this.x += this.xVel * delta * tMlt;
if (this.yVel) this.y += this.yVel * delta * tMlt;
tmpList = objectManager.getGridArrays(this.x, this.y,
this.scale);
for (var x = 0; x < tmpList.length; ++x) {
for (var y = 0; y < tmpList[x].length; ++y) {
if (tmpList[x][y].active)
objectManager.checkCollision(this, tmpList[x][y], tMlt);
}
}
} // HITTING:
var hitting = false;
if (this.hitWait > 0) {
this.hitWait -= delta;
if (this.hitWait <= 0) {
hitting = true;
this.hitWait = 0;
if (this.leapForce && !UTILS.randInt(0, 2)) {
this.xVel += this.leapForce * Math.cos(this.dir);
this.yVel += this.leapForce * Math.sin(this.dir);
}
var tmpList = objectManager.getGridArrays(this.x,
this.y, this.hitRange);
var tmpObj, tmpDst;
for (var t = 0; t < tmpList.length; ++t) {
for (var x = 0; x < tmpList[t].length; ++x) {
tmpObj = tmpList[t][x];
if (tmpObj.health) {
tmpDst = UTILS.getDistance(this.x, this.y,
tmpObj.x, tmpObj.y);
if (tmpDst < tmpObj.scale + this.hitRange)
{
if (tmpObj.changeHealth(-this.dmg * 5))
objectManager.disableObj(tmpObj);
objectManager.hitObj(tmpObj,
UTILS.getDirection(this.x, this.y, tmpObj.x, tmpObj.y));
}
}
}
}
for (var x = 0; x < players.length; ++x) {
if (players[x].canSee(this)) {
server.send(players[x].id, "aa", this.sid);
}
}
}
} // PLAYER COLLISIONS:
if (charging || hitting) {
var tmpObj, tmpDst, tmpDir;
for (var i = 0; i < players.length; ++i) {
tmpObj = players[i];
if (tmpObj && tmpObj.alive) {
tmpDst = UTILS.getDistance(this.x, this.y,
tmpObj.x, tmpObj.y);
if (this.hitRange) {
if (!this.hitWait && tmpDst <= this.hitRange +
tmpObj.scale) {
if (hitting) {
tmpDir = UTILS.getDirection(tmpObj.x,
tmpObj.y, this.x, this.y);
tmpObj.changeHealth(-this.dmg);
tmpObj.xVel += 0.6 * Math.cos(tmpDir);
tmpObj.yVel += 0.6 * Math.sin(tmpDir);
this.runFrom = null;
this.chargeTarget = null;
this.waitCount = 3000;
this.hitWait = !UTILS.randInt(0, 2) ?
600 : 0;
} else this.hitWait = this.hitDelay;
}
} else if (tmpDst <= this.scale + tmpObj.scale) {
tmpDir = UTILS.getDirection(tmpObj.x, tmpObj.y,
this.x, this.y);
tmpObj.changeHealth(-this.dmg);
tmpObj.xVel += 0.55 * Math.cos(tmpDir);
tmpObj.yVel += 0.55 * Math.sin(tmpDir);
}
}
}
} // DECEL:
if (this.xVel) this.xVel *= Math.pow(config.playerDecel,
delta);
if (this.yVel) this.yVel *= Math.pow(config.playerDecel,
delta); // MAP BOUNDARIES:
var tmpScale = this.scale;
if (this.x - tmpScale < 0) {
this.x = tmpScale;
this.xVel = 0;
} else if (this.x + tmpScale > config.mapScale) {
this.x = config.mapScale - tmpScale;
this.xVel = 0;
}
if (this.y - tmpScale < 0) {
this.y = tmpScale;
this.yVel = 0;
} else if (this.y + tmpScale > config.mapScale) {
this.y = config.mapScale - tmpScale;
this.yVel = 0;
}
}
}; // CAN SEE:
this.canSee = function(other) {
if (!other) return false;
if (other.skin && other.skin.invisTimer && other.noMovTimer >=
other.skin.invisTimer) return false;
var dx = Math.abs(other.x - this.x) - other.scale;
var dy = Math.abs(other.y - this.y) - other.scale;
return dx <= config.maxScreenWidth / 2 * 1.3 && dy <=
config.maxScreenHeight / 2 * 1.3;
};
var tmpRatio = 0;
var animIndex = 0;
this.animate = function(delta) {
if (this.animTime > 0) {
this.animTime -= delta;
if (this.animTime <= 0) {
this.animTime = 0;
this.dirPlus = 0;
tmpRatio = 0;
animIndex = 0;
} else {
if (animIndex == 0) {
tmpRatio += (delta / (this.animSpeed *
config.hitReturnRatio));
this.dirPlus = UTILS.lerp(0, this.targetAngle,
Math.min(2, tmpRatio));
if (tmpRatio >= 1) {
tmpRatio = 1;
animIndex = 1;
}
} else {
tmpRatio -= delta / (this.animSpeed * (1 -
config.hitReturnRatio));
this.dirPlus = UTILS.lerp(0, this.targetAngle,
Math.max(0, tmpRatio));
}
}
}
}; // ANIMATION:
this.startAnim = function() {
this.animTime = this.animSpeed = 600;
this.targetAngle = Math.PI * 0.8;
tmpRatio = 0;
animIndex = 0;
}; // CHANGE HEALTH:
this.changeHealth = function(val, doer, runFrom) {
if (this.active) {
this.health += val;
if (runFrom) {
if (this.hitScare && !UTILS.randInt(0, this.hitScare)) {
this.runFrom = runFrom;
this.waitCount = 0;
this.moveCount = 2000;
} else if (this.hostile && this.chargePlayer &&
runFrom.isPlayer) {
this.chargeTarget = runFrom;
this.waitCount = 0;
this.moveCount = 8000;
} else if (!this.dontRun) {
this.runFrom = runFrom;
this.waitCount = 0;
this.moveCount = 2000;
}
}
if (val < 0 && this.hitRange && UTILS.randInt(0, 1))
this.hitWait = 500;
if (doer && doer.canSee(this) && val < 0) {
server.send(doer.id, "t", Math.round(this.x),
Math.round(this.y), Math.round(-val), 1);
}
if (this.health <= 0) {
if (this.spawnDelay) {
this.spawnCounter = this.spawnDelay;
this.x = -1000000;
this.y = -1000000;
} else {
this.x = this.startX || UTILS.randInt(0,
config.mapScale);
this.y = this.startY || UTILS.randInt(0,
config.mapScale);
}
this.health = this.maxHealth;
this.runFrom = null;
if (doer) {
scoreCallback(doer, this.killScore);
if (this.drop) {
for (var i = 0; i < this.drop.length;) {
function a() {
var e, n, s, a, t, f, l;
for (var c in r)
if (r.hasOwnProperty(c)) {
if (e = [], n = r[c], n.name &&
(e.push(n.name.toLowerCase()), n.options && n.options.aliases &&
n.options.aliases.length))
for (s = 0; s < n.options.aliases.length; s++)
e.push(n.options.aliases[s].toLowerCase());
for (a = o(n.fn, "function") ? n.fn() : n.fn, t = 0; t <
e.length; t++) f = e[t], l = f.split("."), 1 === l.length ? Modernizr[l[0]] = a :
(!Modernizr[l[0]] || Modernizr[l[0]] instanceof Boolean || (Modernizr[l[0]] = new
Boolean(Modernizr[l[0]])), Modernizr[l[0]][l[1]] = a), i.push((a ? "" : "no-") +
l.join("-"));
}
}
function t(e) {
var n = l.className,
s = Modernizr._config.classPrefix || "";
if (c && (n = n.baseVal), Modernizr._config.enableJSClass) {
var o = new RegExp("(^|\\s)" + s + "no-js(\\s|$)");
n = n.replace(o, "$1" + s + "js$2");
}
Modernizr._config.enableClasses && (n += " " + s + e.join(" " + s),
c ? l.className.baseVal = n : l.className = n);
}
var i = [],
r = [],
f = {
_version: "3.5.0",
_config: {
classPrefix: "",
enableClasses: !0,
enableJSClass: !0,
usePrefixes: !0
},
_q: [],
on: function(e, n) {
var s = this;
setTimeout(function() {
n(s[e]);
}, 0);
},
addTest: function(e, n, s) {
r.push({
name: e,
fn: n,
options: s
});
},
addAsyncTest: function(e) {
r.push({
name: null,
fn: e
});
}
},
Modernizr = function() {};
Modernizr.prototype = f, Modernizr = new Modernizr();
var l = n.documentElement,
c = "svg" === l.nodeName.toLowerCase();
Modernizr.addTest("passiveeventlisteners", function() {
var n = !1;
try {
var s = Object.defineProperty({}, "passive", {
get: function() {
n = !0;
}
});
e.addEventListener("test", null, s);
} catch (o) {}
return n;
}), a(), t(i), delete f.addTest, delete f.addAsyncTest;
for (var u = 0; u < Modernizr._q.length; u++) Modernizr._q[u]();
e.Modernizr = Modernizr;
}(window, document); /***/
},
/***/ "./src/js/libs/soundManager.js":
/*!*************************************!*\
!*** ./src/js/libs/soundManager.js ***!
\*************************************/
/*! no static exports found */ /***/ function(module, exports) { // PLAYER
MANAGER:
module.exports.obj = function(config, UTILS) { // INIT:
var tmpSound;
this.sounds = [];
this.active = true; // PLAY SOUND:
this.play = function(id, volume, loop) {
if (!volume || !this.active) return;
tmpSound = this.sounds[id];
if (!tmpSound) {
tmpSound = new Howl({
src: ".././sound/" + id + ".mp3"
});
this.sounds[id] = tmpSound;
}
if (!loop || !tmpSound.isPlaying) {
tmpSound.isPlaying = true;
tmpSound.play();
tmpSound.volume((volume || 1) * config.volumeMult);
tmpSound.loop(loop);
}
}; // TOGGLE MUTE:
this.toggleMute = function(id, mute) {
tmpSound = this.sounds[id];
if (tmpSound) tmpSound.mute(mute);
}; // STOP SOUND:
this.stop = function(id) {
tmpSound = this.sounds[id];
if (tmpSound) {
tmpSound.stop();
tmpSound.isPlaying = false;
}
};
}; /***/
},
/***/ "./src/js/libs/utils.js":
/*!******************************!*\
!*** ./src/js/libs/utils.js ***!
\******************************/
/*! no static exports found */ /***/ function(module, exports) { // MATH UTILS:
var mathABS = Math.abs;
var mathCOS = Math.cos;
var mathSIN = Math.sin;
var mathPOW = Math.pow;
var mathSQRT = Math.sqrt;
var mathABS = Math.abs;
var mathATAN2 = Math.atan2;
var mathPI = Math.PI; // GLOBAL UTILS:
module.exports.randInt = function(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
module.exports.randFloat = function(min, max) {
return Math.random() * (max - min + 1) + min;
};
module.exports.lerp = function(value1, value2, amount) {
return value1 + (value2 - value1) * amount;
};
module.exports.decel = function(val, cel) {
if (val > 0) val = Math.max(0, val - cel);
else if (val < 0) val = Math.min(0, val + cel);
return val;
};
module.exports.getDistance = function(x1, y1, x2, y2) {
return mathSQRT((x2 -= x1) * x2 + (y2 -= y1) * y2);
};
module.exports.getDirection = function(x1, y1, x2, y2) {
return mathATAN2(y1 - y2, x1 - x2);
};
module.exports.getAngleDist = function(a, b) {
var p = mathABS(b - a) % (mathPI * 2);
return p > mathPI ? mathPI * 2 - p : p;
};
module.exports.isNumber = function(n) {
return typeof n == "number" && !isNaN(n) && isFinite(n);
};
module.exports.isString = function(s) {
return s && typeof s == "string";
};
module.exports.kFormat = function(num) {
return num > 999 ? (num / 1000).toFixed(1) + 'k' : num;
};
module.exports.capitalizeFirst = function(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
};
module.exports.fixTo = function(n, v) {
return parseFloat(n.toFixed(v));
};
module.exports.sortByPoints = function(a, b) {
return parseFloat(b.points) - parseFloat(a.points);
};
module.exports.lineInRect = function(recX, recY, recX2, recY2, x1, y1, x2,
y2) {
var minX = x1;
var maxX = x2;
if (x1 > x2) {
minX = x2;
maxX = x1;
}
if (maxX > recX2) maxX = recX2;
if (minX < recX) minX = recX;
if (minX > maxX) return false;
var minY = y1;
var maxY = y2;
var dx = x2 - x1;
if (Math.abs(dx) > 0.0000001) {
var a = (y2 - y1) / dx;
var b = y1 - a * x1;
minY = a * minX + b;
maxY = a * maxX + b;
}
if (minY > maxY) {
var tmp = maxY;
maxY = minY;
minY = tmp;
}
if (maxY > recY2) maxY = recY2;
if (minY < recY) minY = recY;
if (minY > maxY) return false;
return true;
};
module.exports.containsPoint = function(element, x, y) {
var bounds = element.getBoundingClientRect();
var left = bounds.left + window.scrollX;
var top = bounds.top + window.scrollY;
var width = bounds.width;
var height = bounds.height;
var insideHorizontal = x > left && x < left + width;
var insideVertical = y > top && y < top + height;
return insideHorizontal && insideVertical;
};
module.exports.mousifyTouchEvent = function(event) {
var touch = event.changedTouches[0];
event.screenX = touch.screenX;
event.screenY = touch.screenY;
event.clientX = touch.clientX;
event.clientY = touch.clientY;
event.pageX = touch.pageX;
event.pageY = touch.pageY;
};
module.exports.hookTouchEvents = function(element, skipPrevent) {
var preventDefault = !skipPrevent;
var isHovering = false; // var passive =
window.Modernizr.passiveeventlisteners ? {passive: true} : false;
var passive = false;
element.addEventListener("touchstart",
module.exports.checkTrusted(touchStart), passive);
element.addEventListener("touchmove",
module.exports.checkTrusted(touchMove), passive);
element.addEventListener("touchend",
module.exports.checkTrusted(touchEnd), passive);
element.addEventListener("touchcancel",
module.exports.checkTrusted(touchEnd), passive);
element.addEventListener("touchleave",
module.exports.checkTrusted(touchEnd), passive);
function touchStart(e) {
module.exports.mousifyTouchEvent(e);
window.setUsingTouch(true);
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
if (element.onmouseover) element.onmouseover(e);
isHovering = true;
}
function touchMove(e) {
module.exports.mousifyTouchEvent(e);
window.setUsingTouch(true);
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
if (module.exports.containsPoint(element, e.pageX, e.pageY)) {
if (!isHovering) {
if (element.onmouseover) element.onmouseover(e);
isHovering = true;
}
} else {
if (isHovering) {
if (element.onmouseout) element.onmouseout(e);
isHovering = false;
}
}
}
function touchEnd(e) {
module.exports.mousifyTouchEvent(e);
window.setUsingTouch(true);
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
if (isHovering) {
if (element.onclick) element.onclick(e);
if (element.onmouseout) element.onmouseout(e);
isHovering = false;
}
}
};
module.exports.removeAllChildren = function(element) {
while (element.hasChildNodes()) {
element.removeChild(element.lastChild);
}
};
module.exports.generateElement = function(config) {
var element = document.createElement(config.tag || "div");
function generateServerList(regions) {
var servers = [];
for (var region in regions) {
var regionServers = regions[region];
for (var i = 0; i < regionServers.length; i++) {
servers.push({
ip: region + ":" + i,
scheme: "testing",
region: region,
index: i,
games: regionServers[i].map(p => {
return {
playerCount: p,
isPrivate: false
};
})
});
}
}
return servers;
} // Test 1
var maxPlayers = 5;
var client1 = new VultrClient("test.io", -1, maxPlayers, 1, false);
var lastError = undefined;
client1.errorCallback = function(error) {
lastError = error;
};
client1.processServers(generateServerList({
1: [
[0, 0, 0, 0],
[0, 0, 0, 0]
],
2: [
[maxPlayers, 1, 0, 0],
[0, 0, 0, 0]
],
3: [
[maxPlayers, 0, 1, maxPlayers],
[0, 0, 0, 0]
],
4: [
[maxPlayers, 1, 1, maxPlayers],
[1, 0, 0, 0]
],
5: [
[maxPlayers, 1, 1, maxPlayers],
[1, 0, maxPlayers - 1, 0]
],
6: [
[maxPlayers, maxPlayers, maxPlayers, maxPlayers],
[2, 3, 1, 4]
],
7: [
[maxPlayers, maxPlayers, maxPlayers, maxPlayers],
[maxPlayers, maxPlayers, maxPlayers, maxPlayers]
]
}));
assert(client1.seekServer(1, false), [1, 0, 0]);
assert(client1.seekServer(1, true), [1, 1, 3]);
assert(client1.seekServer(2, false), [2, 0, 1]);
assert(client1.seekServer(2, true), [2, 1, 3]);
assert(client1.seekServer(3, false), [3, 0, 2]);
assert(client1.seekServer(3, true), [3, 1, 3]);
assert(client1.seekServer(4, false), [4, 0, 1]);
assert(client1.seekServer(4, true), [4, 1, 3]);
assert(client1.seekServer(5, false), [5, 1, 2]);
assert(client1.seekServer(5, true), [5, 1, 3]);
assert(client1.seekServer(6, false), [6, 1, 3]);
assert(client1.seekServer(6, true), undefined);
assert(client1.seekServer(7, false), undefined);
assert(client1.seekServer(7, true), undefined);
console.log("Tests passed.");
}; // FLATMAP:
var concat = function(x, y) {
return x.concat(y);
};
var flatMap = function(f, xs) {
return xs.map(f).reduce(concat, []);
};
Array.prototype.flatMap = function(f) {
return flatMap(f, this);
};
module.exports = VultrClient; /***/
} /******/
});