diff --git a/css/styles.css b/css/styles.css index 17bece173..f872a53d6 100644 --- a/css/styles.css +++ b/css/styles.css @@ -155,10 +155,18 @@ a:link, a:visited { padding: 5px; margin: 5px; border: 1px solid #333333; - pointer-events: none; cursor: default; } +.a-link-button-inactive:hover .tooltiptext, +.a-link-button-inactive:hover .tooltiptexthigh, +.a-link-button-inactive:hover .tooltiptextleft { + visibility: visible; +} + +.a-link-button-inactive:active { + pointer-events: none; +} /* Notification icon (for create program right now only) */ #create-program-tab { @@ -332,6 +340,7 @@ a:link, a:visited { top:0px; -webkit-animation:status-text 3s 1; background-color: transparent; + height: 15%; } #status-text-container { diff --git a/css/terminal.css b/css/terminal.css index c22100b9c..76fb71737 100644 --- a/css/terminal.css +++ b/css/terminal.css @@ -43,3 +43,15 @@ -webkit-hyphens: auto; -moz-hyphens: auto; } + +#terminal-input-td { + display: flex; +} + +#terminal-input-header { + white-space: pre; +} + +#terminal-input-text-box { + flex: 1 1 auto; +} diff --git a/dist/bundle.js b/dist/bundle.js index 5e9444919..83ec8ed29 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -137,9 +137,9 @@ function PlayerObject() { this.intelligence = 0; //Hacking multipliers - this.hacking_chance_mult = 1; //Increase through ascensions/augmentations - this.hacking_speed_mult = 1; //Decrease through ascensions/augmentations - this.hacking_money_mult = 1; //Increase through ascensions/augmentations. Can't go above 1 + this.hacking_chance_mult = 1; + this.hacking_speed_mult = 1; + this.hacking_money_mult = 1; this.hacking_grow_mult = 1; //Experience and multipliers @@ -781,11 +781,10 @@ PlayerObject.prototype.finishWork = function(cancelled, sing=false) { var mainMenu = document.getElementById("mainmenu-container"); mainMenu.style.visibility = "visible"; this.isWorking = false; - //Engine.loadTerminalContent(); __WEBPACK_IMPORTED_MODULE_7__engine_js__["Engine"].loadLocationContent(); if (sing) { - return "You worked a short shift of " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["b" /* convertTimeMsToTimeElapsedString */])(this.timeWorked) + " and " + + var res = "You worked a short shift of " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["b" /* convertTimeMsToTimeElapsedString */])(this.timeWorked) + " and " + "earned $" + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workMoneyGained, 2) + ", " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workRepGained, 4) + " reputation, " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workHackExpGained, 4) + " hacking exp, " + @@ -794,7 +793,10 @@ PlayerObject.prototype.finishWork = function(cancelled, sing=false) { Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workDexExpGained, 4) + " dexterity exp, " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workAgiExpGained, 4) + " agility exp, and " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workChaExpGained, 4) + " charisma exp."; + this.resetWorkStatus(); + return res; } + this.resetWorkStatus(); } PlayerObject.prototype.startWork = function() { @@ -856,9 +858,17 @@ PlayerObject.prototype.work = function(numCycles) { return; } + var comp = __WEBPACK_IMPORTED_MODULE_2__Company_js__["a" /* Companies */][this.companyName], companyRep = "0"; + if (comp == null || !(comp instanceof __WEBPACK_IMPORTED_MODULE_2__Company_js__["b" /* Company */])) { + console.log("ERROR: Could not find Company: " + this.companyName); + } else { + companyRep = comp.playerReputation; + } + var txt = document.getElementById("work-in-progress-text"); txt.innerHTML = "You are currently working as a " + this.companyPosition.positionName + - " at " + this.companyName + "

" + + " at " + this.companyName + " (Current Company Reputation: " + + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(companyRep, 0) + ")

" + "You have been working for " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["b" /* convertTimeMsToTimeElapsedString */])(this.timeWorked) + "

" + "You have earned:

" + "$" + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workMoneyGained, 2) + " ($" + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workMoneyGainRate * cyclesPerSec, 2) + " / sec)

" + @@ -975,10 +985,9 @@ PlayerObject.prototype.finishWorkPartTime = function(sing=false) { var mainMenu = document.getElementById("mainmenu-container"); mainMenu.style.visibility = "visible"; this.isWorking = false; - //Engine.loadTerminalContent(); __WEBPACK_IMPORTED_MODULE_7__engine_js__["Engine"].loadLocationContent(); if (sing) { - return "You worked for " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["b" /* convertTimeMsToTimeElapsedString */])(this.timeWorked) + " and " + + var res = "You worked for " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["b" /* convertTimeMsToTimeElapsedString */])(this.timeWorked) + " and " + "earned a total of " + "$" + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workMoneyGained, 2) + ", " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workRepGained, 4) + " reputation, " + @@ -988,7 +997,10 @@ PlayerObject.prototype.finishWorkPartTime = function(sing=false) { Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workDexExpGained, 4) + " dexterity exp, " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workAgiExpGained, 4) + " agility exp, and " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workChaExpGained, 4) + " charisma exp"; + this.resetWorkStatus(); + return res; } + this.resetWorkStatus(); } /* Working for Faction */ @@ -1019,11 +1031,10 @@ PlayerObject.prototype.finishFactionWork = function(cancelled, sing=false) { this.isWorking = false; - //Engine.loadTerminalContent(); __WEBPACK_IMPORTED_MODULE_7__engine_js__["Engine"].loadFactionContent(); Object(__WEBPACK_IMPORTED_MODULE_8__Faction_js__["c" /* displayFactionContent */])(faction.name); if (sing) { - return "You worked for your faction " + faction.name + " for a total of " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["b" /* convertTimeMsToTimeElapsedString */])(this.timeWorked) + ". " + + var res="You worked for your faction " + faction.name + " for a total of " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["b" /* convertTimeMsToTimeElapsedString */])(this.timeWorked) + ". " + "You earned " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workRepGained, 4) + " rep, " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workHackExpGained, 4) + " hacking exp, " + @@ -1032,7 +1043,10 @@ PlayerObject.prototype.finishFactionWork = function(cancelled, sing=false) { Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workDexExpGained, 4) + " dex exp, " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workAgiExpGained, 4) + " agi exp, and " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workChaExpGained, 4) + " cha exp."; + this.resetWorkStatus(); + return res; } + this.resetWorkStatus(); } PlayerObject.prototype.startFactionWork = function(faction) { @@ -1350,6 +1364,7 @@ PlayerObject.prototype.finishCreateProgramWork = function(cancelled, sing=false) this.isWorking = false; __WEBPACK_IMPORTED_MODULE_7__engine_js__["Engine"].loadTerminalContent(); + this.resetWorkStatus(); } /* Studying/Taking Classes */ @@ -1504,8 +1519,8 @@ PlayerObject.prototype.finishClass = function(sing=false) { this.isWorking = false; __WEBPACK_IMPORTED_MODULE_7__engine_js__["Engine"].loadLocationContent(); - - if (sing) {return "After " + this.className + " for " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["b" /* convertTimeMsToTimeElapsedString */])(this.timeWorked) + ", " + + if (sing) { + var res="After " + this.className + " for " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["b" /* convertTimeMsToTimeElapsedString */])(this.timeWorked) + ", " + "you spent a total of $" + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workMoneyGained * -1, 2) + ". " + "You earned a total of: " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workHackExpGained, 3) + " hacking exp, " + @@ -1513,7 +1528,11 @@ PlayerObject.prototype.finishClass = function(sing=false) { Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workDefExpGained, 3) + " defense exp, " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workDexExpGained, 3) + " dexterity exp, " + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workAgiExpGained, 3) + " agility exp, and " + - Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workChaExpGained, 3) + " charisma exp";} + Object(__WEBPACK_IMPORTED_MODULE_21__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.workChaExpGained, 3) + " charisma exp"; + this.resetWorkStatus(); + return res; + } + this.resetWorkStatus(); } //The EXP and $ gains are hardcoded. Time is in ms @@ -1687,6 +1706,7 @@ PlayerObject.prototype.finishCrime = function(cancelled) { var mainMenu = document.getElementById("mainmenu-container"); mainMenu.style.visibility = "visible"; this.isWorking = false; + this.resetWorkStatus(); __WEBPACK_IMPORTED_MODULE_7__engine_js__["Engine"].loadLocationContent(); } @@ -2599,7 +2619,7 @@ function removeChildrenFromElement(el) { } } -function createElement(type, params) { +function createElement(type, params={}) { var el = document.createElement(type); if (params.id) {el.id = params.id;} if (params.class) {el.className = params.class;} @@ -2789,6 +2809,7 @@ let CONSTANTS = { //NeuroFlux Governor cost multiplier as you level up NeuroFluxGovernorLevelMult: 1.14, + /* Netscript Constants */ //RAM Costs for different commands ScriptWhileRamCost: 0.2, ScriptForRamCost: 0.2, @@ -2830,6 +2851,8 @@ let CONSTANTS = { MultithreadingRAMCost: 1, + NumNetscriptPorts: 20, + //Server constants ServerBaseGrowthRate: 1.03, //Unadjusted Growth rate ServerMaxGrowthRate: 1.0035, //Maximum possible growth rate (max rate accounting for server security) @@ -3886,38 +3909,39 @@ let CONSTANTS = { "World Stock Exchange account and TIX API Access
", LatestUpdate: - "v0.34.5
" + + "v0.35.0
" + + "-Minor rebalancing of BitNodes due to the fact that Corporations provide a (relatively) new method of " + + "progressing
" + "-Corporation Management Changes:
" + - "---Market Research unlocks are now cheaper
" + - "---New 'VeChain' upgrade: displays useful statistics about Corporation
" + - "---Corporation cycles are processed 25% faster
" + - "---Corporation valuation was lowered by ~10% (this affects stock price and investments)
" + - "---Rebalanced the effects of advertising. Should now be more effective for every Industry
" + - "---Fixed several bugs/exploits involving selling and buying back stock shares
" + - "---You will now receive a Corporation Handbook (.lit file) when starting out BitNode-3. It contains a brief guide to help you get started. " + - "This same handbook can be viewed from the Corporation management screen
" + - "---Slightly decreased the amount by which a Product's sell price can be marked up
" + - "---Employees can now be assigned to a 'Training' task, during which they will slowly increase several of their stats
" + - "-Hopefully fixed an exploit with Array.forEach(). If there are any issues with using forEach, let me know
" + - "-Arguments passed into a script are now passed by value. This means modifying the 'args' array in a script " + - "should no longer cause issues
" + - "-Scripts executed programatically (via run(), exec(), etc.) will now fail if null/undefined is passed in " + - "as an argument
" + - "-Added peek() Netscript function
" + - "-killall() Netscript function now returns true if any scripts were killed, and false otherwise.
" + - "-hack() Netscript function now returns the amount of money gained for successful hacks, and 0 for failed hacks
" + - "-scp Terminal command and Netscript function now work for txt files
" + - "-Changes courtesy of Wraithan:
" + - "---Text files are now displayed using 'pre' rather than 'p' elements when using the 'cat' Terminal command. " + - "This means tabs are retained and lines don't automatically wrap
" + - "---ls() Netscript function now returns text files as well
" + - "-Removed round() Netscript function, since you can just use Math.round() instead
" + - "-Added disableLog() and enableLog() Netscript functions
" + - "-Removed the 'log' argument from sleep(), since you can now use the new disableLog function
" + - "-'Netscript Documentation' button on script editor now points to new readthedocs documentation rather than wiki
" + - "-When working for a faction, your current faction reputation is now displayed
" + - "-Bug Fix: Hacking Missions should no longer break when dragging an existing connection to another Node
" + - "-Bug Fix: Fixed RAM usage of getNextHacknetNodeCost() (is not 1.5GB instead of 4GB)
" + "---Once your Corporation gets big/powerful enough, you can now bribe Factions for reputation using company funds an/or stock shares
" + + "---You can now only create one Division for every Industry type
" + + "---Added several new UI/UX elements
" + + "---Wilson Analytics multiplier was significantly reduced to 1% per level (additive).
" + + "---Reduced the effect of Advert Inc upgrade. Advert Inc. upgrade price increases faster
" + + "---Materials can now be marked up at higher prices
" + + "-Added Javascript's built-in Number object to Netscript
" + + "-Added getCharacterInformation(), getCompanyFavor(), and getFactionFavor() Netscript Singularity functions
" + + "-Rebalanced Singularity Function RAM Costs. They now cost x8 as much when outside of BN-4 (rather than x10). Also, " + + "many of the functions now use significantly less RAM
" + + "-Refactored Netscript Ports. You can now get a handle for a Netscript port using the " + + "getPortHandle() Netscript function. This allows you to access a port's underlying queue (which is just an array) and also " + + "makes several new functions available such as tryWrite(), full(), and empty().
" + + "-Number of Netscript Ports increased from 10 to 20
" + + "-Netscript assignments should now return proper values. i.e. i = 5 should return 5.
" + + "-Added throw statements to Netscript. It's not super useful since 'catch' isn't implemented, but it can be used " + + "to generate custom runtime error messages.
" + + "-Added import declaration to Netscript. With this, you are able to import functions (and only functions) from " + + "other files. Using export declarations is not necessary
" + + "-Most Netscript Runtime errors (the ones that cause your script to crash) should now include the line number where the error occured
" + + "-When working for a company, your current company reputation is now displayed
" + + "-Whenever you get a Faction Invite it will be immediately appended to your 'invited factions' list. " + + "Therefore the checkFactionInvitations() Singularity Function should now be properly useable since you no longer " + + "need to decline a Faction Invitation before it shows up in the result.
" + + "-Bug Fix: When purchasing servers, whitespace should now automatically be removed from the hostname
" + + "-Bug Fix: Can no longer have whitespace in the filename of text files created using write()
" + + "-Bug Fix: In Netscript, you can no longer assign a Hacknet Node handle (hacknetnodes[i]) to another value
" + + "-Bug Fix: If you are in the Factions tab when you accept an invitation from a Faction, the page will now properly 'refresh'
" + + "-Bug Fix: Scripts that run recursive functions should now be killed properly
" } @@ -4129,7 +4153,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__Player_js__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__Prestige_js__ = __webpack_require__(35); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__RedPill_js__ = __webpack_require__(34); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__SaveObject_js__ = __webpack_require__(74); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__SaveObject_js__ = __webpack_require__(75); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__Script_js__ = __webpack_require__(18); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__Server_js__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__Settings_js__ = __webpack_require__(15); @@ -4360,7 +4384,7 @@ let Engine = { editor.setValue(code); } editor.focus(); - Object(__WEBPACK_IMPORTED_MODULE_27__Script_js__["f" /* updateScriptEditorContent */])(); + Object(__WEBPACK_IMPORTED_MODULE_27__Script_js__["g" /* updateScriptEditorContent */])(); Engine.currentPage = Engine.Page.ScriptEditor; document.getElementById("create-script-menu-link").classList.add("active"); }, @@ -4377,7 +4401,7 @@ let Engine = { loadHacknetNodesContent: function() { Engine.hideAllContent(); Engine.Display.hacknetNodesContent.style.display = "block"; - Object(__WEBPACK_IMPORTED_MODULE_16__HacknetNode_js__["a" /* displayHacknetNodesContent */])(); + Object(__WEBPACK_IMPORTED_MODULE_16__HacknetNode_js__["b" /* displayHacknetNodesContent */])(); Engine.currentPage = Engine.Page.HacknetNodes; document.getElementById("hacknet-nodes-menu-link").classList.add("active"); }, @@ -4723,7 +4747,7 @@ let Engine = { Engine.sector12LocationsList.style.display = "inline"; //City hall only in BitNode-3/with Source-File 3 - if (__WEBPACK_IMPORTED_MODULE_23__Player_js__["a" /* Player */].bitNodeN === 3 || __WEBPACK_IMPORTED_MODULE_21__NetscriptFunctions_js__["c" /* hasCorporationSF */]) { + if ((__WEBPACK_IMPORTED_MODULE_23__Player_js__["a" /* Player */].bitNodeN === 3 || __WEBPACK_IMPORTED_MODULE_21__NetscriptFunctions_js__["c" /* hasCorporationSF */]) && __WEBPACK_IMPORTED_MODULE_23__Player_js__["a" /* Player */].bitNodeN !== 8) { document.getElementById("sector12-cityhall-li").style.display = "block"; } else { document.getElementById("sector12-cityhall-li").style.display = "none"; @@ -5038,7 +5062,7 @@ let Engine = { Object(__WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["g" /* updateOnlineScriptTimes */])(numCycles); //Hacknet Nodes - Object(__WEBPACK_IMPORTED_MODULE_16__HacknetNode_js__["c" /* processAllHacknetNodeEarnings */])(numCycles); + Object(__WEBPACK_IMPORTED_MODULE_16__HacknetNode_js__["d" /* processAllHacknetNodeEarnings */])(numCycles); }, //Counters for the main event loop. Represent the number of game cycles are required @@ -5090,7 +5114,7 @@ let Engine = { if (Engine.currentPage == Engine.Page.CharacterInfo) { Engine.displayCharacterInfo(); } else if (Engine.currentPage == Engine.Page.HacknetNodes) { - Object(__WEBPACK_IMPORTED_MODULE_16__HacknetNode_js__["e" /* updateHacknetNodesContent */])(); + Object(__WEBPACK_IMPORTED_MODULE_16__HacknetNode_js__["f" /* updateHacknetNodesContent */])(); } else if (Engine.currentPage == Engine.Page.CreateProgram) { Object(__WEBPACK_IMPORTED_MODULE_12__CreateProgram_js__["b" /* displayCreateProgramContent */])(); } @@ -5115,7 +5139,7 @@ let Engine = { if (Engine.currentPage === Engine.Page.Gang) { Object(__WEBPACK_IMPORTED_MODULE_15__Gang_js__["f" /* updateGangContent */])(); } else if (Engine.currentPage === Engine.Page.ScriptEditor) { - Object(__WEBPACK_IMPORTED_MODULE_27__Script_js__["f" /* updateScriptEditorContent */])(); + Object(__WEBPACK_IMPORTED_MODULE_27__Script_js__["g" /* updateScriptEditorContent */])(); } Engine.Counters.updateDisplaysLong = 15; } @@ -5349,7 +5373,7 @@ let Engine = { } //Hacknet Nodes offline progress - var offlineProductionFromHacknetNodes = Object(__WEBPACK_IMPORTED_MODULE_16__HacknetNode_js__["c" /* processAllHacknetNodeEarnings */])(numCyclesOffline); + var offlineProductionFromHacknetNodes = Object(__WEBPACK_IMPORTED_MODULE_16__HacknetNode_js__["d" /* processAllHacknetNodeEarnings */])(numCyclesOffline); //Passive faction rep gain offline Object(__WEBPACK_IMPORTED_MODULE_13__Faction_js__["j" /* processPassiveFactionRepGain */])(numCyclesOffline); @@ -5437,6 +5461,7 @@ let Engine = { } //Initialize labels on game settings Object(__WEBPACK_IMPORTED_MODULE_29__Settings_js__["d" /* setSettingsLabels */])(); + Object(__WEBPACK_IMPORTED_MODULE_27__Script_js__["f" /* scriptEditorInit */])(); __WEBPACK_IMPORTED_MODULE_33__Terminal_js__["a" /* Terminal */].resetTerminalInput(); }, @@ -6009,7 +6034,7 @@ function Server(ip=Object(__WEBPACK_IMPORTED_MODULE_7__utils_IPAddress_js__["a" Server.prototype.setHackingParameters = function(requiredHackingSkill, moneyAvailable, hackDifficulty, serverGrowth) { this.requiredHackingSkill = requiredHackingSkill; if (isNaN(moneyAvailable)) { - this.moneyAvailable = 1000000; + this.moneyAvailable = 1e6; } else { this.moneyAvailable = moneyAvailable * __WEBPACK_IMPORTED_MODULE_0__BitNode_js__["a" /* BitNodeMultipliers */].ServerStartingMoney; } @@ -6881,7 +6906,7 @@ function initBitNodes() { "In this BitNode you can create and manage your own corporation. Running a successful corporation " + "has the potential of generating massive profits. All other forms of income are reduced by 75%. Furthermore:

" + "The price and reputation cost of all Augmentations is tripled
" + - "The starting and maximum amount of money on servers is halved
" + + "The starting and maximum amount of money on servers is reduced by 75%
" + "Server growth rate is reduced by 80%
" + "You will start out with $150b so that you can start your corporation
" + "You now only need 75 reputation with a faction in order to donate to it, rather than 150

" + @@ -6911,6 +6936,7 @@ function initBitNodes() { "The starting money on servers is halved, but the maximum money remains the same
" + "Most methods of earning money now give significantly less
" + "Infiltration gives 50% more reputation and money
" + + "Corporations have 50% lower valuations and are therefore less profitable
" + "Augmentations are more expensive
" + "Hacking experience gain rates are reduced

" + "Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will " + @@ -6955,6 +6981,7 @@ function initBitNodes() { "The growth rate of servers is halved
" + "Weakening a server is twice as effective
" + "Company wages are decreased by 50%
" + + "Corporation valuations are 99% lower and are therefore significantly less profitable
" + "Hacknet Node production is significantly decreased
" + "Crime and Infiltration are more lucrative
" + "Augmentations are twice as expensive

" + @@ -6967,11 +6994,11 @@ function initBitNodes() { "Level 3: 42%"); //Books: Frontera, Shiner - BitNodes["BitNode12"] = new BitNode(12, "Eye of the World", "COMING SOON"); //Become AI + BitNodes["BitNode12"] = new BitNode(12, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes BitNodes["BitNode13"] = new BitNode(13, "", "COMING SOON"); BitNodes["BitNode14"] = new BitNode(14, "", "COMING SOON"); BitNodes["BitNode15"] = new BitNode(15, "", "COMING SOON"); - BitNodes["BitNode16"] = new BitNode(16, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes + BitNodes["BitNode16"] = new BitNode(16, "", "COMING SOON"); BitNodes["BitNode17"] = new BitNode(17, "", "COMING SOON"); BitNodes["BitNode18"] = new BitNode(18, "", "COMING SOON"); BitNodes["BitNode19"] = new BitNode(19, "", "COMING SOON"); @@ -6980,14 +7007,6 @@ function initBitNodes() { BitNodes["BitNode22"] = new BitNode(22, "", "COMING SOON"); BitNodes["BitNode23"] = new BitNode(23, "", "COMING SOON"); BitNodes["BitNode24"] = new BitNode(24, "", "COMING SOON"); - BitNodes["BitNode25"] = new BitNode(25, "", "COMING SOON"); - BitNodes["BitNode26"] = new BitNode(26, "", "COMING SOON"); - BitNodes["BitNode27"] = new BitNode(27, "", "COMING SOON"); - BitNodes["BitNode28"] = new BitNode(28, "", "COMING SOON"); - BitNodes["BitNode29"] = new BitNode(29, "", "COMING SOON"); - BitNodes["BitNode30"] = new BitNode(30, "", "COMING SOON"); - BitNodes["BitNode31"] = new BitNode(31, "", "COMING SOON"); - BitNodes["BitNode32"] = new BitNode(32, "", "COMING SOON"); } let BitNodeMultipliers = { @@ -7018,6 +7037,8 @@ let BitNodeMultipliers = { InfiltrationMoney: 1, InfiltrationRep: 1, + + CorporationValuation: 1, } function initBitNodeMultipliers() { @@ -7045,8 +7066,8 @@ function initBitNodeMultipliers() { BitNodeMultipliers.RepToDonateToFaction = 0.5; BitNodeMultipliers.AugmentationRepCost = 3; BitNodeMultipliers.AugmentationMoneyCost = 3; - BitNodeMultipliers.ServerMaxMoney = 0.50; - BitNodeMultipliers.ServerStartingMoney = 0.50; + BitNodeMultipliers.ServerMaxMoney = 0.25; + BitNodeMultipliers.ServerStartingMoney = 0.25; BitNodeMultipliers.ServerGrowthRate = 0.20; BitNodeMultipliers.ScriptHackMoney = 0.25; BitNodeMultipliers.CompanyWorkMoney = 0.25; @@ -7071,13 +7092,14 @@ function initBitNodeMultipliers() { BitNodeMultipliers.ServerMaxMoney = 2; BitNodeMultipliers.ServerStartingSecurity = 2; BitNodeMultipliers.ServerStartingMoney = 0.5; - BitNodeMultipliers.ScriptHackMoney = 0.2; + BitNodeMultipliers.ScriptHackMoney = 0.15; BitNodeMultipliers.HacknetNodeMoney = 0.2; BitNodeMultipliers.CrimeMoney = 0.5; BitNodeMultipliers.InfiltrationRep = 1.5; BitNodeMultipliers.InfiltrationMoney = 1.5; BitNodeMultipliers.AugmentationMoneyCost = 2; BitNodeMultipliers.HackExpGain = 0.5; + BitNodeMultipliers.CorporationValuation = 0.5; break; case 8: //Ghost of Wall Street BitNodeMultipliers.ScriptHackMoney = 0; @@ -7086,7 +7108,8 @@ function initBitNodeMultipliers() { BitNodeMultipliers.CrimeMoney = 0; BitNodeMultipliers.HacknetNodeMoney = 0; BitNodeMultipliers.InfiltrationMoney = 0; - BitNodeMultipliers.RepToDonateToFaction = 0 + BitNodeMultipliers.RepToDonateToFaction = 0; + BitNodeMultipliers.CorporationValuation = 0; break; case 11: //The Big Crash BitNodeMultipliers.ServerMaxMoney = 0.1; @@ -7099,6 +7122,7 @@ function initBitNodeMultipliers() { BitNodeMultipliers.AugmentationMoneyCost = 2; BitNodeMultipliers.InfiltrationMoney = 2.5; BitNodeMultipliers.InfiltrationRep = 2.5; + BitNodeMultipliers.CorporationValuation = 0.01; break; default: console.log("WARNING: Player.bitNodeN invalid"); @@ -17498,12 +17522,14 @@ return jQuery; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__engine_js__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__NetscriptEnvironment_js__ = __webpack_require__(38); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NetscriptEvaluator_js__ = __webpack_require__(37); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Server_js__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Settings_js__ = __webpack_require__(15); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils_acorn_js__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils_acorn_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__utils_acorn_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_DialogBox_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_HelperFunctions_js__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__NetscriptPort_js__ = __webpack_require__(76); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Server_js__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Settings_js__ = __webpack_require__(15); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_acorn_js__ = __webpack_require__(39); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_acorn_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__utils_acorn_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_HelperFunctions_js__ = __webpack_require__(2); + @@ -17537,23 +17563,15 @@ function WorkerScript(runningScriptObj) { //Returns the server on which the workerScript is running WorkerScript.prototype.getServer = function() { - return __WEBPACK_IMPORTED_MODULE_5__Server_js__["b" /* AllServers */][this.serverIp]; + return __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][this.serverIp]; } //Array containing all scripts that are running across all servers, to easily run them all let workerScripts = []; -let NetscriptPorts = { - Port1: [], - Port2: [], - Port3: [], - Port4: [], - Port5: [], - Port6: [], - Port7: [], - Port8: [], - Port9: [], - Port10: [], +var NetscriptPorts = []; +for (var i = 0; i < __WEBPACK_IMPORTED_MODULE_1__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts; ++i) { + NetscriptPorts.push(new __WEBPACK_IMPORTED_MODULE_5__NetscriptPort_js__["a" /* NetscriptPort */]()); } function prestigeWorkerScripts() { @@ -17575,15 +17593,15 @@ function runScriptsLoop() { var name = workerScripts[i].name; //Free RAM - __WEBPACK_IMPORTED_MODULE_5__Server_js__["b" /* AllServers */][ip].ramUsed -= workerScripts[i].ramUsage; + __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip].ramUsed -= workerScripts[i].ramUsage; //Delete script from Active Scripts Object(__WEBPACK_IMPORTED_MODULE_0__ActiveScriptsUI_js__["b" /* deleteActiveScriptsItem */])(workerScripts[i]); - for (var j = 0; j < __WEBPACK_IMPORTED_MODULE_5__Server_js__["b" /* AllServers */][ip].runningScripts.length; j++) { - if (__WEBPACK_IMPORTED_MODULE_5__Server_js__["b" /* AllServers */][ip].runningScripts[j].filename == name && - Object(__WEBPACK_IMPORTED_MODULE_9__utils_HelperFunctions_js__["d" /* compareArrays */])(__WEBPACK_IMPORTED_MODULE_5__Server_js__["b" /* AllServers */][ip].runningScripts[j].args, workerScripts[i].args)) { - __WEBPACK_IMPORTED_MODULE_5__Server_js__["b" /* AllServers */][ip].runningScripts.splice(j, 1); + for (var j = 0; j < __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip].runningScripts.length; j++) { + if (__WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip].runningScripts[j].filename == name && + Object(__WEBPACK_IMPORTED_MODULE_10__utils_HelperFunctions_js__["d" /* compareArrays */])(__WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip].runningScripts[j].args, workerScripts[i].args)) { + __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip].runningScripts.splice(j, 1); break; } } @@ -17598,11 +17616,11 @@ function runScriptsLoop() { //If it isn't running, start the script if (workerScripts[i].running == false && workerScripts[i].env.stopFlag == false) { try { - var ast = Object(__WEBPACK_IMPORTED_MODULE_7__utils_acorn_js__["parse"])(workerScripts[i].code); - //console.log(ast); + var ast = Object(__WEBPACK_IMPORTED_MODULE_8__utils_acorn_js__["parse"])(workerScripts[i].code, {sourceType:"module"}); + console.log(ast); } catch (e) { console.log("Error parsing script: " + workerScripts[i].name); - Object(__WEBPACK_IMPORTED_MODULE_8__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Syntax ERROR in " + workerScripts[i].name + ":
" + e); + Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Syntax ERROR in " + workerScripts[i].name + ":
" + e); workerScripts[i].env.stopFlag = true; continue; } @@ -17618,7 +17636,7 @@ function runScriptsLoop() { w.scriptRef.log("Script finished running"); }).catch(function(w) { if (w instanceof Error) { - Object(__WEBPACK_IMPORTED_MODULE_8__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Script runtime unknown error. This is a bug please contact game developer"); + Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Script runtime unknown error. This is a bug please contact game developer"); console.log("ERROR: Evaluating workerscript returns an Error. THIS SHOULDN'T HAPPEN: " + w.toString()); return; } else if (w.constructor === Array && w.length === 2 && w[0] === "RETURNSTATEMENT") { @@ -17627,7 +17645,7 @@ function runScriptsLoop() { //TODO maybe do something with this in the future return; } else if (w instanceof WorkerScript) { - if (Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptEvaluator_js__["b" /* isScriptErrorMessage */])(w.errorMessage)) { + if (Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptEvaluator_js__["c" /* isScriptErrorMessage */])(w.errorMessage)) { var errorTextArray = w.errorMessage.split("|"); if (errorTextArray.length != 4) { console.log("ERROR: Something wrong with Error text in evaluator..."); @@ -17638,9 +17656,9 @@ function runScriptsLoop() { var scriptName = errorTextArray[2]; var errorMsg = errorTextArray[3]; - Object(__WEBPACK_IMPORTED_MODULE_8__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Script runtime error:
Server Ip: " + serverIp + + Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Script runtime error:
Server Ip: " + serverIp + "
Script name: " + scriptName + - "
Args:" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_HelperFunctions_js__["j" /* printArray */])(w.args) + "
" + errorMsg); + "
Args:" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_HelperFunctions_js__["j" /* printArray */])(w.args) + "
" + errorMsg); w.scriptRef.log("Script crashed with runtime error"); } else { w.scriptRef.log("Script killed"); @@ -17648,12 +17666,12 @@ function runScriptsLoop() { w.running = false; w.env.stopFlag = true; - } else if (Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptEvaluator_js__["b" /* isScriptErrorMessage */])(w)) { - Object(__WEBPACK_IMPORTED_MODULE_8__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Script runtime unknown error. This is a bug please contact game developer"); + } else if (Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptEvaluator_js__["c" /* isScriptErrorMessage */])(w)) { + Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Script runtime unknown error. This is a bug please contact game developer"); console.log("ERROR: Evaluating workerscript returns only error message rather than WorkerScript object. THIS SHOULDN'T HAPPEN: " + w.toString()); return; } else { - Object(__WEBPACK_IMPORTED_MODULE_8__utils_DialogBox_js__["a" /* dialogBoxCreate */])("An unknown script died for an unknown reason. This is a bug please contact game dev"); + Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("An unknown script died for an unknown reason. This is a bug please contact game dev"); } }); } @@ -17668,12 +17686,15 @@ function runScriptsLoop() { function killWorkerScript(runningScriptObj, serverIp) { for (var i = 0; i < workerScripts.length; i++) { if (workerScripts[i].name == runningScriptObj.filename && workerScripts[i].serverIp == serverIp && - Object(__WEBPACK_IMPORTED_MODULE_9__utils_HelperFunctions_js__["d" /* compareArrays */])(workerScripts[i].args, runningScriptObj.args)) { + Object(__WEBPACK_IMPORTED_MODULE_10__utils_HelperFunctions_js__["d" /* compareArrays */])(workerScripts[i].args, runningScriptObj.args)) { workerScripts[i].env.stopFlag = true; - Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptEvaluator_js__["c" /* killNetscriptDelay */])(workerScripts[i]); - if (workerScripts[i].fnWorker) { - workerScripts[i].fnWorker.env.stopFlag = true; - Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptEvaluator_js__["c" /* killNetscriptDelay */])(workerScripts[i].fnWorker); + Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptEvaluator_js__["d" /* killNetscriptDelay */])(workerScripts[i]); + //Recursively kill all functions + var curr = workerScripts[i]; + while (curr.fnWorker) { + curr.fnWorker.env.stopFlag = true; + Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptEvaluator_js__["d" /* killNetscriptDelay */])(curr.fnWorker); + curr = curr.fnWorker; } return true; } @@ -17696,8 +17717,8 @@ function addWorkerScript(runningScriptObj, server) { * Math.pow(__WEBPACK_IMPORTED_MODULE_1__Constants_js__["a" /* CONSTANTS */].MultithreadingRAMCost, threads-1); var ramAvailable = server.maxRam - server.ramUsed; if (ramUsage > ramAvailable) { - Object(__WEBPACK_IMPORTED_MODULE_8__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Not enough RAM to run script " + runningScriptObj.filename + " with args " + - Object(__WEBPACK_IMPORTED_MODULE_9__utils_HelperFunctions_js__["j" /* printArray */])(runningScriptObj.args) + ". This likely occurred because you re-loaded " + + Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Not enough RAM to run script " + runningScriptObj.filename + " with args " + + Object(__WEBPACK_IMPORTED_MODULE_10__utils_HelperFunctions_js__["j" /* printArray */])(runningScriptObj.args) + ". This likely occurred because you re-loaded " + "the game and the script's RAM usage increased (either because of an update to the game or " + "your changes to the script.)"); return; @@ -17748,17 +17769,20 @@ function updateOnlineScriptTimes(numCycles = 1) { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__BitNode_js__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Constants_js__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__engine_js__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__FactionInfo_js__ = __webpack_require__(50); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__FactionInfo_js__ = __webpack_require__(51); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Location_js__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Missions_js__ = __webpack_require__(28); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Player_js__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Settings_js__ = __webpack_require__(15); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_FactionInvitationBox_js__ = __webpack_require__(73); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_FactionInvitationBox_js__ = __webpack_require__(74); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils_HelperFunctions_js__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils_numeral_min_js__ = __webpack_require__(17); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils_numeral_min_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13__utils_numeral_min_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__ = __webpack_require__(13); + @@ -17782,10 +17806,10 @@ function factionInit() { $('#faction-donate-input').on('input', function() { if (__WEBPACK_IMPORTED_MODULE_3__engine_js__["Engine"].currentPage == __WEBPACK_IMPORTED_MODULE_3__engine_js__["Engine"].Page.Faction) { var val = document.getElementById("faction-donate-input").value; - if (Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["f" /* isPositiveNumber */])(val)) { + if (Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["f" /* isPositiveNumber */])(val)) { var numMoneyDonate = Number(val); document.getElementById("faction-donate-rep-gain").innerHTML = - "This donation will result in " + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(numMoneyDonate/1000000 * __WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].faction_rep_mult, 3) + " reputation gain"; + "This donation will result in " + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(numMoneyDonate/1000000 * __WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].faction_rep_mult, 3) + " reputation gain"; } else { document.getElementById("faction-donate-rep-gain").innerHTML = "This donation will result in 0 reputation gain"; @@ -18204,11 +18228,11 @@ function displayFactionContent(factionName) { var repGain = faction.getFavorGain(); if (repGain.length != 2) {repGain = 0;} repGain = repGain[0]; - document.getElementById("faction-reputation").innerHTML = "Reputation: " + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(faction.playerReputation, 4) + + document.getElementById("faction-reputation").innerHTML = "Reputation: " + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(faction.playerReputation, 4) + "You will earn " + - Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(repGain, 4) + + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(repGain, 4) + " faction favor upon resetting after installing an Augmentation"; - document.getElementById("faction-favor").innerHTML = "Faction Favor: " + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(faction.favor, 4) + + document.getElementById("faction-favor").innerHTML = "Faction Favor: " + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(faction.favor, 4) + "Faction favor increases the rate at which " + "you earn reputation for this faction by 1% per favor. Faction favor " + "is gained whenever you reset after installing an Augmentation. The amount of " + @@ -18251,7 +18275,7 @@ function displayFactionContent(factionName) { newDonateWorkButton.addEventListener("click", function() { var donateAmountVal = document.getElementById("faction-donate-input").value; - if (Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["f" /* isPositiveNumber */])(donateAmountVal)) { + if (Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["f" /* isPositiveNumber */])(donateAmountVal)) { var numMoneyDonate = Number(donateAmountVal); if (__WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].money.lt(numMoneyDonate)) { Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You cannot afford to donate this much money!"); @@ -18260,8 +18284,8 @@ function displayFactionContent(factionName) { __WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].loseMoney(numMoneyDonate); var repGain = numMoneyDonate / 1000000 * __WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].faction_rep_mult; faction.playerReputation += repGain; - Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You just donated $" + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(numMoneyDonate, 2) + " to " + - faction.name + " to gain " + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(repGain, 3) + " reputation"); + Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You just donated $" + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(numMoneyDonate, 2) + " to " + + faction.name + " to gain " + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(repGain, 3) + " reputation"); displayFactionContent(factionName); } else { Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid amount entered!"); @@ -18335,7 +18359,7 @@ function displayFactionContent(factionName) { var gangButton = Object(__WEBPACK_IMPORTED_MODULE_11__utils_HelperFunctions_js__["b" /* clearEventListeners */])("faction-gang-button"); gangButton.addEventListener("click", function() { if (!__WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].inGang()) { - var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), noBtn = Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); + var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), noBtn = Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); yesBtn.innerHTML = "Create Gang"; noBtn.innerHTML = "Cancel"; yesBtn.addEventListener("click", () => { @@ -18343,12 +18367,12 @@ function displayFactionContent(factionName) { if (factionName === "NiteSec" || factionName === "The Black Hand") {hacking = true;} __WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].startGang(factionName, hacking); __WEBPACK_IMPORTED_MODULE_3__engine_js__["Engine"].loadGangContent(); - Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); }); noBtn.addEventListener("click", () => { - Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); }); - Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])("Would you like to create a new Gang with " + factionName + "?

" + + Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])("Would you like to create a new Gang with " + factionName + "?

" + "Note that this will prevent you from creating a Gang with any other Faction until " + "this BitNode is destroyed. There are NO differences between the Factions you can " + "create a Gang with and each of these Factions have all Augmentations available"); @@ -18589,11 +18613,13 @@ function displayFactionAugmentations(factionName) { for (var j = 0; j < __WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].queuedAugmentations.length; ++j) { if (__WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].queuedAugmentations[j].name == aug.name) { owned = true; + break; } } for (var j = 0; j < __WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].augmentations.length; ++j) { if (__WEBPACK_IMPORTED_MODULE_7__Player_js__["a" /* Player */].augmentations[j].name == aug.name) { owned = true; + break; } } @@ -18602,7 +18628,6 @@ function displayFactionAugmentations(factionName) { var aDiv = document.createElement("div"); var aElem = document.createElement("a"); var pElem = document.createElement("p"); - aElem.setAttribute("href", "#"); var req = aug.baseRepRequirement * faction.augmentationRepRequirementMult; var hasPrereqs = hasAugmentationPrereqs(aug); if (!hasPrereqs) { @@ -18614,10 +18639,11 @@ function displayFactionAugmentations(factionName) { pElem.innerHTML = "ALREADY OWNED"; } else if (faction.playerReputation >= req) { aElem.setAttribute("class", "a-link-button"); - pElem.innerHTML = "UNLOCKED - $" + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(aug.baseCost * faction.augmentationPriceMult, 2); + //pElem.innerHTML = "UNLOCKED - $" + formatNumber(aug.baseCost * faction.augmentationPriceMult, 2); + pElem.innerHTML = "UNLOCKED - " + __WEBPACK_IMPORTED_MODULE_13__utils_numeral_min_js___default()(aug.baseCost * faction.augmentationPriceMult).format("$0.000a"); } else { aElem.setAttribute("class", "a-link-button-inactive"); - pElem.innerHTML = "LOCKED (Requires " + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(req, 1) + " faction reputation) - $" + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(aug.baseCost * faction.augmentationPriceMult, 2); + pElem.innerHTML = "LOCKED (Requires " + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(req, 1) + " faction reputation) - " + __WEBPACK_IMPORTED_MODULE_13__utils_numeral_min_js___default()(aug.baseCost * faction.augmentationPriceMult).format("$0.000a"); pElem.style.color = "red"; } aElem.style.display = "inline"; @@ -18648,20 +18674,20 @@ function displayFactionAugmentations(factionName) { } function purchaseAugmentationBoxCreate(aug, fac) { - var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), noBtn = Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); + var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), noBtn = Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); yesBtn.innerHTML = "Purchase"; noBtn.innerHTML = "Cancel"; yesBtn.addEventListener("click", function() { purchaseAugmentation(aug, fac); }); noBtn.addEventListener("click", function() { - Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); }); - Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])("

" + aug.name + "


" + + Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])("

" + aug.name + "


" + aug.info + "

" + "
Would you like to purchase the " + aug.name + " Augmentation for $" + - Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(aug.baseCost * fac.augmentationPriceMult, 2) + "?"); + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(aug.baseCost * fac.augmentationPriceMult, 2) + "?"); } //Returns a boolean indicating whether the player has the prerequisites for the @@ -18749,7 +18775,7 @@ function purchaseAugmentation(aug, fac, sing=false) { Object(__WEBPACK_IMPORTED_MODULE_9__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough money to purchase this Augmentation!"); } } - Object(__WEBPACK_IMPORTED_MODULE_14__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + Object(__WEBPACK_IMPORTED_MODULE_15__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); } function getNextNeurofluxLevel() { @@ -18805,10 +18831,10 @@ function processPassiveFactionRepGain(numCycles) { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Constants_js__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Crimes_js__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__engine_js__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Infiltration_js__ = __webpack_require__(51); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Infiltration_js__ = __webpack_require__(52); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Player_js__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Server_js__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ServerPurchases_js__ = __webpack_require__(72); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__ServerPurchases_js__ = __webpack_require__(73); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__SpecialServerIps_js__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_DialogBox_js__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils_HelperFunctions_js__ = __webpack_require__(2); @@ -21158,6 +21184,8 @@ let Settings = { ThemeHighlightColor: "#ffffff", ThemeFontColor: "#66ff33", ThemeBackgroundColor: "#000000", + EditorTheme: "Monokai", + EditorKeybinding: "ace", } function loadSettings(saveString) { @@ -21545,30 +21573,31 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @preserve /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return updateScriptEditorContent; }); +/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return updateScriptEditorContent; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return loadAllRunningScripts; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return findRunningScript; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return RunningScript; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return Script; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AllServersMap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return scriptEditorInit; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Constants_js__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__engine_js__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InteractiveTutorial_js__ = __webpack_require__(27); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__NetscriptFunctions_js__ = __webpack_require__(23); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NetscriptWorker_js__ = __webpack_require__(10); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Player_js__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Server_js__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Settings_js__ = __webpack_require__(15); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Terminal_js__ = __webpack_require__(19); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_acorn_js__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_acorn_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9__utils_acorn_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_DialogBox_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__utils_HelperFunctions_js__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__ = __webpack_require__(4); -var ace = __webpack_require__(53); -__webpack_require__(54); -__webpack_require__(75); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__NetscriptEvaluator_js__ = __webpack_require__(37); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NetscriptFunctions_js__ = __webpack_require__(23); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__NetscriptWorker_js__ = __webpack_require__(10); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Player_js__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Server_js__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Settings_js__ = __webpack_require__(15); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__Terminal_js__ = __webpack_require__(19); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_acorn_js__ = __webpack_require__(39); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_acorn_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10__utils_acorn_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils_DialogBox_js__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils_HelperFunctions_js__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__ = __webpack_require__(4); +var ace = __webpack_require__(54); +__webpack_require__(55); __webpack_require__(56); __webpack_require__(57); __webpack_require__(58); @@ -21580,6 +21609,8 @@ __webpack_require__(63); __webpack_require__(64); __webpack_require__(65); __webpack_require__(66); +__webpack_require__(67); + @@ -21611,7 +21642,7 @@ function scriptEditorInit() { console.log("Error finding 'script-editor-buttons-wrapper'"); return; } - var closeButton = Object(__WEBPACK_IMPORTED_MODULE_12__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var closeButton = Object(__WEBPACK_IMPORTED_MODULE_13__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Save & Close (Ctrl + b)", clickListener:()=>{ @@ -21620,11 +21651,11 @@ function scriptEditorInit() { } }); - scriptEditorRamText = Object(__WEBPACK_IMPORTED_MODULE_12__utils_HelperFunctions_js__["f" /* createElement */])("p", { + scriptEditorRamText = Object(__WEBPACK_IMPORTED_MODULE_13__utils_HelperFunctions_js__["f" /* createElement */])("p", { display:"inline-block", margin:"10px", id:"script-editor-status-text" }); - var checkboxLabel = Object(__WEBPACK_IMPORTED_MODULE_12__utils_HelperFunctions_js__["f" /* createElement */])("label", { + var checkboxLabel = Object(__WEBPACK_IMPORTED_MODULE_13__utils_HelperFunctions_js__["f" /* createElement */])("label", { for:"script-editor-ram-check", margin:"4px", marginTop: "8px", innerText:"Dynamic RAM Usage Checker", color:"white", tooltip:"Enable/Disable the dynamic RAM Usage display. You may " + @@ -21632,13 +21663,13 @@ function scriptEditorInit() { "performance issues" }); - scriptEditorRamCheck = Object(__WEBPACK_IMPORTED_MODULE_12__utils_HelperFunctions_js__["f" /* createElement */])("input", { + scriptEditorRamCheck = Object(__WEBPACK_IMPORTED_MODULE_13__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"checkbox", name:"script-editor-ram-check", id:"script-editor-ram-check", margin:"4px", marginTop: "8px", }); scriptEditorRamCheck.checked = true; - var documentationButton = Object(__WEBPACK_IMPORTED_MODULE_12__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var documentationButton = Object(__WEBPACK_IMPORTED_MODULE_13__utils_HelperFunctions_js__["f" /* createElement */])("a", { display:"inline-block", class:"a-link-button", innerText:"Netscript Documentation", href:"https://bitburner.readthedocs.io/en/latest/index.html", target:"_blank" @@ -21660,19 +21691,47 @@ function scriptEditorInit() { /* Script editor options */ //Theme var themeDropdown = document.getElementById("script-editor-option-theme"); - themeDropdown.selectedIndex = 2; + if (__WEBPACK_IMPORTED_MODULE_8__Settings_js__["a" /* Settings */].EditorTheme) { + var initialIndex = 2; + for (var i = 0; i < themeDropdown.options.length; ++i) { + if (themeDropdown.options[i].value === __WEBPACK_IMPORTED_MODULE_8__Settings_js__["a" /* Settings */].EditorTheme) { + initialIndex = i; + break; + } + } + themeDropdown.selectedIndex = initialIndex; + } else { + themeDropdown.selectedIndex = 2; + } + themeDropdown.onchange = function() { var val = themeDropdown.value; + __WEBPACK_IMPORTED_MODULE_8__Settings_js__["a" /* Settings */].EditorTheme = val; var themePath = "ace/theme/" + val.toLowerCase(); editor.setTheme(themePath); }; + themeDropdown.onchange(); //Keybinding var keybindingDropdown = document.getElementById("script-editor-option-keybinding"); + if (__WEBPACK_IMPORTED_MODULE_8__Settings_js__["a" /* Settings */].EditorKeybinding) { + var initialIndex = 0; + for (var i = 0; i < keybindingDropdown.options.length; ++i) { + if (keybindingDropdown.options[i].value === __WEBPACK_IMPORTED_MODULE_8__Settings_js__["a" /* Settings */].EditorKeybinding) { + initialIndex = i; + break; + } + } + keybindingDropdown.selectedIndex = initialIndex; + } else { + keybindingDropdown.selectedIndex = 0; + } keybindingDropdown.onchange = function() { var val = keybindingDropdown.value; + __WEBPACK_IMPORTED_MODULE_8__Settings_js__["a" /* Settings */].EditorKeybinding = val; editor.setKeyboardHandler(keybindings[val.toLowerCase()]); }; + keybindingDropdown.onchange(); //Highlight Active line var highlightActiveChkBox = document.getElementById("script-editor-option-highlightactiveline"); @@ -21724,7 +21783,7 @@ function scriptEditorInit() { getCompletions: function(editor, session, pos, prefix, callback) { if (prefix.length === 0) {callback(null, []); return;} var words = []; - var fns = Object(__WEBPACK_IMPORTED_MODULE_3__NetscriptFunctions_js__["a" /* NetscriptFunctions */])(null); + var fns = Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptFunctions_js__["a" /* NetscriptFunctions */])(null); for (var name in fns) { if (fns.hasOwnProperty(name)) { words.push({ @@ -21738,7 +21797,6 @@ function scriptEditorInit() { } editor.completers = [autocompleter]; } -document.addEventListener("DOMContentLoaded", scriptEditorInit, false); //Updates RAM usage in script function updateScriptEditorContent() { @@ -21751,7 +21809,9 @@ function updateScriptEditorContent() { var codeCopy = code.repeat(1); var ramUsage = calculateRamUsage(codeCopy); if (ramUsage !== -1) { - scriptEditorRamText.innerText = "RAM: " + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(ramUsage, 2).toString() + "GB"; + scriptEditorRamText.innerText = "RAM: " + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(ramUsage, 2).toString() + "GB"; + } else { + scriptEditorRamText.innerText = "RAM: Syntax Error"; } } @@ -21770,35 +21830,35 @@ function saveAndCloseScriptEditor() { var filename = document.getElementById("script-editor-filename").value; if (__WEBPACK_IMPORTED_MODULE_2__InteractiveTutorial_js__["b" /* iTutorialIsRunning */] && __WEBPACK_IMPORTED_MODULE_2__InteractiveTutorial_js__["a" /* currITutorialStep */] == __WEBPACK_IMPORTED_MODULE_2__InteractiveTutorial_js__["e" /* iTutorialSteps */].TerminalTypeScript) { if (filename != "foodnstuff") { - Object(__WEBPACK_IMPORTED_MODULE_10__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Leave the script name as 'foodnstuff'!"); + Object(__WEBPACK_IMPORTED_MODULE_11__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Leave the script name as 'foodnstuff'!"); return; } var editor = ace.edit('javascript-editor'); var code = editor.getValue(); code = code.replace(/\s/g, ""); if (code.indexOf("while(true){hack('foodnstuff');}") == -1) { - Object(__WEBPACK_IMPORTED_MODULE_10__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Please copy and paste the code from the tutorial!"); + Object(__WEBPACK_IMPORTED_MODULE_11__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Please copy and paste the code from the tutorial!"); return; } Object(__WEBPACK_IMPORTED_MODULE_2__InteractiveTutorial_js__["c" /* iTutorialNextStep */])(); } if (filename == "") { - Object(__WEBPACK_IMPORTED_MODULE_10__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You must specify a filename!"); + Object(__WEBPACK_IMPORTED_MODULE_11__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You must specify a filename!"); return; } if (checkValidFilename(filename) == false) { - Object(__WEBPACK_IMPORTED_MODULE_10__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Script filename can contain only alphanumerics, hyphens, and underscores"); + Object(__WEBPACK_IMPORTED_MODULE_11__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Script filename can contain only alphanumerics, hyphens, and underscores"); return; } filename += ".script"; //If the current script already exists on the server, overwrite it - for (var i = 0; i < __WEBPACK_IMPORTED_MODULE_5__Player_js__["a" /* Player */].getCurrentServer().scripts.length; i++) { - if (filename == __WEBPACK_IMPORTED_MODULE_5__Player_js__["a" /* Player */].getCurrentServer().scripts[i].filename) { - __WEBPACK_IMPORTED_MODULE_5__Player_js__["a" /* Player */].getCurrentServer().scripts[i].saveScript(); + for (var i = 0; i < __WEBPACK_IMPORTED_MODULE_6__Player_js__["a" /* Player */].getCurrentServer().scripts.length; i++) { + if (filename == __WEBPACK_IMPORTED_MODULE_6__Player_js__["a" /* Player */].getCurrentServer().scripts[i].filename) { + __WEBPACK_IMPORTED_MODULE_6__Player_js__["a" /* Player */].getCurrentServer().scripts[i].saveScript(); __WEBPACK_IMPORTED_MODULE_1__engine_js__["Engine"].loadTerminalContent(); return; } @@ -21807,7 +21867,7 @@ function saveAndCloseScriptEditor() { //If the current script does NOT exist, create a new one var script = new Script(); script.saveScript(); - __WEBPACK_IMPORTED_MODULE_5__Player_js__["a" /* Player */].getCurrentServer().scripts.push(script); + __WEBPACK_IMPORTED_MODULE_6__Player_js__["a" /* Player */].getCurrentServer().scripts.push(script); __WEBPACK_IMPORTED_MODULE_1__engine_js__["Engine"].loadTerminalContent(); } @@ -21841,7 +21901,7 @@ Script.prototype.saveScript = function() { this.filename = filename; //Server - this.server = __WEBPACK_IMPORTED_MODULE_5__Player_js__["a" /* Player */].currentServer; + this.server = __WEBPACK_IMPORTED_MODULE_6__Player_js__["a" /* Player */].currentServer; //Calculate/update ram usage, execution time, etc. this.updateRamUsage(); @@ -21859,15 +21919,17 @@ Script.prototype.updateRamUsage = function() { function calculateRamUsage(codeCopy) { //Create a temporary/mock WorkerScript and an AST from the code - var workerScript = new __WEBPACK_IMPORTED_MODULE_4__NetscriptWorker_js__["b" /* WorkerScript */]({ + var currServ = __WEBPACK_IMPORTED_MODULE_6__Player_js__["a" /* Player */].getCurrentServer(); + var workerScript = new __WEBPACK_IMPORTED_MODULE_5__NetscriptWorker_js__["b" /* WorkerScript */]({ filename:"foo", scriptRef: {code:""}, args:[] }); workerScript.checkingRam = true; //Netscript functions will return RAM usage + workerScript.serverIp = currServ.ip; try { - var ast = Object(__WEBPACK_IMPORTED_MODULE_9__utils_acorn_js__["parse"])(codeCopy); + var ast = Object(__WEBPACK_IMPORTED_MODULE_10__utils_acorn_js__["parse"])(codeCopy, {sourceType:"module"}); } catch(e) { return -1; } @@ -21879,10 +21941,18 @@ function calculateRamUsage(codeCopy) { while (queue.length != 0) { var exp = queue.shift(); switch (exp.type) { + case "ImportDeclaration": + //Gets an array of all imported functions as AST expressions + //and pushes them on the queue. + var res = Object(__WEBPACK_IMPORTED_MODULE_3__NetscriptEvaluator_js__["b" /* evaluateImport */])(exp, workerScript, true); + for (var i = 0; i < res.length; ++i) { + queue.push(res[i]); + } + break; case "BlockStatement": case "Program": for (var i = 0; i < exp.body.length; ++i) { - if (exp.body[i] instanceof __WEBPACK_IMPORTED_MODULE_9__utils_acorn_js__["Node"]) { + if (exp.body[i] instanceof __WEBPACK_IMPORTED_MODULE_10__utils_acorn_js__["Node"]) { queue.push(exp.body[i]); } } @@ -21926,7 +21996,7 @@ function calculateRamUsage(codeCopy) { for (var prop in exp) { if (exp.hasOwnProperty(prop)) { - if (exp[prop] instanceof __WEBPACK_IMPORTED_MODULE_9__utils_acorn_js__["Node"]) { + if (exp[prop] instanceof __WEBPACK_IMPORTED_MODULE_10__utils_acorn_js__["Node"]) { queue.push(exp[prop]); } } @@ -21960,31 +22030,31 @@ Script.prototype.download = function() { } Script.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Script", this); + return Object(__WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Script", this); } Script.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Script, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Script, value.data); } -__WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["c" /* Reviver */].constructors.Script = Script; +__WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__["c" /* Reviver */].constructors.Script = Script; //Called when the game is loaded. Loads all running scripts (from all servers) //into worker scripts so that they will start running function loadAllRunningScripts() { var count = 0; var total = 0; - for (var property in __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */]) { - if (__WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */].hasOwnProperty(property)) { - var server = __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][property]; + for (var property in __WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */]) { + if (__WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */].hasOwnProperty(property)) { + var server = __WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */][property]; //Reset each server's RAM usage to 0 server.ramUsed = 0; for (var j = 0; j < server.runningScripts.length; ++j) { count++; - Object(__WEBPACK_IMPORTED_MODULE_4__NetscriptWorker_js__["c" /* addWorkerScript */])(server.runningScripts[j], server); + Object(__WEBPACK_IMPORTED_MODULE_5__NetscriptWorker_js__["c" /* addWorkerScript */])(server.runningScripts[j], server); //Offline production total += scriptCalculateOfflineProduction(server.runningScripts[j]); @@ -21998,7 +22068,7 @@ function loadAllRunningScripts() { function scriptCalculateOfflineProduction(runningScriptObj) { //The Player object stores the last update time from when we were online var thisUpdate = new Date().getTime(); - var lastUpdate = __WEBPACK_IMPORTED_MODULE_5__Player_js__["a" /* Player */].lastUpdate; + var lastUpdate = __WEBPACK_IMPORTED_MODULE_6__Player_js__["a" /* Player */].lastUpdate; var timePassed = (thisUpdate - lastUpdate) / 1000; //Seconds console.log("Offline for " + timePassed + " seconds"); @@ -22014,13 +22084,13 @@ function scriptCalculateOfflineProduction(runningScriptObj) { for (var ip in runningScriptObj.dataMap) { if (runningScriptObj.dataMap.hasOwnProperty(ip)) { if (runningScriptObj.dataMap[ip][2] == 0 || runningScriptObj.dataMap[ip][2] == null) {continue;} - var serv = __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip]; + var serv = __WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */][ip]; if (serv == null) {continue;} var timesGrown = Math.round(0.5 * runningScriptObj.dataMap[ip][2] / runningScriptObj.onlineRunningTime * timePassed); console.log(runningScriptObj.filename + " called grow() on " + serv.hostname + " " + timesGrown + " times while offline"); runningScriptObj.log("Called grow() on " + serv.hostname + " " + timesGrown + " times while offline"); - var growth = Object(__WEBPACK_IMPORTED_MODULE_6__Server_js__["j" /* processSingleServerGrowth */])(serv, timesGrown * 450); - runningScriptObj.log(serv.hostname + " grown by " + Object(__WEBPACK_IMPORTED_MODULE_13__utils_StringHelperFunctions_js__["c" /* formatNumber */])(growth * 100 - 100, 6) + "% from grow() calls made while offline"); + var growth = Object(__WEBPACK_IMPORTED_MODULE_7__Server_js__["j" /* processSingleServerGrowth */])(serv, timesGrown * 450); + runningScriptObj.log(serv.hostname + " grown by " + Object(__WEBPACK_IMPORTED_MODULE_14__utils_StringHelperFunctions_js__["c" /* formatNumber */])(growth * 100 - 100, 6) + "% from grow() calls made while offline"); } } @@ -22028,7 +22098,7 @@ function scriptCalculateOfflineProduction(runningScriptObj) { for (var ip in runningScriptObj.dataMap) { if (runningScriptObj.dataMap.hasOwnProperty(ip)) { if (runningScriptObj.dataMap[ip][0] == 0 || runningScriptObj.dataMap[ip][0] == null) {continue;} - var serv = __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip]; + var serv = __WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */][ip]; if (serv == null) {continue;} var production = 0.5 * runningScriptObj.dataMap[ip][0] / runningScriptObj.onlineRunningTime * timePassed; production *= confidence; @@ -22036,7 +22106,7 @@ function scriptCalculateOfflineProduction(runningScriptObj) { production = serv.moneyAvailable; } totalOfflineProduction += production; - __WEBPACK_IMPORTED_MODULE_5__Player_js__["a" /* Player */].gainMoney(production); + __WEBPACK_IMPORTED_MODULE_6__Player_js__["a" /* Player */].gainMoney(production); console.log(runningScriptObj.filename + " generated $" + production + " while offline by hacking " + serv.hostname); runningScriptObj.log(runningScriptObj.filename + " generated $" + production + " while offline by hacking " + serv.hostname); serv.moneyAvailable -= production; @@ -22050,7 +22120,7 @@ function scriptCalculateOfflineProduction(runningScriptObj) { var expGain = 0.5 * (runningScriptObj.onlineExpGained / runningScriptObj.onlineRunningTime) * timePassed; expGain *= confidence; - __WEBPACK_IMPORTED_MODULE_5__Player_js__["a" /* Player */].gainHackingExp(expGain); + __WEBPACK_IMPORTED_MODULE_6__Player_js__["a" /* Player */].gainHackingExp(expGain); //Update script stats runningScriptObj.offlineMoneyMade += totalOfflineProduction; @@ -22061,7 +22131,7 @@ function scriptCalculateOfflineProduction(runningScriptObj) { for (var ip in runningScriptObj.dataMap) { if (runningScriptObj.dataMap.hasOwnProperty(ip)) { if (runningScriptObj.dataMap[ip][1] == 0 || runningScriptObj.dataMap[ip][1] == null) {continue;} - var serv = __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip]; + var serv = __WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */][ip]; if (serv == null) {continue;} var timesHacked = Math.round(0.5 * runningScriptObj.dataMap[ip][1] / runningScriptObj.onlineRunningTime * timePassed); console.log(runningScriptObj.filename + " hacked " + serv.hostname + " " + timesHacked + " times while offline"); @@ -22074,7 +22144,7 @@ function scriptCalculateOfflineProduction(runningScriptObj) { for (var ip in runningScriptObj.dataMap) { if (runningScriptObj.dataMap.hasOwnProperty(ip)) { if (runningScriptObj.dataMap[ip][3] == 0 || runningScriptObj.dataMap[ip][3] == null) {continue;} - var serv = __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip]; + var serv = __WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */][ip]; if (serv == null) {continue;} var timesWeakened = Math.round(0.5 * runningScriptObj.dataMap[ip][3] / runningScriptObj.onlineRunningTime * timePassed); console.log(runningScriptObj.filename + " called weaken() on " + serv.hostname + " " + timesWeakened + " times while offline"); @@ -22091,7 +22161,7 @@ function scriptCalculateOfflineProduction(runningScriptObj) { function findRunningScript(filename, args, server) { for (var i = 0; i < server.runningScripts.length; ++i) { if (server.runningScripts[i].filename == filename && - Object(__WEBPACK_IMPORTED_MODULE_12__utils_HelperFunctions_js__["d" /* compareArrays */])(server.runningScripts[i].args, args)) { + Object(__WEBPACK_IMPORTED_MODULE_13__utils_HelperFunctions_js__["d" /* compareArrays */])(server.runningScripts[i].args, args)) { return server.runningScripts[i]; } } @@ -22123,7 +22193,7 @@ function RunningScript(script, args) { } RunningScript.prototype.log = function(txt) { - if (this.logs.length > __WEBPACK_IMPORTED_MODULE_7__Settings_js__["a" /* Settings */].MaxLogCapacity) { + if (this.logs.length > __WEBPACK_IMPORTED_MODULE_8__Settings_js__["a" /* Settings */].MaxLogCapacity) { //Delete first element and add new log entry to the end. //TODO Eventually it might be better to replace this with circular array //to improve performance @@ -22135,7 +22205,7 @@ RunningScript.prototype.log = function(txt) { RunningScript.prototype.displayLog = function() { for (var i = 0; i < this.logs.length; ++i) { - Object(__WEBPACK_IMPORTED_MODULE_8__Terminal_js__["b" /* post */])(this.logs[i]); + Object(__WEBPACK_IMPORTED_MODULE_9__Terminal_js__["b" /* post */])(this.logs[i]); } } @@ -22172,22 +22242,22 @@ RunningScript.prototype.recordWeaken = function(serverIp, n=1) { } RunningScript.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["b" /* Generic_toJSON */])("RunningScript", this); + return Object(__WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__["b" /* Generic_toJSON */])("RunningScript", this); } RunningScript.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(RunningScript, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(RunningScript, value.data); } -__WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["c" /* Reviver */].constructors.RunningScript = RunningScript; +__WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__["c" /* Reviver */].constructors.RunningScript = RunningScript; //Creates an object that creates a map/dictionary with the IP of each existing server as //a key. Initializes every key with a specified value that can either by a number or an array function AllServersMap(arr=false, filterOwned=false) { - for (var ip in __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */]) { - if (__WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */].hasOwnProperty(ip)) { - if (filterOwned && (__WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip].purchasedByPlayer || __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip].hostname === "home")) { + for (var ip in __WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */]) { + if (__WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */].hasOwnProperty(ip)) { + if (filterOwned && (__WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */][ip].purchasedByPlayer || __WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */][ip].hostname === "home")) { continue; } if (arr) { @@ -22202,7 +22272,7 @@ function AllServersMap(arr=false, filterOwned=false) { AllServersMap.prototype.printConsole = function() { for (var ip in this) { if (this.hasOwnProperty(ip)) { - var serv = __WEBPACK_IMPORTED_MODULE_6__Server_js__["b" /* AllServers */][ip]; + var serv = __WEBPACK_IMPORTED_MODULE_7__Server_js__["b" /* AllServers */][ip]; if (serv == null) { console.log("Warning null server encountered with ip: " + ip); continue; @@ -22212,15 +22282,15 @@ AllServersMap.prototype.printConsole = function() { } AllServersMap.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["b" /* Generic_toJSON */])("AllServersMap", this); + return Object(__WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__["b" /* Generic_toJSON */])("AllServersMap", this); } AllServersMap.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(AllServersMap, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(AllServersMap, value.data); } -__WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["c" /* Reviver */].constructors.AllServersMap = AllServersMap; +__WEBPACK_IMPORTED_MODULE_12__utils_JSONReviver_js__["c" /* Reviver */].constructors.AllServersMap = AllServersMap; @@ -22234,12 +22304,12 @@ __WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["c" /* Reviver */].construc /* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return postNetburnerText; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return post; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Terminal; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Alias_js__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Alias_js__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Constants_js__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__CreateProgram_js__ = __webpack_require__(16); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__DarkWeb_js__ = __webpack_require__(46); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__DarkWeb_js__ = __webpack_require__(47); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__engine_js__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__HelpText_js__ = __webpack_require__(67); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__HelpText_js__ = __webpack_require__(68); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__InteractiveTutorial_js__ = __webpack_require__(27); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Literature_js__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Message_js__ = __webpack_require__(25); @@ -22251,7 +22321,7 @@ __WEBPACK_IMPORTED_MODULE_11__utils_JSONReviver_js__["c" /* Reviver */].construc /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__Server_js__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__Settings_js__ = __webpack_require__(15); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__SpecialServerIps_js__ = __webpack_require__(14); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__TextFile_js__ = __webpack_require__(49); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__TextFile_js__ = __webpack_require__(50); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__utils_StringHelperFunctions_js__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__utils_HelperFunctions_js__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__utils_LogBox_js__ = __webpack_require__(30); @@ -22677,9 +22747,9 @@ let Terminal = { ''; var hdr = document.getElementById("terminal-input-header"); hdr.style.display = "inline"; - var lineWidth = document.getElementById("terminal-input-td").offsetWidth; - var width = lineWidth - hdr.offsetWidth - 10; - document.getElementById("terminal-input-text-box").style.width = width + "px"; + //var lineWidth = document.getElementById("terminal-input-td").offsetWidth; + //var width = lineWidth - hdr.offsetWidth - 10; + //document.getElementById("terminal-input-text-box").style.width = width + "px"; }, //Complete the hack/analyze command @@ -23892,9 +23962,9 @@ let Terminal = { post("Server base security level: " + serv.baseDifficulty); post("Server current security level: " + serv.hackDifficulty); post("Server growth rate: " + serv.serverGrowth); - post("Netscript hack() execution time: " + Object(__WEBPACK_IMPORTED_MODULE_18__utils_StringHelperFunctions_js__["c" /* formatNumber */])(Object(__WEBPACK_IMPORTED_MODULE_9__NetscriptEvaluator_js__["j" /* scriptCalculateHackingTime */])(serv), 1) + "s"); - post("Netscript grow() execution time: " + Object(__WEBPACK_IMPORTED_MODULE_18__utils_StringHelperFunctions_js__["c" /* formatNumber */])(Object(__WEBPACK_IMPORTED_MODULE_9__NetscriptEvaluator_js__["h" /* scriptCalculateGrowTime */])(serv)/1000, 1) + "s"); - post("Netscript weaken() execution time: " + Object(__WEBPACK_IMPORTED_MODULE_18__utils_StringHelperFunctions_js__["c" /* formatNumber */])(Object(__WEBPACK_IMPORTED_MODULE_9__NetscriptEvaluator_js__["l" /* scriptCalculateWeakenTime */])(serv)/1000, 1) + "s"); + post("Netscript hack() execution time: " + Object(__WEBPACK_IMPORTED_MODULE_18__utils_StringHelperFunctions_js__["c" /* formatNumber */])(Object(__WEBPACK_IMPORTED_MODULE_9__NetscriptEvaluator_js__["k" /* scriptCalculateHackingTime */])(serv), 1) + "s"); + post("Netscript grow() execution time: " + Object(__WEBPACK_IMPORTED_MODULE_18__utils_StringHelperFunctions_js__["c" /* formatNumber */])(Object(__WEBPACK_IMPORTED_MODULE_9__NetscriptEvaluator_js__["i" /* scriptCalculateGrowTime */])(serv)/1000, 1) + "s"); + post("Netscript weaken() execution time: " + Object(__WEBPACK_IMPORTED_MODULE_18__utils_StringHelperFunctions_js__["c" /* formatNumber */])(Object(__WEBPACK_IMPORTED_MODULE_9__NetscriptEvaluator_js__["m" /* scriptCalculateWeakenTime */])(serv)/1000, 1) + "s"); break; case __WEBPACK_IMPORTED_MODULE_2__CreateProgram_js__["a" /* Programs */].AutoLink: post("This executable cannot be run."); @@ -27396,7 +27466,7 @@ function getJobRequirementText(company, pos, tooltiptext=false) { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Company_js__ = __webpack_require__(22); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Constants_js__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__CreateProgram_js__ = __webpack_require__(16); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__DarkWeb_js__ = __webpack_require__(46); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__DarkWeb_js__ = __webpack_require__(47); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__engine_js__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__Faction_js__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__HacknetNode_js__ = __webpack_require__(41); @@ -27410,19 +27480,21 @@ function getJobRequirementText(company, pos, tooltiptext=false) { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__SpecialServerIps_js__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__ = __webpack_require__(29); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__Terminal_js__ = __webpack_require__(19); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__TextFile_js__ = __webpack_require__(49); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__TextFile_js__ = __webpack_require__(50); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__ = __webpack_require__(37); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__NetscriptEnvironment_js__ = __webpack_require__(38); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__utils_decimal_js__ = __webpack_require__(24); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__utils_decimal_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_25__utils_decimal_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__utils_DialogBox_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__utils_HelperFunctions_js__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__utils_IPAddress_js__ = __webpack_require__(20); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__utils_YesNoBox_js__ = __webpack_require__(13); -var sprintf = __webpack_require__(45).sprintf, - vsprintf = __webpack_require__(45).vsprintf +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__NetscriptPort_js__ = __webpack_require__(76); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__utils_decimal_js__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__utils_decimal_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_26__utils_decimal_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__utils_DialogBox_js__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__utils_HelperFunctions_js__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__utils_IPAddress_js__ = __webpack_require__(20); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__utils_YesNoBox_js__ = __webpack_require__(13); +var sprintf = __webpack_require__(46).sprintf, + vsprintf = __webpack_require__(46).vsprintf + @@ -27493,6 +27565,7 @@ function NetscriptFunctions(workerScript) { return { Math : Math, Date : Date, + Number : Number, hacknetnodes : __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hacknetNodes, sprintf : sprintf, vsprintf: vsprintf, @@ -27507,7 +27580,7 @@ function NetscriptFunctions(workerScript) { } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, 'Invalid IP or hostname passed into scan() command'); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, 'Invalid IP or hostname passed into scan() command'); } var out = []; for (var i = 0; i < server.serversOnNetwork.length; i++) { @@ -27537,41 +27610,41 @@ function NetscriptFunctions(workerScript) { } } if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Hack() call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Hack() call has incorrect number of arguments. Takes 1 argument"); } var threads = workerScript.scriptRef.threads; if (isNaN(threads) || threads < 1) {threads = 1;} var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("hack() error. Invalid IP or hostname passed in: " + ip + ". Stopping..."); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "hack() error. Invalid IP or hostname passed in: " + ip + ". Stopping..."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "hack() error. Invalid IP or hostname passed in: " + ip + ". Stopping..."); } //Calculate the hacking time - var hackingTime = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["j" /* scriptCalculateHackingTime */])(server); //This is in seconds + var hackingTime = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["k" /* scriptCalculateHackingTime */])(server); //This is in seconds //No root access or skill level too low if (server.hasAdminRights == false) { workerScript.scriptRef.log("Cannot hack this server (" + server.hostname + ") because user does not have root access"); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot hack this server (" + server.hostname + ") because user does not have root access"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot hack this server (" + server.hostname + ") because user does not have root access"); } if (server.requiredHackingSkill > __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hacking_skill) { workerScript.scriptRef.log("Cannot hack this server (" + server.hostname + ") because user's hacking skill is not high enough"); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot hack this server (" + server.hostname + ") because user's hacking skill is not high enough"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot hack this server (" + server.hostname + ") because user's hacking skill is not high enough"); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.hack == null) { workerScript.scriptRef.log("Attempting to hack " + ip + " in " + hackingTime.toFixed(3) + " seconds (t=" + threads + ")"); } - return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* netscriptDelay */])(hackingTime* 1000, workerScript).then(function() { + return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["f" /* netscriptDelay */])(hackingTime* 1000, workerScript).then(function() { if (workerScript.env.stopFlag) {return Promise.reject(workerScript);} - var hackChance = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["i" /* scriptCalculateHackingChance */])(server); + var hackChance = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["j" /* scriptCalculateHackingChance */])(server); var rand = Math.random(); - var expGainedOnSuccess = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["g" /* scriptCalculateExpGain */])(server) * threads; + var expGainedOnSuccess = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["h" /* scriptCalculateExpGain */])(server) * threads; var expGainedOnFailure = (expGainedOnSuccess / 4); if (rand < hackChance) { //Success! - var moneyGained = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["k" /* scriptCalculatePercentMoneyHacked */])(server); + var moneyGained = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["l" /* scriptCalculatePercentMoneyHacked */])(server); moneyGained = Math.floor(server.moneyAvailable * moneyGained) * threads; //Over-the-top safety checks @@ -27590,7 +27663,7 @@ function NetscriptFunctions(workerScript) { __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].gainHackingExp(expGainedOnSuccess); workerScript.scriptRef.onlineExpGained += expGainedOnSuccess; if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.hack == null) { - workerScript.scriptRef.log("Script SUCCESSFULLY hacked " + server.hostname + " for $" + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(moneyGained, 2) + " and " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(expGainedOnSuccess, 4) + " exp (t=" + threads + ")"); + workerScript.scriptRef.log("Script SUCCESSFULLY hacked " + server.hostname + " for $" + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(moneyGained, 2) + " and " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(expGainedOnSuccess, 4) + " exp (t=" + threads + ")"); } server.fortify(__WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ServerFortifyAmount * threads); return Promise.resolve(moneyGained); @@ -27599,7 +27672,7 @@ function NetscriptFunctions(workerScript) { __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].gainHackingExp(expGainedOnFailure); workerScript.scriptRef.onlineExpGained += expGainedOnFailure; if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.hack == null) { - workerScript.scriptRef.log("Script FAILED to hack " + server.hostname + ". Gained " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(expGainedOnFailure, 4) + " exp (t=" + threads + ")"); + workerScript.scriptRef.log("Script FAILED to hack " + server.hostname + ". Gained " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(expGainedOnFailure, 4) + " exp (t=" + threads + ")"); } return Promise.resolve(0); } @@ -27608,12 +27681,12 @@ function NetscriptFunctions(workerScript) { sleep : function(time){ if (workerScript.checkingRam) {return 0;} if (time === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "sleep() call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "sleep() call has incorrect number of arguments. Takes 1 argument"); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.sleep == null) { workerScript.scriptRef.log("Sleeping for " + time + " milliseconds"); } - return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* netscriptDelay */])(time, workerScript).then(function() { + return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["f" /* netscriptDelay */])(time, workerScript).then(function() { return Promise.resolve(true); }); }, @@ -27629,37 +27702,37 @@ function NetscriptFunctions(workerScript) { var threads = workerScript.scriptRef.threads; if (isNaN(threads) || threads < 1) {threads = 1;} if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "grow() call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "grow() call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("Cannot grow(). Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot grow(). Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot grow(). Invalid IP or hostname passed in: " + ip); } //No root access or skill level too low if (server.hasAdminRights == false) { workerScript.scriptRef.log("Cannot grow this server (" + server.hostname + ") because user does not have root access"); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot grow this server (" + server.hostname + ") because user does not have root access"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot grow this server (" + server.hostname + ") because user does not have root access"); } - var growTime = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["h" /* scriptCalculateGrowTime */])(server); + var growTime = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["i" /* scriptCalculateGrowTime */])(server); if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.grow == null) { - workerScript.scriptRef.log("Executing grow() on server " + server.hostname + " in " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(growTime/1000, 3) + " seconds (t=" + threads + ")"); + workerScript.scriptRef.log("Executing grow() on server " + server.hostname + " in " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(growTime/1000, 3) + " seconds (t=" + threads + ")"); } - return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* netscriptDelay */])(growTime, workerScript).then(function() { + return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["f" /* netscriptDelay */])(growTime, workerScript).then(function() { if (workerScript.env.stopFlag) {return Promise.reject(workerScript);} server.moneyAvailable += (1 * threads); //It can be grown even if it has no money var growthPercentage = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["j" /* processSingleServerGrowth */])(server, 450 * threads); workerScript.scriptRef.recordGrow(server.ip, threads); - var expGain = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["g" /* scriptCalculateExpGain */])(server) * threads; + var expGain = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["h" /* scriptCalculateExpGain */])(server) * threads; if (growthPercentage == 1) { expGain = 0; } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.grow == null) { workerScript.scriptRef.log("Available money on " + server.hostname + " grown by " + - Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(growthPercentage*100 - 100, 6) + "%. Gained " + - Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(expGain, 4) + " hacking exp (t=" + threads +")"); + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(growthPercentage*100 - 100, 6) + "%. Gained " + + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(expGain, 4) + " hacking exp (t=" + threads +")"); } workerScript.scriptRef.onlineExpGained += expGain; __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].gainHackingExp(expGain); @@ -27678,33 +27751,33 @@ function NetscriptFunctions(workerScript) { var threads = workerScript.scriptRef.threads; if (isNaN(threads) || threads < 1) {threads = 1;} if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "weaken() call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "weaken() call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("Cannot weaken(). Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot weaken(). Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot weaken(). Invalid IP or hostname passed in: " + ip); } //No root access or skill level too low if (server.hasAdminRights == false) { workerScript.scriptRef.log("Cannot weaken this server (" + server.hostname + ") because user does not have root access"); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot weaken this server (" + server.hostname + ") because user does not have root access"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot weaken this server (" + server.hostname + ") because user does not have root access"); } - var weakenTime = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["l" /* scriptCalculateWeakenTime */])(server); + var weakenTime = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["m" /* scriptCalculateWeakenTime */])(server); if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.weaken == null) { workerScript.scriptRef.log("Executing weaken() on server " + server.hostname + " in " + - Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(weakenTime/1000, 3) + " seconds (t=" + threads + ")"); + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(weakenTime/1000, 3) + " seconds (t=" + threads + ")"); } - return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* netscriptDelay */])(weakenTime, workerScript).then(function() { + return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["f" /* netscriptDelay */])(weakenTime, workerScript).then(function() { if (workerScript.env.stopFlag) {return Promise.reject(workerScript);} server.weaken(__WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ServerWeakenAmount * threads); workerScript.scriptRef.recordWeaken(server.ip, threads); - var expGain = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["g" /* scriptCalculateExpGain */])(server) * threads; + var expGain = Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["h" /* scriptCalculateExpGain */])(server) * threads; if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.weaken == null) { workerScript.scriptRef.log("Server security level on " + server.hostname + " weakened to " + server.hackDifficulty + - ". Gained " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(expGain, 4) + " hacking exp (t=" + threads + ")"); + ". Gained " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(expGain, 4) + " hacking exp (t=" + threads + ")"); } workerScript.scriptRef.onlineExpGained += expGain; __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].gainHackingExp(expGain); @@ -27714,19 +27787,19 @@ function NetscriptFunctions(workerScript) { print : function(args){ if (workerScript.checkingRam) {return 0;} if (args === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "print() call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "print() call has incorrect number of arguments. Takes 1 argument"); } workerScript.scriptRef.log(args.toString()); }, tprint : function(args) { if (workerScript.checkingRam) {return 0;} if (args === undefined || args == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "tprint() call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "tprint() call has incorrect number of arguments. Takes 1 argument"); } var x = args.toString(); - if (Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["e" /* isHTML */])(x)) { + if (Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["e" /* isHTML */])(x)) { __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].takeDamage(1); - Object(__WEBPACK_IMPORTED_MODULE_26__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You suddenly feel a sharp shooting pain through your body as an angry voice in your head exclaims:

" + + Object(__WEBPACK_IMPORTED_MODULE_27__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You suddenly feel a sharp shooting pain through your body as an angry voice in your head exclaims:

" + "DON'T USE TPRINT() TO OUTPUT HTML ELEMENTS TO YOUR TERMINAL!!!!

" + "(You lost 1 HP)"); return; @@ -27757,18 +27830,18 @@ function NetscriptFunctions(workerScript) { } } if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("Cannot call nuke(). Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call nuke(). Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call nuke(). Invalid IP or hostname passed in: " + ip); } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasProgram(__WEBPACK_IMPORTED_MODULE_6__CreateProgram_js__["a" /* Programs */].NukeProgram)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the NUKE.exe virus!"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the NUKE.exe virus!"); } if (server.openPortCount < server.numOpenPortsRequired) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Not enough ports opened to use NUKE.exe virus"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Not enough ports opened to use NUKE.exe virus"); } if (server.hasAdminRights) { if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.nuke == null) { @@ -27792,16 +27865,16 @@ function NetscriptFunctions(workerScript) { } } if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("Cannot call brutessh(). Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call brutessh(). Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call brutessh(). Invalid IP or hostname passed in: " + ip); } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasProgram(__WEBPACK_IMPORTED_MODULE_6__CreateProgram_js__["a" /* Programs */].BruteSSHProgram)) { workerScript.scriptRef.log("You do not have the BruteSSH.exe program!"); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the BruteSSH.exe program!"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the BruteSSH.exe program!"); } if (!server.sshPortOpen) { if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.brutessh == null) { @@ -27826,15 +27899,15 @@ function NetscriptFunctions(workerScript) { } } if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("Cannot call ftpcrack(). Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call ftpcrack(). Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call ftpcrack(). Invalid IP or hostname passed in: " + ip); } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasProgram(__WEBPACK_IMPORTED_MODULE_6__CreateProgram_js__["a" /* Programs */].FTPCrackProgram)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the FTPCrack.exe program!"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the FTPCrack.exe program!"); } if (!server.ftpPortOpen) { if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.ftpcrack == null) { @@ -27859,15 +27932,15 @@ function NetscriptFunctions(workerScript) { } } if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("Cannot call relaysmtp(). Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call relaysmtp(). Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call relaysmtp(). Invalid IP or hostname passed in: " + ip); } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasProgram(__WEBPACK_IMPORTED_MODULE_6__CreateProgram_js__["a" /* Programs */].RelaySMTPProgram)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the relaySMTP.exe program!"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the relaySMTP.exe program!"); } if (!server.smtpPortOpen) { if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.relaysmtp == null) { @@ -27892,15 +27965,15 @@ function NetscriptFunctions(workerScript) { } } if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("Cannot call httpworm(). Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call httpworm(). Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call httpworm(). Invalid IP or hostname passed in: " + ip); } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasProgram(__WEBPACK_IMPORTED_MODULE_6__CreateProgram_js__["a" /* Programs */].HTTPWormProgram)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the HTTPWorm.exe program!"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the HTTPWorm.exe program!"); } if (!server.httpPortOpen) { if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.httpworm == null) { @@ -27925,15 +27998,15 @@ function NetscriptFunctions(workerScript) { } } if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Program call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("Cannot call sqlinject(). Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call sqlinject(). Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot call sqlinject(). Invalid IP or hostname passed in: " + ip); } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasProgram(__WEBPACK_IMPORTED_MODULE_6__CreateProgram_js__["a" /* Programs */].SQLInjectProgram)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the SQLInject.exe program!"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You do not have the SQLInject.exe program!"); } if (!server.sqlPortOpen) { if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.sqlinject == null) { @@ -27958,10 +28031,10 @@ function NetscriptFunctions(workerScript) { } } if (scriptname === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "run() call has incorrect number of arguments. Usage: run(scriptname, [numThreads], [arg1], [arg2]...)"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "run() call has incorrect number of arguments. Usage: run(scriptname, [numThreads], [arg1], [arg2]...)"); } if (isNaN(threads) || threads < 1) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument for thread count passed into run(). Must be numeric and greater than 0"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument for thread count passed into run(). Must be numeric and greater than 0"); } var argsForNewScript = []; for (var i = 2; i < arguments.length; ++i) { @@ -27969,10 +28042,10 @@ function NetscriptFunctions(workerScript) { } var scriptServer = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(workerScript.serverIp); if (scriptServer == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server. This is a bug in the game. Report to game dev"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server. This is a bug in the game. Report to game dev"); } - return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["f" /* runScriptFromScript */])(scriptServer, scriptname, argsForNewScript, workerScript, threads); + return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["g" /* runScriptFromScript */])(scriptServer, scriptname, argsForNewScript, workerScript, threads); }, exec : function(scriptname,ip,threads = 1) { if (workerScript.checkingRam) { @@ -27984,10 +28057,10 @@ function NetscriptFunctions(workerScript) { } } if (scriptname === undefined || ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "exec() call has incorrect number of arguments. Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "exec() call has incorrect number of arguments. Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)"); } if (isNaN(threads) || threads < 1) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument for thread count passed into exec(). Must be numeric and greater than 0"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument for thread count passed into exec(). Must be numeric and greater than 0"); } var argsForNewScript = []; for (var i = 3; i < arguments.length; ++i) { @@ -27995,9 +28068,9 @@ function NetscriptFunctions(workerScript) { } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid hostname/ip passed into exec() command: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid hostname/ip passed into exec() command: " + ip); } - return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["f" /* runScriptFromScript */])(server, scriptname, argsForNewScript, workerScript, threads); + return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["g" /* runScriptFromScript */])(server, scriptname, argsForNewScript, workerScript, threads); }, spawn : function(scriptname, threads) { if (workerScript.checkingRam) { @@ -28008,8 +28081,8 @@ function NetscriptFunctions(workerScript) { return __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSpawnRamCost; } } - if (scriptname == null || threads == 1) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid scriptname or numThreads argument passed to spawn()"); + if (scriptname == null || threads == null) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid scriptname or numThreads argument passed to spawn()"); } setTimeout(()=>{ NetscriptFunctions(workerScript).run.apply(this, arguments); @@ -28030,12 +28103,12 @@ function NetscriptFunctions(workerScript) { } if (filename === undefined || ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "kill() call has incorrect number of arguments. Usage: kill(scriptname, server, [arg1], [arg2]...)"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "kill() call has incorrect number of arguments. Usage: kill(scriptname, server, [arg1], [arg2]...)"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("kill() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "kill() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "kill() failed. Invalid IP or hostname passed in: " + ip); } var argsForKillTarget = []; for (var i = 2; i < arguments.length; ++i) { @@ -28043,23 +28116,23 @@ function NetscriptFunctions(workerScript) { } var runningScriptObj = Object(__WEBPACK_IMPORTED_MODULE_15__Script_js__["d" /* findRunningScript */])(filename, argsForKillTarget, server); if (runningScriptObj == null) { - workerScript.scriptRef.log("kill() failed. No such script "+ filename + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_27__utils_HelperFunctions_js__["j" /* printArray */])(argsForKillTarget)); + workerScript.scriptRef.log("kill() failed. No such script "+ filename + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_28__utils_HelperFunctions_js__["j" /* printArray */])(argsForKillTarget)); return false; } var res = Object(__WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["d" /* killWorkerScript */])(runningScriptObj, server.ip); if (res) { if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.kill == null) { - workerScript.scriptRef.log("Killing " + filename + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_27__utils_HelperFunctions_js__["j" /* printArray */])(argsForKillTarget) + ". May take up to a few minutes for the scripts to die..."); + workerScript.scriptRef.log("Killing " + filename + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_28__utils_HelperFunctions_js__["j" /* printArray */])(argsForKillTarget) + ". May take up to a few minutes for the scripts to die..."); } return true; } else { if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.kill == null) { - workerScript.scriptRef.log("kill() failed. No such script "+ filename + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_27__utils_HelperFunctions_js__["j" /* printArray */])(argsForKillTarget)); + workerScript.scriptRef.log("kill() failed. No such script "+ filename + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_28__utils_HelperFunctions_js__["j" /* printArray */])(argsForKillTarget)); } return false; } }, - killall : function(ip){ + killall : function(ip=workerScript.serverIp){ if (workerScript.checkingRam) { if (workerScript.loadedFns.killall) { return 0; @@ -28070,12 +28143,12 @@ function NetscriptFunctions(workerScript) { } if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "killall() call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "killall() call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("killall() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "killall() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "killall() failed. Invalid IP or hostname passed in: " + ip); } var scriptsRunning = (server.runningScripts.length > 0); for (var i = server.runningScripts.length-1; i >= 0; --i) { @@ -28097,7 +28170,7 @@ function NetscriptFunctions(workerScript) { } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(workerScript.serverIp); if (server == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in exit(). This is a bug please contact game dev"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in exit(). This is a bug please contact game dev"); } if (Object(__WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["d" /* killWorkerScript */])(workerScript.scriptRef, server.ip)) { workerScript.scriptRef.log("Exiting..."); @@ -28115,7 +28188,7 @@ function NetscriptFunctions(workerScript) { } } if (arguments.length !== 2 && arguments.length !== 3) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error: scp() call has incorrect number of arguments. Takes 2 or 3 arguments"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error: scp() call has incorrect number of arguments. Takes 2 or 3 arguments"); } if (scriptname && scriptname.constructor === Array) { //Recursively call scp on all elements of array @@ -28129,36 +28202,36 @@ function NetscriptFunctions(workerScript) { } if (!scriptname.endsWith(".lit") && !scriptname.endsWith(".script") && !scriptname.endsWith("txt")) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error: scp() does not work with this file type. It only works for .script, .lit, and .txt files"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error: scp() does not work with this file type. It only works for .script, .lit, and .txt files"); } var destServer, currServ; if (arguments.length === 3) { //scriptname, source, destination if (scriptname === undefined || ip1 === undefined || ip2 === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error: scp() call has incorrect number of arguments. Takes 2 or 3 arguments"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error: scp() call has incorrect number of arguments. Takes 2 or 3 arguments"); } destServer = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip2); if (destServer == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error: Invalid hostname/ip passed into scp() command: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error: Invalid hostname/ip passed into scp() command: " + ip); } currServ = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip1); if (currServ == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server ip for this script. This is a bug please contact game developer"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server ip for this script. This is a bug please contact game developer"); } } else if (arguments.length === 2) { //scriptname, destination if (scriptname === undefined || ip1 === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error: scp() call has incorrect number of arguments. Takes 2 or 3 arguments"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error: scp() call has incorrect number of arguments. Takes 2 or 3 arguments"); } destServer = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip1); if (destServer == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error: Invalid hostname/ip passed into scp() command: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error: Invalid hostname/ip passed into scp() command: " + ip); } currServ = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(workerScript.serverIp); if (currServ == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server ip for this script. This is a bug please contact game developer"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server ip for this script. This is a bug please contact game developer"); } } @@ -28275,12 +28348,12 @@ function NetscriptFunctions(workerScript) { } } if (ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ls() failed because of invalid arguments. Usage: ls(ip/hostname, [grep filter])"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ls() failed because of invalid arguments. Usage: ls(ip/hostname, [grep filter])"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("ls() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ls() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ls() failed. Invalid IP or hostname passed in: " + ip); } //Get the grep filter, if one exists @@ -28351,12 +28424,12 @@ function NetscriptFunctions(workerScript) { } } if (ip===undefined){ - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "hasRootAccess() call has incorrect number of arguments. Takes 1 argument"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "hasRootAccess() call has incorrect number of arguments. Takes 1 argument"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null){ workerScript.scriptRef.log("hasRootAccess() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "hasRootAccess() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "hasRootAccess() failed. Invalid IP or hostname passed in: " + ip); } return server.hasAdminRights; }, @@ -28371,7 +28444,7 @@ function NetscriptFunctions(workerScript) { } var scriptServer = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(workerScript.serverIp); if (scriptServer == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server. This is a bug in the game. Report to game dev"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server. This is a bug in the game. Report to game dev"); } return scriptServer.ip; }, @@ -28386,7 +28459,7 @@ function NetscriptFunctions(workerScript) { } var scriptServer = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(workerScript.serverIp); if (scriptServer == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server. This is a bug in the game. Report to game dev"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Could not find server. This is a bug in the game. Report to game dev"); } return scriptServer.hostname; }, @@ -28431,7 +28504,7 @@ function NetscriptFunctions(workerScript) { } } if (!hasAISF) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getBitNodeMultipliers(). It requires Source-File 5 to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getBitNodeMultipliers(). It requires Source-File 5 to run."); } return __WEBPACK_IMPORTED_MODULE_2__BitNode_js__["a" /* BitNodeMultipliers */]; }, @@ -28447,17 +28520,17 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getServerMoneyAvailable() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getServerMoneyAvailable() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getServerMoneyAvailable() failed. Invalid IP or hostname passed in: " + ip); } if (server.hostname == "home") { //Return player's money if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerMoneyAvailable == null) { - workerScript.scriptRef.log("getServerMoneyAvailable('home') returned player's money: $" + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].money.toNumber(), 2)); + workerScript.scriptRef.log("getServerMoneyAvailable('home') returned player's money: $" + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].money.toNumber(), 2)); } return __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].money.toNumber(); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerMoneyAvailable == null) { - workerScript.scriptRef.log("getServerMoneyAvailable() returned " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.moneyAvailable, 2) + " for " + server.hostname); + workerScript.scriptRef.log("getServerMoneyAvailable() returned " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.moneyAvailable, 2) + " for " + server.hostname); } return server.moneyAvailable; }, @@ -28473,10 +28546,10 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getServerSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getServerSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getServerSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerSecurityLevel == null) { - workerScript.scriptRef.log("getServerSecurityLevel() returned " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.hackDifficulty, 3) + " for " + server.hostname); + workerScript.scriptRef.log("getServerSecurityLevel() returned " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.hackDifficulty, 3) + " for " + server.hostname); } return server.hackDifficulty; }, @@ -28492,10 +28565,10 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getServerBaseSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getServerBaseSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getServerBaseSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerBaseSecurityLevel == null) { - workerScript.scriptRef.log("getServerBaseSecurityLevel() returned " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.baseDifficulty, 3) + " for " + server.hostname); + workerScript.scriptRef.log("getServerBaseSecurityLevel() returned " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.baseDifficulty, 3) + " for " + server.hostname); } return server.baseDifficulty; }, @@ -28511,10 +28584,10 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getServerMinSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getServerMinSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getServerMinSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerMinSecurityLevel == null) { - workerScript.scriptRef.log("getServerMinSecurityLevel() returned " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.minDifficulty, 3) + " for " + server.hostname); + workerScript.scriptRef.log("getServerMinSecurityLevel() returned " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.minDifficulty, 3) + " for " + server.hostname); } return server.minDifficulty; }, @@ -28530,10 +28603,10 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getServerRequiredHackingLevel() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getServerRequiredHackingLevel() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getServerRequiredHackingLevel() failed. Invalid IP or hostname passed in: " + ip); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerRequiredHackingLevel == null) { - workerScript.scriptRef.log("getServerRequiredHackingLevel returned " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.requiredHackingSkill, 0) + " for " + server.hostname); + workerScript.scriptRef.log("getServerRequiredHackingLevel returned " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.requiredHackingSkill, 0) + " for " + server.hostname); } return server.requiredHackingSkill; }, @@ -28549,10 +28622,10 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getServerMaxMoney() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getServerMaxMoney() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getServerMaxMoney() failed. Invalid IP or hostname passed in: " + ip); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerMaxMoney == null) { - workerScript.scriptRef.log("getServerMaxMoney() returned " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.moneyMax, 0) + " for " + server.hostname); + workerScript.scriptRef.log("getServerMaxMoney() returned " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.moneyMax, 0) + " for " + server.hostname); } return server.moneyMax; }, @@ -28568,10 +28641,10 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getServerGrowth() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getServerGrowth() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getServerGrowth() failed. Invalid IP or hostname passed in: " + ip); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerGrowth == null) { - workerScript.scriptRef.log("getServerGrowth() returned " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.serverGrowth, 0) + " for " + server.hostname); + workerScript.scriptRef.log("getServerGrowth() returned " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.serverGrowth, 0) + " for " + server.hostname); } return server.serverGrowth; }, @@ -28587,10 +28660,10 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getServerNumPortsRequired() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getServerNumPortsRequired() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getServerNumPortsRequired() failed. Invalid IP or hostname passed in: " + ip); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerNumPortsRequired == null) { - workerScript.scriptRef.log("getServerNumPortsRequired() returned " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.numOpenPortsRequired, 0) + " for " + server.hostname); + workerScript.scriptRef.log("getServerNumPortsRequired() returned " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.numOpenPortsRequired, 0) + " for " + server.hostname); } return server.numOpenPortsRequired; }, @@ -28606,10 +28679,10 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getServerRam() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getServerRam() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getServerRam() failed. Invalid IP or hostname passed in: " + ip); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.getServerRam == null) { - workerScript.scriptRef.log("getServerRam() returned [" + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.maxRam, 2) + "GB, " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.ramUsed, 2) + "GB]"); + workerScript.scriptRef.log("getServerRam() returned [" + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.maxRam, 2) + "GB, " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(server.ramUsed, 2) + "GB]"); } return [server.maxRam, server.ramUsed]; }, @@ -28634,12 +28707,12 @@ function NetscriptFunctions(workerScript) { } } if (filename === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "fileExists() call has incorrect number of arguments. Usage: fileExists(scriptname, [server])"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "fileExists() call has incorrect number of arguments. Usage: fileExists(scriptname, [server])"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("fileExists() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "fileExists() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "fileExists() failed. Invalid IP or hostname passed in: " + ip); } for (var i = 0; i < server.scripts.length; ++i) { if (filename == server.scripts[i].filename) { @@ -28673,12 +28746,12 @@ function NetscriptFunctions(workerScript) { } } if (filename === undefined || ip === undefined) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "isRunning() call has incorrect number of arguments. Usage: isRunning(scriptname, server, [arg1], [arg2]...)"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "isRunning() call has incorrect number of arguments. Usage: isRunning(scriptname, server, [arg1], [arg2]...)"); } var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("isRunning() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "isRunning() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "isRunning() failed. Invalid IP or hostname passed in: " + ip); } var argsForTargetScript = []; for (var i = 2; i < arguments.length; ++i) { @@ -28695,7 +28768,7 @@ function NetscriptFunctions(workerScript) { return __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptPurchaseHacknetRamCost; } } - return Object(__WEBPACK_IMPORTED_MODULE_10__HacknetNode_js__["b" /* getCostOfNextHacknetNode */])(); + return Object(__WEBPACK_IMPORTED_MODULE_10__HacknetNode_js__["c" /* getCostOfNextHacknetNode */])(); }, purchaseHacknetNode : function() { @@ -28707,7 +28780,7 @@ function NetscriptFunctions(workerScript) { return __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptPurchaseHacknetRamCost; } } - return Object(__WEBPACK_IMPORTED_MODULE_10__HacknetNode_js__["d" /* purchaseHacknet */])(); + return Object(__WEBPACK_IMPORTED_MODULE_10__HacknetNode_js__["e" /* purchaseHacknet */])(); }, getStockPrice : function(symbol) { if (workerScript.checkingRam) { @@ -28719,11 +28792,11 @@ function NetscriptFunctions(workerScript) { } } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasTixApiAccess) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use getStockPrice()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use getStockPrice()"); } var stock = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["d" /* SymbolToStockMap */][symbol]; if (stock == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid stock symbol passed into getStockPrice()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid stock symbol passed into getStockPrice()"); } return parseFloat(stock.price.toFixed(3)); }, @@ -28737,11 +28810,11 @@ function NetscriptFunctions(workerScript) { } } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasTixApiAccess) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use getStockPosition()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use getStockPosition()"); } var stock = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["d" /* SymbolToStockMap */][symbol]; if (stock == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid stock symbol passed into getStockPrice()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid stock symbol passed into getStockPrice()"); } return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx]; }, @@ -28755,11 +28828,11 @@ function NetscriptFunctions(workerScript) { } } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasTixApiAccess) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use buyStock()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use buyStock()"); } var stock = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["d" /* SymbolToStockMap */][symbol]; if (stock == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid stock symbol passed into buyStock()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid stock symbol passed into buyStock()"); } if (shares < 0 || isNaN(shares)) { workerScript.scriptRef.log("Error: Invalid 'shares' argument passed to buyStock()"); @@ -28770,9 +28843,9 @@ function NetscriptFunctions(workerScript) { var totalPrice = stock.price * shares; if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].money.lt(totalPrice + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].StockMarketCommission)) { - workerScript.scriptRef.log("Not enough money to purchase " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(shares, 0) + " shares of " + + workerScript.scriptRef.log("Not enough money to purchase " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(shares, 0) + " shares of " + symbol + ". Need $" + - Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalPrice + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].StockMarketCommission, 2).toString()); + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalPrice + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].StockMarketCommission, 2).toString()); return 0; } @@ -28785,8 +28858,8 @@ function NetscriptFunctions(workerScript) { Object(__WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["p" /* updateStockPlayerPosition */])(stock); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.buyStock == null) { - workerScript.scriptRef.log("Bought " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(shares, 0) + " shares of " + stock.symbol + " at $" + - Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(stock.price, 2) + " per share"); + workerScript.scriptRef.log("Bought " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(shares, 0) + " shares of " + stock.symbol + " at $" + + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(stock.price, 2) + " per share"); } return stock.price; }, @@ -28800,11 +28873,11 @@ function NetscriptFunctions(workerScript) { } } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasTixApiAccess) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use sellStock()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use sellStock()"); } var stock = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["d" /* SymbolToStockMap */][symbol]; if (stock == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid stock symbol passed into sellStock()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid stock symbol passed into sellStock()"); } if (shares < 0 || isNaN(shares)) { workerScript.scriptRef.log("Error: Invalid 'shares' argument passed to sellStock()"); @@ -28830,9 +28903,9 @@ function NetscriptFunctions(workerScript) { Object(__WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["p" /* updateStockPlayerPosition */])(stock); } if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.sellStock == null) { - workerScript.scriptRef.log("Sold " + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(shares, 0) + " shares of " + stock.symbol + " at $" + - Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(stock.price, 2) + " per share. Gained " + - "$" + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(gains, 2)); + workerScript.scriptRef.log("Sold " + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(shares, 0) + " shares of " + stock.symbol + " at $" + + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(stock.price, 2) + " per share. Gained " + + "$" + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(gains, 2)); } return stock.price; }, @@ -28846,16 +28919,16 @@ function NetscriptFunctions(workerScript) { } } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasTixApiAccess) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use shortStock()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use shortStock()"); } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 8) { if (!(hasWallStreetSF && wallStreetSFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Cannot use shortStock(). You must either be in BitNode-8 or you must have Level 2 of Source-File 8"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Cannot use shortStock(). You must either be in BitNode-8 or you must have Level 2 of Source-File 8"); } } var stock = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["d" /* SymbolToStockMap */][symbol]; if (stock == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid stock symbol passed into shortStock()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid stock symbol passed into shortStock()"); } var res = Object(__WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["n" /* shortStock */])(stock, shares, workerScript); return res ? stock.price : 0; @@ -28870,16 +28943,16 @@ function NetscriptFunctions(workerScript) { } } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasTixApiAccess) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use sellShort()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use sellShort()"); } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 8) { if (!(hasWallStreetSF && wallStreetSFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Cannot use sellShort(). You must either be in BitNode-8 or you must have Level 2 of Source-File 8"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Cannot use sellShort(). You must either be in BitNode-8 or you must have Level 2 of Source-File 8"); } } var stock = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["d" /* SymbolToStockMap */][symbol]; if (stock == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid stock symbol passed into sellShort()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid stock symbol passed into sellShort()"); } var res = Object(__WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["l" /* sellShort */])(stock, shares, workerScript); return res ? stock.price : 0; @@ -28894,16 +28967,16 @@ function NetscriptFunctions(workerScript) { } } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasTixApiAccess) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use placeOrder()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use placeOrder()"); } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 8) { if (!(hasWallStreetSF && wallStreetSFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Cannot use placeOrder(). You must either be in BitNode-8 or have Level 3 of Source-File 8"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Cannot use placeOrder(). You must either be in BitNode-8 or have Level 3 of Source-File 8"); } } var stock = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["d" /* SymbolToStockMap */][symbol]; if (stock == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid stock symbol passed into placeOrder()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid stock symbol passed into placeOrder()"); } var orderType, orderPos; type = type.toLowerCase(); @@ -28916,7 +28989,7 @@ function NetscriptFunctions(workerScript) { } else if (type.includes("stop") && type.includes("sell")) { orderType = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["a" /* OrderTypes */].StopSell; } else { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Order Type passed into placeOrder()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Order Type passed into placeOrder()"); } pos = pos.toLowerCase(); @@ -28925,7 +28998,7 @@ function NetscriptFunctions(workerScript) { } else if (pos.includes('s')) { orderPos = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["b" /* PositionTypes */].Short; } else { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Position Type passed into placeOrder()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Position Type passed into placeOrder()"); } return Object(__WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["k" /* placeOrder */])(stock, shares, price, orderType, orderPos, workerScript); @@ -28940,19 +29013,19 @@ function NetscriptFunctions(workerScript) { } } if (!__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].hasTixApiAccess) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use cancelOrder()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "You don't have TIX API Access! Cannot use cancelOrder()"); } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 8) { if (!(hasWallStreetSF && wallStreetSFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Cannot use cancelOrder(). You must either be in BitNode-8 or have Level 3 of Source-File 8"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Cannot use cancelOrder(). You must either be in BitNode-8 or have Level 3 of Source-File 8"); } } var stock = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["d" /* SymbolToStockMap */][symbol]; if (stock == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid stock symbol passed into cancelOrder()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid stock symbol passed into cancelOrder()"); } if (isNaN(shares) || isNaN(price)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid shares or price argument passed into cancelOrder(). Must be numeric"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid shares or price argument passed into cancelOrder(). Must be numeric"); } var orderType, orderPos; type = type.toLowerCase(); @@ -28965,7 +29038,7 @@ function NetscriptFunctions(workerScript) { } else if (type.includes("stop") && type.includes("sell")) { orderType = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["a" /* OrderTypes */].StopSell; } else { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Order Type passed into placeOrder()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Order Type passed into placeOrder()"); } pos = pos.toLowerCase(); @@ -28974,7 +29047,7 @@ function NetscriptFunctions(workerScript) { } else if (pos.includes('s')) { orderPos = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["b" /* PositionTypes */].Short; } else { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Position Type passed into placeOrder()"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Position Type passed into placeOrder()"); } var params = { stock: stock, @@ -28995,7 +29068,7 @@ function NetscriptFunctions(workerScript) { } } var hostnameStr = String(hostname); - hostnameStr = hostnameStr.replace(/\s\s+/g, ''); + hostnameStr = hostnameStr.replace(/\s+/g, ''); if (hostnameStr == "") { workerScript.scriptRef.log("Error: Passed empty string for hostname argument of purchaseServer()"); return ""; @@ -29008,17 +29081,17 @@ function NetscriptFunctions(workerScript) { } ram = Math.round(ram); - if (isNaN(ram) || !Object(__WEBPACK_IMPORTED_MODULE_27__utils_HelperFunctions_js__["i" /* powerOfTwo */])(ram)) { + if (isNaN(ram) || !Object(__WEBPACK_IMPORTED_MODULE_28__utils_HelperFunctions_js__["i" /* powerOfTwo */])(ram)) { workerScript.scriptRef.log("Error: Invalid ram argument passed to purchaseServer(). Must be numeric and a power of 2"); return ""; } var cost = ram * __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].BaseCostFor1GBOfRamServer; if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].money.lt(cost)) { - workerScript.scriptRef.log("Error: Not enough money to purchase server. Need $" + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(cost, 2)); + workerScript.scriptRef.log("Error: Not enough money to purchase server. Need $" + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(cost, 2)); return ""; } - var newServ = new __WEBPACK_IMPORTED_MODULE_16__Server_js__["d" /* Server */](Object(__WEBPACK_IMPORTED_MODULE_28__utils_IPAddress_js__["a" /* createRandomIp */])(), hostnameStr, "", false, true, true, ram); + var newServ = new __WEBPACK_IMPORTED_MODULE_16__Server_js__["d" /* Server */](Object(__WEBPACK_IMPORTED_MODULE_29__utils_IPAddress_js__["a" /* createRandomIp */])(), hostnameStr, "", false, true, true, ram); Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["a" /* AddToAllServers */])(newServ); __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].purchasedServers.push(newServ.ip); @@ -29027,7 +29100,7 @@ function NetscriptFunctions(workerScript) { newServ.serversOnNetwork.push(homeComputer.ip); __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].loseMoney(cost); if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.purchaseServer == null) { - workerScript.scriptRef.log("Purchased new server with hostname " + newServ.hostname + " for $" + Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["c" /* formatNumber */])(cost, 2)); + workerScript.scriptRef.log("Purchased new server with hostname " + newServ.hostname + " for $" + Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["c" /* formatNumber */])(cost, 2)); } return newServ.hostname; }, @@ -29118,7 +29191,7 @@ function NetscriptFunctions(workerScript) { if (hostname) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Could not find server in getPurchasedServers(). This is a bug please report to game dev"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Could not find server in getPurchasedServers(). This is a bug please report to game dev"); } res.push(server.hostname); } else { @@ -29138,25 +29211,20 @@ function NetscriptFunctions(workerScript) { } if (!isNaN(port)) { //Write to port //Port 1-10 - if (port < 1 || port > 10) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Trying to write to invalid port: " + port + ". Only ports 1-10 are valid."); + port = Math.round(port); + if (port < 1 || port > __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Trying to write to invalid port: " + port + ". Only ports 1-" + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts + " are valid."); } - var portName = "Port" + String(port); - var port = __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["a" /* NetscriptPorts */][portName]; - if (port == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Could not find port: " + port + ". This is a bug contact the game developer"); + var port = __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["a" /* NetscriptPorts */][port-1]; + if (port == null || !(port instanceof __WEBPACK_IMPORTED_MODULE_25__NetscriptPort_js__["a" /* NetscriptPort */])) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Could not find port: " + port + ". This is a bug contact the game developer"); } - port.push(data); - if (port.length > __WEBPACK_IMPORTED_MODULE_17__Settings_js__["a" /* Settings */].MaxPortCapacity) { - port.shift(); - return true; - } - return false; - } else if (Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["g" /* isString */])(port)) { //Write to text file + return port.write(data); + } else if (Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["g" /* isString */])(port)) { //Write to text file var fn = port; var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(workerScript.serverIp); if (server == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in write(). This is a bug please contact game dev"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in write(). This is a bug please contact game dev"); } var txtFile = Object(__WEBPACK_IMPORTED_MODULE_21__TextFile_js__["c" /* getTextFile */])(fn, server); if (txtFile == null) { @@ -29170,7 +29238,7 @@ function NetscriptFunctions(workerScript) { } return true; } else { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument passed in for write: " + port); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument passed in for write: " + port); } }, read : function(port) { @@ -29184,24 +29252,20 @@ function NetscriptFunctions(workerScript) { } if (!isNaN(port)) { //Read from port //Port 1-10 - if (port < 1 || port > 10) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Trying to read from invalid port: " + port + ". Only ports 1-10 are valid."); + port = Math.round(port); + if (port < 1 || port > __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Trying to read from invalid port: " + port + ". Only ports 1-" + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts + " are valid."); } - var portName = "Port" + String(port); - var port = __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["a" /* NetscriptPorts */][portName]; - if (port == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); + var port = __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["a" /* NetscriptPorts */][port-1]; + if (port == null || !(port instanceof __WEBPACK_IMPORTED_MODULE_25__NetscriptPort_js__["a" /* NetscriptPort */])) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); } - if (port.length === 0) { - return "NULL PORT DATA"; - } else { - return port.shift(); - } - } else if (Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["g" /* isString */])(port)) { //Read from text file + return port.read(); + } else if (Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["g" /* isString */])(port)) { //Read from text file var fn = port; var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(workerScript.serverIp); if (server == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in read(). This is a bug please contact game dev"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in read(). This is a bug please contact game dev"); } var txtFile = Object(__WEBPACK_IMPORTED_MODULE_21__TextFile_js__["c" /* getTextFile */])(fn, server); if (txtFile !== null) { @@ -29210,7 +29274,7 @@ function NetscriptFunctions(workerScript) { return ""; } } else { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument passed in for read(): " + port); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument passed in for read(): " + port); } }, peek : function(port) { @@ -29222,20 +29286,18 @@ function NetscriptFunctions(workerScript) { return __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptReadWriteRamCost; } } - if (isNaN(port) || port < 1 || port > 10) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERR: peek() called with invalid argument. Must be a port number between 1 and 10"); + if (isNaN(port)) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: peek() called with invalid argument. Must be a port number between 1 and " + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts); } - var portName = "Port" + String(port); - var port = __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["a" /* NetscriptPorts */][portName]; - if (port == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); + port = Math.round(port); + if (port < 1 || port > __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: peek() called with invalid argument. Must be a port number between 1 and " + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts); } - if (port.length === 0) { - return "NULL PORT DATA"; - } else { - var foo = port.slice(); - return foo[0]; + var port = __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["a" /* NetscriptPorts */][port-1]; + if (port == null || !(port instanceof __WEBPACK_IMPORTED_MODULE_25__NetscriptPort_js__["a" /* NetscriptPort */])) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); } + return port.peek(); }, clear : function(port) { if (workerScript.checkingRam) { @@ -29247,30 +29309,52 @@ function NetscriptFunctions(workerScript) { } } if (!isNaN(port)) { //Clear port - if (port < 1 || port > 10) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Trying to read from invalid port: " + port + ". Only ports 1-10 are valid"); + port = Math.round(port); + if (port < 1 || port > __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Trying to clear invalid port: " + port + ". Only ports 1-" + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts + " are valid"); } - var portName = "Port" + String(port); - var port = __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["a" /* NetscriptPorts */][portName]; - if (port == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); + var port = __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["a" /* NetscriptPorts */][port-1]; + if (port == null || !(port instanceof __WEBPACK_IMPORTED_MODULE_25__NetscriptPort_js__["a" /* NetscriptPort */])) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); } - port.length = 0; - } else if (Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["g" /* isString */])(port)) { //Clear text file + return port.clear(); + } else if (Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["g" /* isString */])(port)) { //Clear text file var fn = port; var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(workerScript.serverIp); if (server == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in clear(). This is a bug please contact game dev"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in clear(). This is a bug please contact game dev"); } var txtFile = Object(__WEBPACK_IMPORTED_MODULE_21__TextFile_js__["c" /* getTextFile */])(fn, server); if (txtFile != null) { txtFile.write(""); } } else { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument passed in for clear(): " + port); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid argument passed in for clear(): " + port); } return 0; }, + getPortHandle : function(port) { + if (workerScript.checkingRam) { + if (workerScript.loadedFns.getPortHandle) { + return 0; + } else { + workerScript.loadedFns.getPortHandle = true; + return __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptReadWriteRamCost * 10; + } + } + if (isNaN(port)) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Invalid argument passed into getPortHandle(). Must be an integer between 1 and " + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts); + } + port = Math.round(port); + if (port < 1 || port > __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: getPortHandle() called with invalid port number: " + port + ". Only ports 1-" + __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].NumNetscriptPorts + " are valid"); + } + var port = __WEBPACK_IMPORTED_MODULE_22__NetscriptWorker_js__["a" /* NetscriptPorts */][port-1]; + if (port == null || !(port instanceof __WEBPACK_IMPORTED_MODULE_25__NetscriptPort_js__["a" /* NetscriptPort */])) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); + } + return port; + }, rm : function(fn) { if (workerScript.checkingRam) { if (workerScript.loadedFns.rm) { @@ -29282,7 +29366,7 @@ function NetscriptFunctions(workerScript) { } var s = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(workerScript.serverIp); if (s == null) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in clear(). This is a bug please contact game dev"); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Error getting Server for this script in clear(). This is a bug please contact game dev"); } if (fn.includes(".exe")) { @@ -29309,7 +29393,7 @@ function NetscriptFunctions(workerScript) { } else if (fn.endsWith(".lit")) { for (var i = 0; i < s.messages.length; ++i) { var f = s.messages[i]; - if (!(f instanceof __WEBPACK_IMPORTED_MODULE_12__Message_js__["a" /* Message */]) && Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["g" /* isString */])(f) && f === fn) { + if (!(f instanceof __WEBPACK_IMPORTED_MODULE_12__Message_js__["a" /* Message */]) && Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["g" /* isString */])(f) && f === fn) { s.messages.splice(i, 1); return true; } @@ -29336,7 +29420,7 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("scriptRunning() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "scriptRunning() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "scriptRunning() failed. Invalid IP or hostname passed in: " + ip); } for (var i = 0; i < server.runningScripts.length; ++i) { if (server.runningScripts[i].filename == scriptname) { @@ -29357,7 +29441,7 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("scriptKill() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "scriptKill() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "scriptKill() failed. Invalid IP or hostname passed in: " + ip); } var suc = false; for (var i = 0; i < server.runningScripts.length; ++i) { @@ -29380,7 +29464,7 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getScriptRam() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getScriptRam() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getScriptRam() failed. Invalid IP or hostname passed in: " + ip); } for (var i = 0; i < server.scripts.length; ++i) { if (server.scripts[i].filename == scriptname) { @@ -29401,9 +29485,9 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getHackTime() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getHackTime() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getHackTime() failed. Invalid IP or hostname passed in: " + ip); } - return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["j" /* scriptCalculateHackingTime */])(server); //Returns seconds + return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["k" /* scriptCalculateHackingTime */])(server); //Returns seconds }, getGrowTime : function(ip) { if (workerScript.checkingRam) { @@ -29417,9 +29501,9 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getGrowTime() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getGrowTime() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getGrowTime() failed. Invalid IP or hostname passed in: " + ip); } - return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["h" /* scriptCalculateGrowTime */])(server) / 1000; //Returns seconds + return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["i" /* scriptCalculateGrowTime */])(server) / 1000; //Returns seconds }, getWeakenTime : function(ip) { if (workerScript.checkingRam) { @@ -29433,9 +29517,9 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getWeakenTime() failed. Invalid IP or hostname passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getWeakenTime() failed. Invalid IP or hostname passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getWeakenTime() failed. Invalid IP or hostname passed in: " + ip); } - return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["l" /* scriptCalculateWeakenTime */])(server) / 1000; //Returns seconds + return Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["m" /* scriptCalculateWeakenTime */])(server) / 1000; //Returns seconds }, getScriptIncome : function(scriptname, ip) { if (workerScript.checkingRam) { @@ -29457,7 +29541,7 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getScriptIncome() failed. Invalid IP or hostnamed passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getScriptIncome() failed. Invalid IP or hostnamed passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getScriptIncome() failed. Invalid IP or hostnamed passed in: " + ip); } var argsForScript = []; for (var i = 2; i < arguments.length; ++i) { @@ -29465,7 +29549,7 @@ function NetscriptFunctions(workerScript) { } var runningScriptObj = Object(__WEBPACK_IMPORTED_MODULE_15__Script_js__["d" /* findRunningScript */])(scriptname, argsForScript, server); if (runningScriptObj == null) { - workerScript.scriptRef.log("getScriptIncome() failed. No such script "+ scriptname + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_27__utils_HelperFunctions_js__["j" /* printArray */])(argsForScript)); + workerScript.scriptRef.log("getScriptIncome() failed. No such script "+ scriptname + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_28__utils_HelperFunctions_js__["j" /* printArray */])(argsForScript)); return -1; } return runningScriptObj.onlineMoneyMade / runningScriptObj.onlineRunningTime; @@ -29491,7 +29575,7 @@ function NetscriptFunctions(workerScript) { var server = Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["e" /* getServer */])(ip); if (server == null) { workerScript.scriptRef.log("getScriptExpGain() failed. Invalid IP or hostnamed passed in: " + ip); - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "getScriptExpGain() failed. Invalid IP or hostnamed passed in: " + ip); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "getScriptExpGain() failed. Invalid IP or hostnamed passed in: " + ip); } var argsForScript = []; for (var i = 2; i < arguments.length; ++i) { @@ -29499,7 +29583,7 @@ function NetscriptFunctions(workerScript) { } var runningScriptObj = Object(__WEBPACK_IMPORTED_MODULE_15__Script_js__["d" /* findRunningScript */])(scriptname, argsForScript, server); if (runningScriptObj == null) { - workerScript.scriptRef.log("getScriptExpGain() failed. No such script "+ scriptname + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_27__utils_HelperFunctions_js__["j" /* printArray */])(argsForScript)); + workerScript.scriptRef.log("getScriptExpGain() failed. No such script "+ scriptname + " on " + server.hostname + " with args: " + Object(__WEBPACK_IMPORTED_MODULE_28__utils_HelperFunctions_js__["j" /* printArray */])(argsForScript)); return -1; } return runningScriptObj.onlineExpGained / runningScriptObj.onlineRunningTime; @@ -29518,24 +29602,24 @@ function NetscriptFunctions(workerScript) { }, prompt : function(txt) { if (workerScript.checkingRam) {return 0;} - if (__WEBPACK_IMPORTED_MODULE_30__utils_YesNoBox_js__["e" /* yesNoBoxOpen */]) { + if (__WEBPACK_IMPORTED_MODULE_31__utils_YesNoBox_js__["e" /* yesNoBoxOpen */]) { workerScript.scriptRef.log("ERROR: confirm() failed because a pop-up dialog box is already open"); return false; } - if (!Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["g" /* isString */])(txt)) {txt = String(txt);} - var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_30__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), noBtn = Object(__WEBPACK_IMPORTED_MODULE_30__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); + if (!Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["g" /* isString */])(txt)) {txt = String(txt);} + var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_31__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), noBtn = Object(__WEBPACK_IMPORTED_MODULE_31__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); yesBtn.innerHTML = "Yes"; noBtn.innerHTML = "No"; return new Promise(function(resolve, reject) { yesBtn.addEventListener("click", ()=>{ - Object(__WEBPACK_IMPORTED_MODULE_30__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + Object(__WEBPACK_IMPORTED_MODULE_31__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); resolve(true); }); noBtn.addEventListener("click", ()=>{ - Object(__WEBPACK_IMPORTED_MODULE_30__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + Object(__WEBPACK_IMPORTED_MODULE_31__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); resolve(false); }); - Object(__WEBPACK_IMPORTED_MODULE_30__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])(txt); + Object(__WEBPACK_IMPORTED_MODULE_31__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])(txt); }); }, @@ -29547,13 +29631,13 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.universityCourse = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 1)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run universityCourse(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run universityCourse(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); return false; } } @@ -29640,13 +29724,13 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.gymWorkout = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 1)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run gymWorkout(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run gymWorkout(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); return false; } } @@ -29745,14 +29829,14 @@ function NetscriptFunctions(workerScript) { return 0; } else { workerScript.loadedFns.travelToCity = true; - var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost / 2; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 1)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run travelToCity(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run travelToCity(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); return false; } } @@ -29784,13 +29868,13 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.purchaseTor = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 1)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run purchaseTor(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run purchaseTor(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); return false; } } @@ -29806,7 +29890,7 @@ function NetscriptFunctions(workerScript) { } __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].loseMoney(__WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].TorRouterCost); - var darkweb = new __WEBPACK_IMPORTED_MODULE_16__Server_js__["d" /* Server */](Object(__WEBPACK_IMPORTED_MODULE_28__utils_IPAddress_js__["a" /* createRandomIp */])(), "darkweb", "", false, false, false, 1); + var darkweb = new __WEBPACK_IMPORTED_MODULE_16__Server_js__["d" /* Server */](Object(__WEBPACK_IMPORTED_MODULE_29__utils_IPAddress_js__["a" /* createRandomIp */])(), "darkweb", "", false, false, false, 1); Object(__WEBPACK_IMPORTED_MODULE_16__Server_js__["a" /* AddToAllServers */])(darkweb); __WEBPACK_IMPORTED_MODULE_18__SpecialServerIps_js__["a" /* SpecialServerIps */].addIp("Darkweb Server", darkweb.ip); @@ -29827,13 +29911,13 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.purchaseProgram = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 1)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run purchaseProgram(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run purchaseProgram(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); return false; } } @@ -29947,14 +30031,14 @@ function NetscriptFunctions(workerScript) { return 0; } else { workerScript.loadedFns.getStats = true; - var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost / 4; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 1)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getStats(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getStats(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); return {}; } } @@ -29969,20 +30053,61 @@ function NetscriptFunctions(workerScript) { intelligence: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].intelligence } }, + getCharacterInformation : function() { + if (workerScript.checkingRam) { + if (workerScript.loadedFns.getCharacterInformation) { + return 0; + } else { + workerScript.loadedFns.getCharacterInformation = true; + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost / 4; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} + return ramCost; + } + } + + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { + if (!(hasSingularitySF && singularitySFLvl >= 1)) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getCharacterInformation(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + return {}; + } + } + + var companyPositionTitle = ""; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].companyPosition instanceof __WEBPACK_IMPORTED_MODULE_4__Company_js__["c" /* CompanyPosition */]) { + companyPositionTitle = __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].companyPosition.positionName; + } + return { + bitnode: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN, + company: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].companyName, + jobTitle: companyPositionTitle, + city: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].city, + factions: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].factions.slice(), + tor: __WEBPACK_IMPORTED_MODULE_18__SpecialServerIps_js__["a" /* SpecialServerIps */].hasOwnProperty("Darkweb Server"), + timeWorked: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].timeWorked, + workHackExpGain: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].workHackExpGained, + workStrExpGain: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].workStrExpGained, + workDefExpGain: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].workDefExpGained, + workDexExpGain: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].workDexExpGained, + workAgiExpGain: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].workAgiExpGained, + workChaExpGain: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].workChaExpGained, + workRepGain: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].workRepGained, + workMoneyGain: __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].workMoneyGained, + }; + }, isBusy : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.isBusy) { return 0; } else { workerScript.loadedFns.isBusy = true; - var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost / 4; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 1)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run isBusy(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run isBusy(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); return; } } @@ -29994,11 +30119,17 @@ function NetscriptFunctions(workerScript) { return 0; } else { workerScript.loadedFns.stopAction = true; - var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn1RamCost / 2; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { + if (!(hasSingularitySF && singularitySFLvl >= 1)) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run stopAction(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + return false; + } + } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].isWorking) { var txt = __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].singularityStopWork(); if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.stopAction == null) { @@ -30008,20 +30139,20 @@ function NetscriptFunctions(workerScript) { } return false; }, - upgradeHomeRam() { + upgradeHomeRam : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.upgradeHomeRam) { return 0; } else { workerScript.loadedFns.upgradeHomeRam = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run upgradeHomeRam(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run upgradeHomeRam(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); return false; } } @@ -30052,20 +30183,20 @@ function NetscriptFunctions(workerScript) { } return true; }, - getUpgradeHomeRamCost() { + getUpgradeHomeRamCost : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.getUpgradeHomeRamCost) { return 0; } else { workerScript.loadedFns.getUpgradeHomeRamCost = true; - var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost / 2; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getUpgradeHomeRamCost(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getUpgradeHomeRamCost(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); return false; } } @@ -30080,20 +30211,20 @@ function NetscriptFunctions(workerScript) { var mult = Math.pow(1.55, numUpgrades); return cost * mult; }, - workForCompany() { + workForCompany : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.workForCompany) { return 0; } else { workerScript.loadedFns.workForCompany = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run workForCompany(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run workForCompany(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); return false; } } @@ -30125,20 +30256,20 @@ function NetscriptFunctions(workerScript) { } return true; }, - applyToCompany(companyName, field) { + applyToCompany : function(companyName, field) { if (workerScript.checkingRam) { if (workerScript.loadedFns.applyToCompany) { return 0; } else { workerScript.loadedFns.applyToCompany = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run applyToCompany(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run applyToCompany(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); return false; } } @@ -30195,7 +30326,7 @@ function NetscriptFunctions(workerScript) { return false; } //The Player object's applyForJob function can return string with special error messages - if (Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["g" /* isString */])(res)) { + if (Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["g" /* isString */])(res)) { workerScript.scriptRef.log(res); return false; } @@ -30210,20 +30341,20 @@ function NetscriptFunctions(workerScript) { } return res; }, - getCompanyRep(companyName) { + getCompanyRep : function(companyName) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getCompanyRep) { return 0; } else { workerScript.loadedFns.getCompanyRep = true; - var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost / 4; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getCompanyRep(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getCompanyRep(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); return false; } } @@ -30235,40 +30366,65 @@ function NetscriptFunctions(workerScript) { } return company.playerReputation; }, - checkFactionInvitations() { + getCompanyFavor : function(companyName) { + if (workerScript.checkingRam) { + if (workerScript.loadedFns.getCompanyFavor) { + return 0; + } else { + workerScript.loadedFns.getCompanyFavor = true; + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost / 4; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} + return ramCost; + } + } + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { + if (!(hasSingularitySF && singularitySFLvl >= 2)) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getCompanyFavor(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + return false; + } + } + + var company = __WEBPACK_IMPORTED_MODULE_4__Company_js__["a" /* Companies */][companyName]; + if (company == null || !(company instanceof __WEBPACK_IMPORTED_MODULE_4__Company_js__["b" /* Company */])) { + workerScript.scriptRef.log("ERROR: Invalid companyName passed into getCompanyFavor(): " + companyName); + return -1; + } + return company.favor; + }, + checkFactionInvitations : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.checkFactionInvitations) { return 0; } else { workerScript.loadedFns.checkFactionInvitations = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run checkFactionInvitations(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run checkFactionInvitations(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); return false; } } //Make a copy of Player.factionInvitations return __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].factionInvitations.slice(); }, - joinFaction(name) { + joinFaction : function(name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.joinFaction) { return 0; } else { workerScript.loadedFns.joinFaction = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run joinFaction(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run joinFaction(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); return false; } } @@ -30298,20 +30454,20 @@ function NetscriptFunctions(workerScript) { } return true; }, - workForFaction(name, type) { + workForFaction : function(name, type) { if (workerScript.checkingRam) { if (workerScript.loadedFns.workForFaction) { return 0; } else { workerScript.loadedFns.workForFaction = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run workForFaction(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run workForFaction(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); return false; } } @@ -30396,20 +30552,20 @@ function NetscriptFunctions(workerScript) { } return true; }, - getFactionRep(name) { + getFactionRep : function(name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getFactionRep) { return 0; } else { workerScript.loadedFns.getFactionRep = true; - var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost / 4; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 2)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getFactionRep(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getFactionRep(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); return -1; } } @@ -30421,20 +30577,45 @@ function NetscriptFunctions(workerScript) { return __WEBPACK_IMPORTED_MODULE_9__Faction_js__["b" /* Factions */][name].playerReputation; }, - createProgram(name) { + getFactionFavor : function(name) { + if (workerScript.checkingRam) { + if (workerScript.loadedFns.getFactionFavor) { + return 0; + } else { + workerScript.loadedFns.getFactionFavor = true; + var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn2RamCost / 4; + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} + return ramCost; + } + } + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { + if (!(hasSingularitySF && singularitySFLvl >= 2)) { + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getFactionFavor(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + return -1; + } + } + + if (!Object(__WEBPACK_IMPORTED_MODULE_9__Faction_js__["d" /* factionExists */])(name)) { + workerScript.scriptRef.log("ERROR: Faction specified in getFactionFavor() does not exist."); + return -1; + } + + return __WEBPACK_IMPORTED_MODULE_9__Faction_js__["b" /* Factions */][name].favor; + }, + createProgram : function(name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.createProgram) { return 0; } else { workerScript.loadedFns.createProgram = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn3RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run createProgram(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run createProgram(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); return false; } } @@ -30530,13 +30711,13 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.commitCrime = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn3RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run commitCrime(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run commitCrime(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); return; } } @@ -30613,23 +30794,23 @@ function NetscriptFunctions(workerScript) { workerScript.scriptRef.log("Attempting to pull off a heist..."); return Object(__WEBPACK_IMPORTED_MODULE_3__Crimes_js__["e" /* commitHeistCrime */])(__WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].CrimeSingFnDivider, {workerscript: workerScript}); } else { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid crime passed into commitCrime(): " + crime); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid crime passed into commitCrime(): " + crime); } }, - getCrimeChance(crime) { + getCrimeChance : function(crime) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getCrimeChance) { return 0; } else { workerScript.loadedFns.getCrimeChance = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn3RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getCrimeChance(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getCrimeChance(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); return; } } @@ -30660,23 +30841,23 @@ function NetscriptFunctions(workerScript) { } else if (crime.includes("heist")) { return Object(__WEBPACK_IMPORTED_MODULE_3__Crimes_js__["q" /* determineCrimeChanceHeist */])(); } else { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Invalid crime passed into getCrimeChance(): " + crime); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Invalid crime passed into getCrimeChance(): " + crime); } }, - getOwnedAugmentations(purchased=false) { + getOwnedAugmentations : function(purchased=false) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getOwnedAugmentations) { return 0; } else { workerScript.loadedFns.getOwnedAugmentations = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn3RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getOwnedAugmentations(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getOwnedAugmentations(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); return []; } } @@ -30691,20 +30872,20 @@ function NetscriptFunctions(workerScript) { } return res; }, - getAugmentationsFromFaction(facname) { + getAugmentationsFromFaction : function(facname) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getAugmentationsFromFaction) { return 0; } else { workerScript.loadedFns.getAugmentationsFromFaction = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn3RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getAugmentationsFromFaction(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getAugmentationsFromFaction(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); return []; } } @@ -30721,20 +30902,20 @@ function NetscriptFunctions(workerScript) { } return res; }, - getAugmentationCost(name) { + getAugmentationCost : function(name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getAugmentationCost) { return 0; } else { workerScript.loadedFns.getAugmentationCost = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn3RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getAugmentationCost(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run getAugmentationCost(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); return false; } } @@ -30747,20 +30928,20 @@ function NetscriptFunctions(workerScript) { var aug = __WEBPACK_IMPORTED_MODULE_1__Augmentations_js__["c" /* Augmentations */][name]; return [aug.baseRepRequirement, aug.baseCost]; }, - purchaseAugmentation(faction, name) { + purchaseAugmentation : function(faction, name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.purchaseAugmentation) { return 0; } else { workerScript.loadedFns.purchaseAugmentation = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn3RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run purchaseAugmentation(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run purchaseAugmentation(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); return false; } } @@ -30809,27 +30990,27 @@ function NetscriptFunctions(workerScript) { var res = Object(__WEBPACK_IMPORTED_MODULE_9__Faction_js__["k" /* purchaseAugmentation */])(aug, fac, true); workerScript.scriptRef.log(res); - if (Object(__WEBPACK_IMPORTED_MODULE_29__utils_StringHelperFunctions_js__["g" /* isString */])(res) && res.startsWith("You purchased")) { + if (Object(__WEBPACK_IMPORTED_MODULE_30__utils_StringHelperFunctions_js__["g" /* isString */])(res) && res.startsWith("You purchased")) { __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].gainIntelligenceExp(__WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].IntelligenceSingFnBaseExpGain); return true; } else { return false; } }, - installAugmentations(cbScript) { + installAugmentations : function(cbScript) { if (workerScript.checkingRam) { if (workerScript.loadedFns.installAugmentations) { return 0; } else { workerScript.loadedFns.installAugmentations = true; var ramCost = __WEBPACK_IMPORTED_MODULE_5__Constants_js__["a" /* CONSTANTS */].ScriptSingularityFn3RamCost; - if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 10;} + if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } if (__WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].bitNodeN != 4) { if (!(hasSingularitySF && singularitySFLvl >= 3)) { - throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run installAugmentations(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); + throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["e" /* makeRuntimeRejectMsg */])(workerScript, "Cannot run installAugmentations(). It is a Singularity Function and requires SourceFile-4 (level 3) to run."); return false; } } @@ -36877,7 +37058,7 @@ function iTutorialSetText(txt) { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__ = __webpack_require__(2); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_StringHelperFunctions_js__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_jsplumb__ = __webpack_require__(68); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_jsplumb__ = __webpack_require__(69); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_jsplumb___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_jsplumb__); @@ -39875,19 +40056,21 @@ function logBoxUpdateText() { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Corporation; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__engine_js__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Literature_js__ = __webpack_require__(32); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Location_js__ = __webpack_require__(12); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Player_js__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js__ = __webpack_require__(24); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__utils_decimal_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BitNode_js__ = __webpack_require__(8); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__engine_js__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Literature_js__ = __webpack_require__(32); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Location_js__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Player_js__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__utils_decimal_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js__ = __webpack_require__(17); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__ = __webpack_require__(13); + @@ -39923,14 +40106,14 @@ CorporationState.prototype.getState = function() { } CorporationState.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["b" /* Generic_toJSON */])("CorporationState", this); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["b" /* Generic_toJSON */])("CorporationState", this); } CorporationState.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(CorporationState, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(CorporationState, value.data); } -__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["c" /* Reviver */].constructors.CorporationState = CorporationState; +__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["c" /* Reviver */].constructors.CorporationState = CorporationState; /* Constants */ var TOTALSHARES = 1e9; //Total number of shares you have at your company @@ -39946,6 +40129,9 @@ var OfficeInitialCost = 4e9; var OfficeInitialSize = 3; var OfficeUpgradeBaseCost = 1e9; +var BribeThreshold = 100e12; //Money needed to be able to bribe for faction rep +var BribeToRepRatio = 1e9; //Bribe Value divided by this = rep gain + function Material(params={}) { this.name = params.name ? params.name : ""; this.qty = 0; //Quantity @@ -39983,67 +40169,67 @@ Material.prototype.init = function(mats={}) { this.dmd = 75; this.dmdR = [65, 85]; this.cmp = 50; this.cmpR = [40, 60]; this.bCost = 1000; this.mv = 0.2; - this.mku = 12; + this.mku = 6; break; case "Energy": this.dmd = 90; this.dmdR = [80, 100]; this.cmp = 80; this.cmpR = [65, 95]; this.bCost = 1500; this.mv = 0.2; - this.mku = 12; + this.mku = 6; break; case "Food": this.dmd = 80; this.dmdR = [70, 90]; this.cmp = 60; this.cmpR = [35, 85]; this.bCost = 5000; this.mv = 1; - this.mku = 7.5; + this.mku = 3; break; case "Plants": this.dmd = 70; this.dmdR = [20, 90]; this.cmp = 50; this.cmpR = [30, 70]; this.bCost = 3000; this.mv = 0.6; - this.mku = 10; + this.mku = 3.75; break; case "Metal": this.dmd = 80; this.dmdR = [75, 85]; this.cmp = 70; this.cmpR = [60, 80]; this.bCost = 2650; this.mv = 1; - this.mku = 12; + this.mku = 6; break; case "Hardware": this.dmd = 85; this.dmdR = [80, 90]; this.cmp = 80; this.cmpR = [65, 95]; this.bCost = 4000; this.mv = 0.5; //Less mv bc its processed twice - this.mku = 5.5; + this.mku = 1; break; case "Chemicals": this.dmd = 55; this.dmdR = [40, 70]; this.cmp = 60; this.cmpR = [40, 80]; this.bCost = 6750; this.mv = 1.2; - this.mku = 6.5; + this.mku = 2; break; case "Real Estate": this.dmd = 50; this.dmdR = [5, 100]; this.cmp = 50; this.cmpR = [25, 75]; this.bCost = 16e3; this.mv = 1.5; //Less mv bc its processed twice - this.mku = 5; + this.mku = 1.5; break; case "Drugs": this.dmd = 60; this.dmdR = [45, 75]; this.cmp = 70; this.cmpR = [40, 100]; this.bCost = 8e3; this.mv = 1.6; - this.mku = 4; + this.mku = 1; break; case "Robots": this.dmd = 90; this.dmdR = [80, 100]; this.cmp = 90; this.cmpR = [80, 100]; this.bCost = 20e3; this.mv = 0.5; //Less mv bc its processed twice - this.mku = 2.5; + this.mku = 1; break; case "AI Cores": this.dmd = 90; this.dmdR = [80, 100]; this.cmp = 90; this.cmpR = [80, 100]; this.bCost = 27e3; this.mv = 0.8; //Less mv bc its processed twice - this.mku = 1.8; + this.mku = 0.5; break; case "Scientific Research": break; @@ -40085,14 +40271,14 @@ Material.prototype.processMarket = function() { } Material.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Material", this); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Material", this); } Material.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Material, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Material, value.data); } -__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["c" /* Reviver */].constructors.Material = Material; +__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["c" /* Reviver */].constructors.Material = Material; //Map of material (by name) to their sizes (how much space it takes in warehouse) let MaterialSizes = { @@ -40139,12 +40325,12 @@ function Product(params={}) { //These values are specific to a city //The data is [qty, prod, sell] this.data = { - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Aevum]: [0, 0, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Chongqing]: [0, 0, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12]: [0, 0, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].NewTokyo]: [0, 0, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Ishima]: [0, 0, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Volhaven]: [0, 0, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Aevum]: [0, 0, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Chongqing]: [0, 0, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Sector12]: [0, 0, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].NewTokyo]: [0, 0, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Ishima]: [0, 0, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Volhaven]: [0, 0, 0], } //Only applies for location-based products like restaurants/hospitals @@ -40159,21 +40345,21 @@ function Product(params={}) { //[Whether production/sale is limited, limit amount] this.prdman = { - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Aevum]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Chongqing]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].NewTokyo]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Ishima]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Volhaven]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Aevum]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Chongqing]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Sector12]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].NewTokyo]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Ishima]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Volhaven]: [false, 0], } this.sllman = { - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Aevum]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Chongqing]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].NewTokyo]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Ishima]: [false, 0], - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Volhaven]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Aevum]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Chongqing]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Sector12]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].NewTokyo]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Ishima]: [false, 0], + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Volhaven]: [false, 0], } } @@ -40234,10 +40420,9 @@ Product.prototype.finishProduct = function(employeeProd, industry) { (0.05 * employeeProd[EmployeePositions.Business])); this.calculateRating(industry); var advMult = 1 + (Math.pow(this.advCost, 0.1) / 100); - console.log("advMult: " + advMult); - this.mku = 100 / (advMult * Math.pow((this.qlt + 0.001), 0.9) * (busRatio + mgmtRatio)); + this.mku = 100 / (advMult * Math.pow((this.qlt + 0.001), 0.75) * (busRatio + mgmtRatio)); this.dmd = industry.awareness === 0 ? 20 : Math.min(100, advMult * (100 * (industry.popularity / industry.awareness))); - this.cmp = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(0, 70); + this.cmp = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(0, 70); //Calculate the product's required materials //For now, just set it to be the same as the requirements to make materials @@ -40278,14 +40463,14 @@ Product.prototype.calculateRating = function(industry) { } Product.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Product", this); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Product", this); } Product.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Product, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Product, value.data); } -__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["c" /* Reviver */].constructors.Product = Product; +__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["c" /* Reviver */].constructors.Product = Product; var Industries = { Energy: "Energy", @@ -40323,46 +40508,46 @@ var IndustryStartingCosts = { var IndustryDescriptions = { Energy: "Engage in the production and distribution of energy.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Energy).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Energy).format("$0.000a") + "
" + "Recommended starting Industry: NO", Utilities: "Distributes water and provides wastewater services.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Utilities).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Utilities).format("$0.000a") + "
" + "Recommended starting Industry: NO", Agriculture: "Cultive crops and breed livestock to produce food.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Agriculture).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Agriculture).format("$0.000a") + "
" + "Recommended starting Industry: YES", Fishing: "Produce food through the breeding and processing of fish and fish products

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Fishing).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Fishing).format("$0.000a") + "
" + "Recommended starting Industry: NO", Mining: "Extract and process metals from the earth.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Mining).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Mining).format("$0.000a") + "
" + "Recommended starting Industry: NO", Food: "Create your own restaurants all around the world.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Food).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Food).format("$0.000a") + "
" + "Recommended starting Industry: YES", Tobacco: "Create and distribute tobacco and tobacco-related products.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Tobacco).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Tobacco).format("$0.000a") + "
" + "Recommended starting Industry: YES", Chemical: "Product industrial chemicals

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Chemical).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Chemical).format("$0.000a") + "
" + "Recommended starting Industry: NO", Pharmaceutical: "Discover, develop, and create new pharmaceutical drugs.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Pharmaceutical).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Pharmaceutical).format("$0.000a") + "
" + "Recommended starting Industry: NO", Computer: "Develop and manufacture new computer hardware and networking infrastructures.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Computer).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Computer).format("$0.000a") + "
" + "Recommended starting Industry: NO", Robotics: "Develop and create robots.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Robotics).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Robotics).format("$0.000a") + "
" + "Recommended starting Industry: NO", Software: "Develop computer software and create AI Cores.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Software).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Software).format("$0.000a") + "
" + "Recommended starting Industry: YES", Healthcare: "Create and manage hospitals.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.Healthcare).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.Healthcare).format("$0.000a") + "
" + "Recommended starting Industry: NO", RealEstate: "Develop and manuage real estate properties.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(IndustryStartingCosts.RealEstate).format("$0.000a") + "
" + + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(IndustryStartingCosts.RealEstate).format("$0.000a") + "
" + "Recommended starting Industry: NO", } @@ -40430,38 +40615,38 @@ var ProductRatingWeights = { var IndustryUpgrades = { "0": [0, 500e3, 1, 1.05, "Coffee", "Provide your employees with coffee, increasing their energy by 5%."], - "1": [1, 1e9, 1.02, 1.01, + "1": [1, 1e9, 1.03, 1.03, "AdVert.Inc", "Hire AdVert.Inc to advertise your company. Each level of " + "this upgrade grants your company a static increase of 4 and 1 to its awareness and " + "popularity, respectively. It will then increase your company's awareness by 1%, and its popularity " + - "by a random percentage between 5% and 10%. These effects are increased by other upgrades " + + "by a random percentage between 3% and 6%. These effects are increased by other upgrades " + "that increase the power of your advertising."] } var empManualAssignmentModeActive = false; function Industry(params={}) { this.offices = { //Maps locations to offices. 0 if no office at that location - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Aevum]: 0, - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Chongqing]: 0, - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12]: new OfficeSpace({ - loc:__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Aevum]: 0, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Chongqing]: 0, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Sector12]: new OfficeSpace({ + loc:__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Sector12, size:OfficeInitialSize, }), - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].NewTokyo]: 0, - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Ishima]: 0, - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Volhaven]: 0 + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].NewTokyo]: 0, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Ishima]: 0, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Volhaven]: 0 }; this.warehouses = { //Maps locations to warehouses. 0 if no warehouse at that location - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Aevum]: 0, - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Chonqing]: 0, - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12]: new Warehouse({ - loc:__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Aevum]: 0, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Chonqing]: 0, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Sector12]: new Warehouse({ + loc:__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Sector12, size: WarehouseInitialSize, }), - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].NewTokyo]: 0, - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Ishima]: 0, - [__WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Volhaven]: 0 + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].NewTokyo]: 0, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Ishima]: 0, + [__WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Volhaven]: 0 }; this.name = params.name ? params.name : 0; @@ -40498,16 +40683,17 @@ function Industry(params={}) { this.prodMult = 0; //Production multiplier //Financials - this.lastCycleRevenue = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); - this.lastCycleExpenses = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); - this.thisCycleRevenue = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); - this.thisCycleExpenses = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); + this.lastCycleRevenue = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); + this.lastCycleExpenses = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); + this.thisCycleRevenue = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); + this.thisCycleExpenses = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); //Upgrades var numUpgrades = Object.keys(IndustryUpgrades).length; this.upgrades = Array(numUpgrades).fill(0); this.state = "START"; + this.newInd = true; this.init(); } @@ -40788,14 +40974,18 @@ Industry.prototype.process = function(marketCycles=1, state, company) { console.log("ERROR: NaN in Corporation's computed revenue/expenses"); console.log(this.thisCycleRevenue.toString()); console.log(this.thisCycleExpenses.toString()); - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer"); - this.thisCycleRevenue = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); - this.thisCycleExpenses = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer"); + this.thisCycleRevenue = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); + this.thisCycleExpenses = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); } this.lastCycleRevenue = this.thisCycleRevenue.dividedBy(marketCycles * SecsPerMarketCycle); this.lastCycleExpenses = this.thisCycleExpenses.dividedBy(marketCycles * SecsPerMarketCycle); - this.thisCycleRevenue = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); - this.thisCycleExpenses = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); + this.thisCycleRevenue = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); + this.thisCycleExpenses = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); + + //Once you start making revenue, the player should no longer be + //considered new, and therefore no longer needs the 'tutorial' UI elements + if (this.lastCycleRevenue.gt(0)) {this.newInd = false;} //Process offices (and the employees in them) var employeeSalary = 0; @@ -40874,7 +41064,7 @@ Industry.prototype.processProductMarket = function(marketCycles=1) { for (var name in this.products) { if (this.products.hasOwnProperty(name)) { var product = this.products[name]; - var change = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(1, 3) * 0.0004; + var change = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(1, 3) * 0.0004; if (this.type === Industries.Pharmaceutical || this.type === Industries.Software || this.type === Industries.Robotics) { change *= 3; @@ -41022,7 +41212,7 @@ Industry.prototype.processMaterials = function(marketCycles=1, company) { var mat = warehouse.materials[matName]; var sCost; - if (Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["g" /* isString */])(mat.sCost)) { + if (Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["g" /* isString */])(mat.sCost)) { sCost = mat.sCost.replace(/MP/g, mat.bCost); sCost = eval(sCost); } else { @@ -41138,7 +41328,9 @@ Industry.prototype.processProducts = function(marketCycles=1, corporation) { var prod = this.products[prodName]; if (!prod.fin) { var city = prod.createCity, office = this.offices[city]; - var total = office.employeeProd["total"], ratio; + var total = office.employeeProd[EmployeePositions.Operations] + + office.employeeProd[EmployeePositions.Engineer] + + office.employeeProd[EmployeePositions.Management], ratio; if (total === 0) { ratio = 0; } else { @@ -41319,7 +41511,7 @@ Industry.prototype.upgrade = function(upgrade, refs) { this.awareness += (4 * advMult); this.popularity += (1 * advMult); this.awareness *= (1.01 * advMult); - this.popularity *= ((1 + Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(5, 10) / 100) * advMult); + this.popularity *= ((1 + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(3, 6) / 100) * advMult); break; default: console.log("ERROR: Un-implemented function index: " + upgN); @@ -41373,14 +41565,14 @@ Industry.prototype.getMarketFactor = function(mat) { } Industry.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Industry", this); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Industry", this); } Industry.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Industry, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Industry, value.data); } -__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["c" /* Reviver */].constructors.Industry = Industry; +__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["c" /* Reviver */].constructors.Industry = Industry; var EmployeePositions = { Operations: "Operations", @@ -41399,17 +41591,17 @@ function Employee(params={}) { this.name = params.name ? params.name : "Bobby"; //Morale, happiness, and energy are 0-100 - this.mor = params.morale ? params.morale : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); - this.hap = params.happiness ? params.happiness : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); - this.ene = params.energy ? params.energy : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); + this.mor = params.morale ? params.morale : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); + this.hap = params.happiness ? params.happiness : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); + this.ene = params.energy ? params.energy : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); - this.age = params.age ? params.age : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(20, 50); - this.int = params.intelligence ? params.intelligence : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.cha = params.charisma ? params.charisma : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.exp = params.experience ? params.experience : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.cre = params.creativity ? params.creativity : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.eff = params.efficiency ? params.efficiency : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.sal = params.salary ? params.salary : Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(0.1, 5); + this.age = params.age ? params.age : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(20, 50); + this.int = params.intelligence ? params.intelligence : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.cha = params.charisma ? params.charisma : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.exp = params.experience ? params.experience : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.cre = params.creativity ? params.creativity : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.eff = params.efficiency ? params.efficiency : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.sal = params.salary ? params.salary : Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(0.1, 5); this.pro = 0; //Productivity, This is calculated this.loc = params.loc ? params.loc : ""; @@ -41509,25 +41701,25 @@ Employee.prototype.createUI = function(panel, corporation) { effInt = this.int * corporation.getEmployeeIntMultiplier(), effEff = this.eff * corporation.getEmployeeEffMultiplier(); panel.style.color = "white"; - panel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + panel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { id:"cmpy-mgmt-employee-" + this.name + "-panel-text", - innerHTML:"Morale: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.mor, 3) + "
" + - "Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.hap, 3) + "
" + - "Energy: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.ene, 3) + "
" + - "Age: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.age, 3) + "
" + - "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effInt, 3) + "
" + - "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effCha, 3) + "
" + - "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.exp, 3) + "
" + - "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effCre, 3) + "
" + - "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effEff, 3) + "
" + - "Salary: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(this.sal).format("$0.000a") + "/ s
", + innerHTML:"Morale: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.mor, 3) + "
" + + "Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.hap, 3) + "
" + + "Energy: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.ene, 3) + "
" + + "Age: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.age, 3) + "
" + + "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effInt, 3) + "
" + + "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effCha, 3) + "
" + + "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.exp, 3) + "
" + + "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effCre, 3) + "
" + + "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effEff, 3) + "
" + + "Salary: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(this.sal).format("$0.000a") + "/ s
", })); //Selector for employee position - var selector = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); + var selector = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); for (var key in EmployeePositions) { if (EmployeePositions.hasOwnProperty(key)) { - selector.add(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("option", { + selector.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option", { text: EmployeePositions[key], value: EmployeePositions[key], })); @@ -41561,27 +41753,27 @@ Employee.prototype.updateUI = function(panel, corporation) { if (text == null) { return this.createUI(panel); } - text.innerHTML = "Morale: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.mor, 3) + "
" + - "Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.hap, 3) + "
" + - "Energy: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.ene, 3) + "
" + - "Age: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.age, 3) + "
" + - "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effInt, 3) + "
" + - "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effCha, 3) + "
" + - "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.exp, 3) + "
" + - "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effCre, 3) + "
" + - "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effEff, 3) + "
" + - "Salary: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(this.sal).format("$0.000a") + "/ s
"; + text.innerHTML = "Morale: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.mor, 3) + "
" + + "Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.hap, 3) + "
" + + "Energy: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.ene, 3) + "
" + + "Age: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.age, 3) + "
" + + "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effInt, 3) + "
" + + "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effCha, 3) + "
" + + "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.exp, 3) + "
" + + "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effCre, 3) + "
" + + "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(effEff, 3) + "
" + + "Salary: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(this.sal).format("$0.000a") + "/ s
"; } Employee.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Employee", this); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Employee", this); } Employee.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Employee, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Employee, value.data); } -__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["c" /* Reviver */].constructors.Employee = Employee; +__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["c" /* Reviver */].constructors.Employee = Employee; var OfficeSpaceTiers = { Basic: "Basic", @@ -41658,14 +41850,14 @@ OfficeSpace.prototype.findEmployees = function(parentRefs) { if (document.getElementById("cmpy-mgmt-hire-employee-popup") != null) {return;} //Generate three random employees (meh, decent, amazing) - var mult1 = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(25, 50)/100, - mult2 = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(51, 75)/100, - mult3 = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(76, 100)/100; - var int = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - cha = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - exp = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - cre = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - eff = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + var mult1 = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(25, 50)/100, + mult2 = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(51, 75)/100, + mult3 = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(76, 100)/100; + var int = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + cha = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + exp = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + cre = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + eff = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), sal = 2.2 * (int + cha + exp + cre + eff); var emp1 = new Employee({ @@ -41695,34 +41887,34 @@ OfficeSpace.prototype.findEmployees = function(parentRefs) { salary: sal * mult3, }); - var text = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("h1", { + var text = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("h1", { innerHTML: "Select one of the following candidates for hire:", }); var createEmpDiv = function(employee, office) { - var div = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var div = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-find-employee-option", - innerHTML: "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.int, 1) + "
" + - "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.cha, 1) + "
" + - "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.exp, 1) + "
" + - "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.cre, 1) + "
" + - "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.eff, 1) + "
" + - "Salary: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(employee.sal).format('$0.000a') + " \ s
", + innerHTML: "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.int, 1) + "
" + + "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.cha, 1) + "
" + + "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.exp, 1) + "
" + + "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.cre, 1) + "
" + + "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.eff, 1) + "
" + + "Salary: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(employee.sal).format('$0.000a') + " \ s
", clickListener:()=>{ office.hireEmployee(employee, parentRefs); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])("cmpy-mgmt-hire-employee-popup"); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])("cmpy-mgmt-hire-employee-popup"); return false; } }); return div; }; - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", float:"right", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])("cmpy-mgmt-hire-employee-popup"); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])("cmpy-mgmt-hire-employee-popup"); return false; } }); @@ -41733,32 +41925,32 @@ OfficeSpace.prototype.findEmployees = function(parentRefs) { createEmpDiv(emp3, this), cancelBtn]; - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])("cmpy-mgmt-hire-employee-popup", elems); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])("cmpy-mgmt-hire-employee-popup", elems); } OfficeSpace.prototype.hireEmployee = function(employee, parentRefs) { var company = parentRefs.corporation, division = parentRefs.division; - var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["j" /* yesNoTxtInpBoxGetYesButton */])(), - noBtn = Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["i" /* yesNoTxtInpBoxGetNoButton */])(); + var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["j" /* yesNoTxtInpBoxGetYesButton */])(), + noBtn = Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["i" /* yesNoTxtInpBoxGetNoButton */])(); yesBtn.innerHTML = "Hire"; noBtn.innerHTML = "Cancel"; yesBtn.addEventListener("click", ()=>{ - var name = Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["h" /* yesNoTxtInpBoxGetInput */])(); + var name = Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["h" /* yesNoTxtInpBoxGetInput */])(); for (var i = 0; i < this.employees.length; ++i) { if (this.employees[i].name === name) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You already have an employee with this nickname! Please give every employee a unique nickname."); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You already have an employee with this nickname! Please give every employee a unique nickname."); return false; } } employee.name = name; this.employees.push(employee); company.displayDivisionContent(division, currentCityUi); - return Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["f" /* yesNoTxtInpBoxClose */])(); + return Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["f" /* yesNoTxtInpBoxClose */])(); }); noBtn.addEventListener("click", ()=>{ - return Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["f" /* yesNoTxtInpBoxClose */])(); + return Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["f" /* yesNoTxtInpBoxClose */])(); }); - Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["g" /* yesNoTxtInpBoxCreate */])("Give your employee a nickname!"); + Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["g" /* yesNoTxtInpBoxCreate */])("Give your employee a nickname!"); } OfficeSpace.prototype.hireRandomEmployee = function(parentRefs) { @@ -41766,12 +41958,12 @@ OfficeSpace.prototype.hireRandomEmployee = function(parentRefs) { if (document.getElementById("cmpy-mgmt-hire-employee-popup") != null) {return;} //Generate three random employees (meh, decent, amazing) - var mult = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(76, 100)/100; - var int = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - cha = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - exp = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - cre = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - eff = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + var mult = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(76, 100)/100; + var int = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + cha = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + exp = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + cre = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + eff = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), sal = 2.2 * (int + cha + exp + cre + eff); var emp = new Employee({ @@ -41783,7 +41975,7 @@ OfficeSpace.prototype.hireRandomEmployee = function(parentRefs) { salary: sal * mult, }); - var name = Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["d" /* generateRandomString */])(7); + var name = Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["d" /* generateRandomString */])(7); for (var i = 0; i < this.employees.length; ++i) { if (this.employees[i].name === name) { @@ -41818,14 +42010,14 @@ OfficeSpace.prototype.unassignEmployeeFromJob = function(job) { } OfficeSpace.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["b" /* Generic_toJSON */])("OfficeSpace", this); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["b" /* Generic_toJSON */])("OfficeSpace", this); } OfficeSpace.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(OfficeSpace, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(OfficeSpace, value.data); } -__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["c" /* Reviver */].constructors.OfficeSpace = OfficeSpace; +__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["c" /* Reviver */].constructors.OfficeSpace = OfficeSpace; function Warehouse(params={}) { this.loc = params.loc ? params.loc : ""; @@ -41879,11 +42071,11 @@ Warehouse.prototype.createUI = function(parentRefs) { return; } var company = parentRefs.company, industry = parentRefs.industry; - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(industryWarehousePanel); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(industryWarehousePanel); var storageText = "Storage: " + - (this.sizedUsed >= this.size ? Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sizeUsed, 3) : Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sizeUsed, 3)) + - "/" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.size, 3); - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + (this.sizedUsed >= this.size ? Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sizeUsed, 3) : Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sizeUsed, 3)) + + "/" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.size, 3); + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: storageText, display:"inline-block", color: this.sizeUsed >= this.size ? "red" : "white", @@ -41891,8 +42083,8 @@ Warehouse.prototype.createUI = function(parentRefs) { //Upgrade warehouse size button var upgradeCost = WarehouseUpgradeBaseCost * Math.pow(1.07, Math.round(this.size / 100) - 1); - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { - innerText:"Upgrade Warehouse Size - " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(upgradeCost).format('$0.000a'), + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { + innerText:"Upgrade Warehouse Size - " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(upgradeCost).format('$0.000a'), display:"inline-block", class: company.funds.lt(upgradeCost) ? "a-link-button-inactive" : "a-link-button", clickListener:()=>{ @@ -41961,12 +42153,12 @@ Warehouse.prototype.createUI = function(parentRefs) { reqRatioText += "one of its Products"; } - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML:reqText, tooltipleft:reqRatioText })); //Materials - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "
Materials:
", })); for (var matName in this.materials) { @@ -41981,7 +42173,7 @@ Warehouse.prototype.createUI = function(parentRefs) { //Products if (!(industry.makesProducts && Object.keys(industry.products).length > 0)) {return;} - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "
Products:
", })); for (var productName in industry.products) { @@ -41999,11 +42191,10 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { var company = parentRefs.company, industry = parentRefs.industry; var purchasePopupId = "cmpy-mgmt-material-purchase-popup", sellPopupid = "cmpy-mgmt-material-sell-popup"; - var div = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var div = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-warehouse-material-div", }); - //Storage size var totalExport = 0; for (var i = 0; i < mat.exp.length; ++i) { totalExport += mat.exp[i].amt; @@ -42013,95 +42204,118 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { //If Market Research upgrades are unlocked, add competition and demand info var cmpAndDmdText = ""; if (company.unlockUpgrades[2] === 1) { - cmpAndDmdText += "
Competition: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.cmp, 3); + cmpAndDmdText += "
Competition: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.cmp, 3); } if (company.unlockUpgrades[3] === 1) { - cmpAndDmdText += "
Demand: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.dmd, 3); + cmpAndDmdText += "
Demand: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.dmd, 3); } - var innerTxt = "

" + mat.name + ": " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.qty, 3) + - "(" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalGain, 3) + "/s)" + - "Buy: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.buy, 3) + - "/s
Prod: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.prd, 3) + "/s
Sell: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + - "/s
Export: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalExport, 3) + "/s
Import: " + - Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.imp, 3) + "/s" + cmpAndDmdText + "


" + - "

MP: $" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.bCost, 2) + + var innerTxt = "

" + mat.name + ": " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.qty, 3) + + "(" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalGain, 3) + "/s)" + + "Buy: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.buy, 3) + + "/s
Prod: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.prd, 3) + "/s
Sell: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + + "/s
Export: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalExport, 3) + "/s
Import: " + + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.imp, 3) + "/s" + cmpAndDmdText + "


" + + "

MP: $" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.bCost, 2) + "Market Price: The price you would pay if " + "you were to buy this material on the market


" + - "

Quality: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.qlt, 2) + + "

Quality: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.qlt, 2) + "The quality of your material. Higher quality " + "will lead to more sales

"; - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: innerTxt, id: "cmpy-mgmt-warehouse-" + matName + "-text", display:"inline-block", })); - var buttonPanel = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var buttonPanel = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { display:"inline-block", }); div.appendChild(buttonPanel); //Button to set purchase amount - buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { - innerText: "Buy (" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.buy, 3) + ")", display:"inline-block", class:"a-link-button", + var tutorial = industry.newInd && Object.keys(industry.reqMats).includes(mat.name) && + mat.buy === 0 && mat.imp === 0; + var buyButtonParams = { + innerText: "Buy (" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.buy, 3) + ")", display:"inline-block", + class: tutorial ? "a-link-button flashing-button" : "a-link-button", clickListener:()=>{ - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Enter the amount of " + mat.name + " you would like " + "to purchase per second. This material's cost changes constantly" }); - var input = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { - type:"number", value:mat.buy ? mat.buy : null, placeholder: "Purchase amount" + var confirmBtn; + var input = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { + type:"number", value:mat.buy ? mat.buy : null, placeholder: "Purchase amount", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) { + confirmBtn.click(); + } + } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Confirm", class:"a-link-button", clickListener:()=>{ if (isNaN(input.value)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid amount"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid amount"); } else { mat.buy = parseFloat(input.value); if (isNaN(mat.buy)) {mat.buy = 0;} - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(purchasePopupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(purchasePopupId); this.createUI(parentRefs); return false; } } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { - innerText:"Cancel", class:"a-link-button", + var clearButton = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { + innerText:"Clear Purchase", class:"a-link-button", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(purchasePopupId); + mat.buy = 0; + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(purchasePopupId); + this.createUI(parentRefs); + return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(purchasePopupId, [txt, input, confirmBtn, cancelBtn]); + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { + innerText:"Cancel", class:"a-link-button", + clickListener:()=>{ + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(purchasePopupId); + } + }); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(purchasePopupId, [txt, input, confirmBtn, clearButton, cancelBtn]); input.focus(); } - })); + }; + if (tutorial) { + buyButtonParams.tooltip = "Purchase your required materials to get production started!"; + } + buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", buyButtonParams)); //Button to manage exports if (company.unlockUpgrades[0] === 1) { //Export unlock upgrade function createExportPopup() { var popupId = "cmpy-mgmt-export-popup"; - var exportTxt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var exportTxt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Select the industry and city to export this material to, as well as " + "how much of this material to export per second. You can set the export " + "amount to 'MAX' to export all of the materials in this warehouse." }); //Select industry and city to export to - var industrySelector = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("select", {}), - citySelector = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); + var industrySelector = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("select", {}), + citySelector = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); for (var i = 0; i < company.divisions.length; ++i) { - industrySelector.add(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("option", { + industrySelector.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option", { text:company.divisions[i].name, value:company.divisions[i].name, changeListener:()=>{ var industryName = industrySelector.options[industrySelector.selectedIndex].value; for (var foo = 0; foo < company.divisions.length; ++foo) { if (company.divisions[foo].name == industryName) { - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["c" /* clearSelector */])(citySelector); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["c" /* clearSelector */])(citySelector); var selectedIndustry = company.divisions[foo]; for (var cityName in company.divisions[foo].warehouses) { if (company.divisions[foo].warehouses[cityName] instanceof Warehouse) { - citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("option", { + citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option", { value:cityName, text:cityName, })); } @@ -42119,7 +42333,7 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { for (var cityName in company.divisions[i].warehouses) { if (company.divisions[i].warehouses.hasOwnProperty(cityName) && company.divisions[i].warehouses[cityName] instanceof Warehouse) { - citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("option", { + citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option", { value:cityName, text:cityName, })); } @@ -42129,18 +42343,18 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { } //Select amount to export - var exportAmount = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var exportAmount = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Export amount / s" }); - var exportBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var exportBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Export", clickListener:()=>{ var industryName = industrySelector.options[industrySelector.selectedIndex].text, cityName = citySelector.options[citySelector.selectedIndex].text, amt = parseFloat(exportAmount.value); if (isNaN(amt)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid amount entered for export"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid amount entered for export"); return; } var exportObj = {ind:industryName, city:cityName, amt:amt}; @@ -42152,7 +42366,7 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { var warehouse = company.divisions[i].warehouses[cityName]; if (warehouse instanceof Warehouse) { warehouse.materials[matName].imp += amt; - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } else { console.log("ERROR: Target city for export does not have warehouse in specified city"); @@ -42160,27 +42374,27 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { } } console.log("ERROR: Could not find target industry/city for export"); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - var currExportsText = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var currExportsText = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Below is a list of all current exports of this material from this warehouse. " + "Clicking on one of the exports below will REMOVE that export." }); var currExports = []; for (var i = 0; i < mat.exp.length; ++i) { (function(i, mat, currExports){ - currExports.push(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + currExports.push(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-existing-export", innerHTML: "Industry: " + mat.exp[i].ind + "
" + "City: " + mat.exp[i].city + "
" + @@ -42198,44 +42412,44 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { } } mat.exp.splice(i, 1); //Remove export object - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); createExportPopup(); } })); })(i, mat, currExports); } - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [exportTxt, industrySelector, citySelector, exportAmount, + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [exportTxt, industrySelector, citySelector, exportAmount, exportBtn, cancelBtn, currExportsText].concat(currExports)); } - buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Export", display:"inline-block", class:"a-link-button", clickListener:()=>{createExportPopup();} })); } - buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); // Force line break + buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); // Force line break //Button to set sell amount var innerTextString; if (mat.sllman[0]) { - innerTextString = (mat.sllman[1] === -1 ? "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + "/MAX)" : - "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + "/" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sllman[1], 3) + ")"); + innerTextString = (mat.sllman[1] === -1 ? "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + "/MAX)" : + "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + "/" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sllman[1], 3) + ")"); if (mat.sCost) { - if (Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["g" /* isString */])(mat.sCost)) { + if (Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["g" /* isString */])(mat.sCost)) { var sCost = mat.sCost.replace(/MP/g, mat.bCost); - innerTextString += " @ $" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(eval(sCost), 2); + innerTextString += " @ $" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(eval(sCost), 2); } else { - innerTextString += " @ $" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sCost, 2); + innerTextString += " @ $" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sCost, 2); } } } else { innerTextString = "Sell (0.000/0.000)"; } - buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText: innerTextString, display:"inline-block", class:"a-link-button", clickListener:()=>{ - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Enter the maximum amount of " + mat.name + " you would like " + "to sell per second, as well as the price at which you would " + "like to sell at.

" + @@ -42247,16 +42461,25 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { "changing price that depends on the market price. For example, if you set the sell price " + "to 'MP+10' then it will always be sold at $10 above the market price.", }); - var br = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {}); - var inputQty = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var br = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {}); + var confirmBtn; + var inputQty = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"text", marginTop:"4px", - value: mat.sllman[1] ? mat.sllman[1] : null, placeholder: "Sell amount" + value: mat.sllman[1] ? mat.sllman[1] : null, placeholder: "Sell amount", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); - var inputPx = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var inputPx = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"text", marginTop:"4px", - value: mat.sCost ? mat.sCost : null, placeholder: "Sell price" + value: mat.sCost ? mat.sCost : null, placeholder: "Sell price", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Confirm", class:"a-link-button", margin:"6px", clickListener:()=>{ //Parse price @@ -42266,7 +42489,7 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { var temp = cost.replace(/MP/g, mat.bCost); var temp = eval(temp); if (temp == null || isNaN(temp)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value or expression for sell price field"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value or expression for sell price field"); return false; } @@ -42281,7 +42504,7 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { mat.sllman[0] = true; mat.sllman[1] = -1; } else if (isNaN(inputQty.value)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell quantity field! Must be numeric or 'MAX'"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell quantity field! Must be numeric or 'MAX'"); return false; } else { var qty = parseFloat(inputQty.value); @@ -42296,17 +42519,17 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { } this.createUI(parentRefs); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(sellPopupid); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(sellPopupid); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Cancel", class:"a-link-button", margin: "6px", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(sellPopupid); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(sellPopupid); } }); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(sellPopupid, [txt, br, inputQty, inputPx, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(sellPopupid, [txt, br, inputQty, inputPx, confirmBtn, cancelBtn]); inputQty.focus(); } })); @@ -42317,15 +42540,15 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { Warehouse.prototype.createProductUI = function(product, parentRefs) { var company = parentRefs.company, industry = parentRefs.industry, city = currentCityUi; - var div = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var div = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-warehouse-product-div" }); //Products being designed TODO if (!product.fin) { - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Designing " + product.name + "...
" + - Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.prog, 2) + "% complete", + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.prog, 2) + "% complete", })); industryWarehousePanel.appendChild(div); return; @@ -42334,47 +42557,47 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { //Completed products var cmpAndDmdText = ""; if (company.unlockUpgrades[2] === 1) { - cmpAndDmdText += "
Competition: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.cmp, 3); + cmpAndDmdText += "
Competition: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.cmp, 3); } if (company.unlockUpgrades[3] === 1) { - cmpAndDmdText += "
Demand: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.dmd, 3); + cmpAndDmdText += "
Demand: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.dmd, 3); } var totalGain = product.data[city][1] - product.data[city][2]; //Production - sale - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { - innerHTML: "

" + product.name + ": " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][0], 3) + //Quantity - "(" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalGain, 3) + "/s)" + - "Prod: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][1], 3) + "/s
" + - "Sell: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/s


" + - "

Rating: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.rat, 3) + - "Quality: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.qlt, 3) + "
" + - "Performance: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.per, 3) + "
" + - "Durability: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.dur, 3) + "
" + - "Reliability: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.rel, 3) + "
" + - "Aesthetics: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.aes, 3) + "
" + - "Features: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.fea, 3) + + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { + innerHTML: "

" + product.name + ": " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][0], 3) + //Quantity + "(" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalGain, 3) + "/s)" + + "Prod: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][1], 3) + "/s
" + + "Sell: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/s


" + + "

Rating: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.rat, 3) + + "Quality: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.qlt, 3) + "
" + + "Performance: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.per, 3) + "
" + + "Durability: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.dur, 3) + "
" + + "Reliability: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.rel, 3) + "
" + + "Aesthetics: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.aes, 3) + "
" + + "Features: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.fea, 3) + cmpAndDmdText + "


" + - "

Est. Production Cost: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(product.pCost).format("$0.000a") + + "

Est. Production Cost: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(product.pCost).format("$0.000a") + "An estimate of how much it costs to produce one unit of this product. " + "If your sell price exceeds this by too much, people won't buy your product. The better your " + "product is, the higher you can mark up its price.


" + - "Size: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.siz, 3), + "Size: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.siz, 3), })); - var buttonPanel = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var buttonPanel = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { display:"inline-block", }); div.appendChild(buttonPanel); //Sell button - var sellInnerTextString = (product.sllman[city][1] === -1 ? "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/MAX)" : - "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.sllman[city][1], 3) + ")"); + var sellInnerTextString = (product.sllman[city][1] === -1 ? "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/MAX)" : + "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.sllman[city][1], 3) + ")"); if (product.sCost) { - sellInnerTextString += (" @ " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(product.sCost).format("$0.000a")); + sellInnerTextString += (" @ " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(product.sCost).format("$0.000a")); } - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:sellInnerTextString, class:"a-link-button", display:"inline-block",margin:"6px", clickListener:()=>{ var popupId = "cmpy-mgmt-sell-product-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML:"Enter the maximum amount of " + product.name + " you would like " + "to sell per second, as well as the price at which you would like to " + "sell it at.

" + @@ -42383,19 +42606,28 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { "Setting the sell amount to 'MAX' will result in you always selling the " + "maximum possible amount of the material.

", }); - var inputQty = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { - type:"text", value:product.sllman[city][1] ? product.sllman[city][1] : null, placeholder: "Sell amount" + var confirmBtn; + var inputQty = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { + type:"text", value:product.sllman[city][1] ? product.sllman[city][1] : null, placeholder: "Sell amount", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); - var inputPx = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { - type:"text", value: product.sCost ? product.sCost : null, placeholder: "Sell price" + var inputPx = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { + type:"text", value: product.sCost ? product.sCost : null, placeholder: "Sell price", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Confirm", clickListener:()=>{ //Parse price var cost = parseFloat(inputPx.value); if (isNaN(cost)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell price field"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell price field"); return false; } product.sCost = cost; @@ -42405,7 +42637,7 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { product.sllman[city][0] = true; product.sllman[city][1] = -1; } else if (isNaN(inputQty.value)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell quantity field! Must be numeric"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell quantity field! Must be numeric"); return false; } else { var qty = parseFloat(inputQty.value); @@ -42418,50 +42650,55 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { } } this.createUI(parentRefs); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, inputQty, inputPx, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, inputQty, inputPx, confirmBtn, cancelBtn]); inputQty.focus(); } })); - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br",{})); //force line break + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br",{})); //force line break //Limit production button var limitProductionInnerText = "Limit Production"; if (product.prdman[city][0]) { - limitProductionInnerText += " (" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.prdman[city][1], 3) + ")"; + limitProductionInnerText += " (" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.prdman[city][1], 3) + ")"; } - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:limitProductionInnerText,display:"inline-block", clickListener:()=>{ var popupId = "cmpy-mgmt-limit-product-production-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Enter a limit to the amount of this product you would " + "like to product per second. Leave the box empty to set no limit." }); - var input = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { - type:"number", placeholder:"Limit" + var confirmBtn; + var input = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { + type:"number", placeholder:"Limit", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Limit production", margin:'6px', clickListener:()=>{ if (input.value === "") { product.prdman[city][0] = false; - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } var qty = parseFloat(input.value); if (isNaN(qty)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value entered"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value entered"); return false; } if (qty < 0) { @@ -42470,62 +42707,62 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { product.prdman[city][0] = true; product.prdman[city][1] = qty; } - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Cancel", margin:"6px", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, input, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, input, confirmBtn, cancelBtn]); } })); //Discontinue button - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:'a-link-button', display:"inline-block",innerText:"Discontinue", clickListener:()=>{ var popupId = "cmpy-mgmt-discontinue-product-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Are you sure you want to do this? Discontinuing a product " + "removes it completely and permanently. You will no longer " + "produce this product and all of its existing stock will be " + "removed and left unsold", }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button",innerText:"Discontinue", clickListener:()=>{ industry.discontinueProduct(product, parentRefs); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, confirmBtn, cancelBtn]); } })); industryWarehousePanel.appendChild(div); } Warehouse.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Warehouse", this); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Warehouse", this); } Warehouse.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Warehouse, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Warehouse, value.data); } -__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["c" /* Reviver */].constructors.Warehouse = Warehouse; +__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["c" /* Reviver */].constructors.Warehouse = Warehouse; //Corporation Unlock Upgrades //Upgrades for entire corporation, unlocks features, either you have it or you dont @@ -42580,10 +42817,10 @@ var CorporationUpgrades = { "20 seconds."], //Makes advertising more effective - "3": [3, 4e9, 1.11, 0.1, + "3": [3, 4e9, 1.12, 0.01, "Wilson Analytics", "Purchase data and analysis from Wilson, a marketing research " + "firm. Each level of this upgrades increases the effectiveness of your " + - "advertising by 10% (additive)."], + "advertising by 1% (additive)."], //Augmentation for employees, increases cre "4": [4, 1e9, 1.06, 0.1, @@ -42627,9 +42864,9 @@ function Corporation(params={}) { this.divisions = []; //Financial stats - this.funds = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(150e9); - this.revenue = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); - this.expenses = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); + this.funds = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(150e9); + this.revenue = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); + this.expenses = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); this.fundingRound = 0; this.public = false; //Publicly traded this.numShares = TOTALSHARES; @@ -42658,11 +42895,32 @@ Corporation.prototype.process = function(numCycles=1) { if (this.storedCycles >= CyclesPerIndustryStateCycle) { var state = this.getState(); + //At the start of a new cycle, calculate profits from previous cycle + if (state === "START") { + this.revenue = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); + this.expenses = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); + this.divisions.forEach((ind)=>{ + this.revenue = this.revenue.plus(ind.lastCycleRevenue); + this.expenses = this.expenses.plus(ind.lastCycleExpenses); + }); + var profit = this.revenue.minus(this.expenses); + var cycleProfit = profit.times(numMarketCyclesPersist * SecsPerMarketCycle); + if (isNaN(this.funds)) { + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("There was an error calculating your Corporations funds and they got reset to 0. " + + "This is a bug. Please report to game developer.

" + + "(Your funds have been set to $150b for the inconvenience)"); + this.funds = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(150e9); + } + this.funds = this.funds.plus(cycleProfit); + this.updateSharePrice(); + } + //Determine number of market cycles at the START state if (state === "START") { if (this.storedCycles >= 2*CyclesPerMarketCycle) { //Enough cycles stored for 2+ market cycles - numMarketCyclesPersist = Math.floor(this.storedCycles / CyclesPerMarketCycle); + //Capped out at 3 to prevent weird behavior + numMarketCyclesPersist = Math.max(3, Math.floor(this.storedCycles / CyclesPerMarketCycle)); } else { numMarketCyclesPersist = 1; } @@ -42674,28 +42932,10 @@ Corporation.prototype.process = function(numCycles=1) { ind.process(marketCycles, state, corp); }); - //At the start of a new cycle, calculate profits from previous cycle - if (state === "START") { - this.revenue = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); - this.expenses = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); - this.divisions.forEach((ind)=>{ - this.revenue = this.revenue.plus(ind.lastCycleRevenue); - this.expenses = this.expenses.plus(ind.lastCycleExpenses); - }); - var profit = this.revenue.minus(this.expenses); - var cycleProfit = profit.times(marketCycles * SecsPerMarketCycle); - if (isNaN(this.funds)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("There was an error calculating your Corporations funds and they got reset to 0. " + - "This is a bug. Please report to game developer.

" + - "(Your funds have been set to $150b for the inconvenience)"); - this.funds = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(150e9); - } - this.funds = this.funds.plus(cycleProfit); - this.updateSharePrice(); - } + this.state.nextState(); - if (__WEBPACK_IMPORTED_MODULE_0__engine_js__["Engine"].currentPage === __WEBPACK_IMPORTED_MODULE_0__engine_js__["Engine"].Page.Corporation) {this.updateUIContent();} + if (__WEBPACK_IMPORTED_MODULE_1__engine_js__["Engine"].currentPage === __WEBPACK_IMPORTED_MODULE_1__engine_js__["Engine"].Page.Corporation) {this.updateUIContent();} } } @@ -42715,7 +42955,7 @@ Corporation.prototype.determineValuation = function() { } val -= (val % 1e6); //Round down to nearest millionth } - return val; + return val * __WEBPACK_IMPORTED_MODULE_0__BitNode_js__["a" /* BitNodeMultipliers */].CorporationValuation; } Corporation.prototype.getInvestment = function() { @@ -42738,8 +42978,8 @@ Corporation.prototype.getInvestment = function() { } var funding = val * percShares * 4, investShares = Math.floor(TOTALSHARES * percShares), - yesBtn = Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), - noBtn = Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); + yesBtn = Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), + noBtn = Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); yesBtn.innerHTML = "Accept"; noBtn.innerHML = "Reject"; yesBtn.addEventListener("click", ()=>{ @@ -42747,46 +42987,47 @@ Corporation.prototype.getInvestment = function() { this.funds = this.funds.plus(funding); this.numShares -= investShares; this.displayCorporationOverviewContent(); - return Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + return Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); }); noBtn.addEventListener("click", ()=>{ - return Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + return Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); }); - Object(__WEBPACK_IMPORTED_MODULE_10__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])("An investment firm has offered you " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(funding).format('$0.000a') + - " in funding in exchange for a " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(percShares*100).format("0.000a") + - "% stake in the company (" + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(investShares).format('0.000a') + " shares).

" + + Object(__WEBPACK_IMPORTED_MODULE_11__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])("An investment firm has offered you " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(funding).format('$0.000a') + + " in funding in exchange for a " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(percShares*100).format("0.000a") + + "% stake in the company (" + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(investShares).format('0.000a') + " shares).

" + "Do you accept or reject this offer?"); } Corporation.prototype.goPublic = function() { var goPublicPopupId = "cmpy-mgmt-go-public-popup"; var initialSharePrice = this.determineValuation() / (TOTALSHARES); - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Enter the number of shares you would like to issue " + "for your IPO. These shares will be publicly sold " + - "and you will no longer own them. You will receive " + - __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(initialSharePrice).format('$0.000a') + " per share.

" + + "and you will no longer own them. Your Corporation will receive " + + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(initialSharePrice).format('$0.000a') + " per share " + + "(the IPO money will be deposited directly into your Corporation's funds).

" + "Furthermore, issuing more shares now will help drive up " + "your company's stock price in the future.

" + - "You have a total of " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(this.numShares).format("0.000a") + " of shares that you can issue.", + "You have a total of " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(this.numShares).format("0.000a") + " of shares that you can issue.", }); - var input = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var input = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder: "Shares to issue", }); - var br = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {}); - var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var br = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {}); + var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Go Public", clickListener:()=>{ var numShares = Math.round(input.value); var initialSharePrice = this.determineValuation() / (TOTALSHARES); if (isNaN(numShares)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for number of issued shares"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for number of issued shares"); return false; } if (numShares > this.numShares) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Error: You don't have that many shares to issue!"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Error: You don't have that many shares to issue!"); return false; } this.public = true; @@ -42795,19 +43036,19 @@ Corporation.prototype.goPublic = function() { this.numShares -= numShares; this.funds = this.funds.plus(numShares * initialSharePrice); this.displayCorporationOverviewContent(); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(goPublicPopupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(goPublicPopupId); return false; } }); - var noBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var noBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(goPublicPopupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(goPublicPopupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(goPublicPopupId, [txt, br, input, yesBtn, noBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(goPublicPopupId, [txt, br, input, yesBtn, noBtn]); } Corporation.prototype.updateSharePrice = function() { @@ -42827,7 +43068,7 @@ Corporation.prototype.unlock = function(upgrade) { this.unlockUpgrades.push(0); } if (this.funds.lt(price)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough funds to unlock this!"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough funds to unlock this!"); return; } this.unlockUpgrades[upgN] = 1; @@ -42842,7 +43083,7 @@ Corporation.prototype.upgrade = function(upgrade) { while (this.upgradeMultipliers.length <= upgN) {this.upgradeMultipliers.push(1);} var totalCost = basePrice * Math.pow(priceMult, this.upgrades[upgN]); if (this.funds.lt(totalCost)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough funds to purchase this!"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough funds to purchase this!"); return; } ++this.upgrades[upgN]; @@ -42928,19 +43169,19 @@ var companyManagementDiv, companyManagementHeaderTabs, companyManagementPanel, industryWarehousePanel, headerTabs, cityTabs; Corporation.prototype.createUI = function() { - companyManagementDiv = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + companyManagementDiv = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { id:"cmpy-mgmt-container", position:"fixed", class:"generic-menupage-container" }); - companyManagementHeaderTabs = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", {id:"cmpy-mgmt-header-tabs"}); + companyManagementHeaderTabs = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", {id:"cmpy-mgmt-header-tabs"}); companyManagementDiv.appendChild(companyManagementHeaderTabs); //Create division/industry tabs at the top this.updateUIHeaderTabs(); //Create the 'panel' that will have the actual content in the UI - companyManagementPanel = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", {id:"cmpy-mgmt-panel"}); + companyManagementPanel = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", {id:"cmpy-mgmt-panel"}); companyManagementDiv.appendChild(companyManagementPanel); document.getElementById("entire-game-container").appendChild(companyManagementDiv); @@ -42949,14 +43190,14 @@ Corporation.prototype.createUI = function() { Corporation.prototype.updateUIHeaderTabs = function() { if (companyManagementHeaderTabs) { - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(companyManagementHeaderTabs); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(companyManagementHeaderTabs); } else { console.log("ERROR: Header tabs div has not yet been created when Corporation.updateUIHeaderTabs() is called"); return; } //Corporation overview tabs - var cmpyOverviewHdrTab = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("button", { + var cmpyOverviewHdrTab = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("button", { id:"cmpy-mgmt-company-tab", class:"cmpy-mgmt-header-tab", innerText:this.name, @@ -42975,88 +43216,97 @@ Corporation.prototype.updateUIHeaderTabs = function() { } //Create a tab to expand into a new industry - companyManagementHeaderTabs.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("button", { + companyManagementHeaderTabs.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("button", { id:'cmpy-mgmt-expand-industry-tab', class:"cmpy-mgmt-header-tab", innerText:"Expand into new Industry", clickListener: ()=>{ if (document.getElementById("cmpy-mgmt-expand-industry-popup") != null) {return;} - var container = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { - class:"popup-box-container", - id:"cmpy-mgmt-expand-industry-popup", - }), - content = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", {class:"popup-box-content"}), - txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { - innerHTML: "Create a new division to expand into a new industry:", - }), - selector = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("select", { - class:"cmpy-mgmt-industry-select" - }), - industryDescription = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", {}), - nameInput = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { - type:"text", - id:"cmpy-mgmt-expand-industry-name-input", - color:"white", - backgroundColor:"black", - display:"block", - maxLength: 30, - pattern:"[a-zA-Z0-9-_]" - }), - nameLabel = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("label", { - for:"cmpy-mgmt-expand-industry-name-input", - innerText:"Division name: " - }), - yesBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("span", { - class:"popup-box-button", - innerText:"Create Division", - clickListener: ()=>{ - var ind = selector.options[selector.selectedIndex].value, - newDivisionName = nameInput.value; + var container = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { + class:"popup-box-container", + id:"cmpy-mgmt-expand-industry-popup", + }), + content = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", {class:"popup-box-content"}), + txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { + innerHTML: "Create a new division to expand into a new industry:", + }), + selector = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("select", { + class:"cmpy-mgmt-industry-select" + }), + industryDescription = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", {}), + nameInput = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { + type:"text", + id:"cmpy-mgmt-expand-industry-name-input", + color:"white", + backgroundColor:"black", + display:"block", + maxLength: 30, + pattern:"[a-zA-Z0-9-_]" + }), + nameLabel = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("label", { + for:"cmpy-mgmt-expand-industry-name-input", + innerText:"Division name: " + }), + yesBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("span", { + class:"popup-box-button", + innerText:"Create Division", + clickListener: ()=>{ + var ind = selector.options[selector.selectedIndex].value, + newDivisionName = nameInput.value; - for (var i = 0; i < this.divisions.length; ++i) { - if (this.divisions[i].name === newDivisionName) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("This name is already in use!"); - return false; - } + for (var i = 0; i < this.divisions.length; ++i) { + if (this.divisions[i].name === newDivisionName) { + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("This name is already in use!"); + return false; } - if (this.funds.lt(IndustryStartingCosts[ind])) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Not enough money to create a new division in this industry"); - } else if (newDivisionName === "") { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("New division must have a name!"); - } else { - this.funds = this.funds.minus(IndustryStartingCosts[ind]); - var newInd = new Industry({ - name:newDivisionName, - type:ind, - }); - this.divisions.push(newInd); - this.updateUIHeaderTabs(); - this.selectHeaderTab(headerTabs[headerTabs.length-2]); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])("cmpy-mgmt-expand-industry-popup"); - this.displayDivisionContent(newInd, __WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12); - } - return false; } - }), - noBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("span", { - class:"popup-box-button", - innerText:"Cancel", - clickListener: function() { - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])("cmpy-mgmt-expand-industry-popup"); - return false; + if (this.funds.lt(IndustryStartingCosts[ind])) { + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Not enough money to create a new division in this industry"); + } else if (newDivisionName === "") { + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("New division must have a name!"); + } else { + this.funds = this.funds.minus(IndustryStartingCosts[ind]); + var newInd = new Industry({ + name:newDivisionName, + type:ind, + }); + this.divisions.push(newInd); + this.updateUIHeaderTabs(); + this.selectHeaderTab(headerTabs[headerTabs.length-2]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])("cmpy-mgmt-expand-industry-popup"); + this.displayDivisionContent(newInd, __WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Sector12); } - }); + return false; + } + }), + noBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("span", { + class:"popup-box-button", + innerText:"Cancel", + clickListener: function() { + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])("cmpy-mgmt-expand-industry-popup"); + return false; + } + }); + + //Make an object to keep track of what industries you're already in + var ownedIndustries = {} + for (var i = 0; i < this.divisions.length; ++i) { + ownedIndustries[this.divisions[i].type] = true; + } //Add industry types to selector //Have Agriculture be first as recommended option - selector.add(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("option", { - text:Industries["Agriculture"], value:"Agriculture" - })) + if (!ownedIndustries["Agriculture"]) { + selector.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option", { + text:Industries["Agriculture"], value:"Agriculture" + })); + } + for (var key in Industries) { - if (key !== "Agriculture" && Industries.hasOwnProperty(key)) { + if (key !== "Agriculture" && Industries.hasOwnProperty(key) && !ownedIndustries[key]) { var ind = Industries[key]; - selector.add(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("option", { + selector.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option", { text: ind,value:key, })); } @@ -43101,13 +43351,13 @@ Corporation.prototype.selectHeaderTab = function(currentTab) { Corporation.prototype.createDivisionUIHeaderTab = function(division) { var tabId = "cmpy-mgmt-" + division.name + "-tab"; - var tab = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("button", { + var tab = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("button", { id:tabId, class:"cmpy-mgmt-header-tab", innerText:division.name, clickListener:()=>{ this.selectHeaderTab(tab); - this.displayDivisionContent(division, __WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12); + this.displayDivisionContent(division, __WEBPACK_IMPORTED_MODULE_3__Location_js__["a" /* Locations */].Sector12); return false; } }); @@ -43142,7 +43392,7 @@ Corporation.prototype.updateUIContent = function() { Corporation.prototype.displayCorporationOverviewContent = function() { this.clearUIPanel(); - companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { id:"cmpy-mgmt-overview-text", })); if (headerTabs && headerTabs.length >= 1) { @@ -43150,23 +43400,23 @@ Corporation.prototype.displayCorporationOverviewContent = function() { } //Check if player has Corporation Handbook - var homeComp = __WEBPACK_IMPORTED_MODULE_3__Player_js__["a" /* Player */].getHomeComputer(), hasHandbook = false, + var homeComp = __WEBPACK_IMPORTED_MODULE_4__Player_js__["a" /* Player */].getHomeComputer(), hasHandbook = false, handbookFn = "corporation-management-handbook.lit"; for (var i = 0; i < homeComp.messages.length; ++i) { - if (Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["g" /* isString */])(homeComp.messages[i]) && homeComp.messages[i] === handbookFn) { + if (Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["g" /* isString */])(homeComp.messages[i]) && homeComp.messages[i] === handbookFn) { hasHandbook = true; break; } } - companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Getting Started Guide", display:"inline-block", tooltip:"Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' " + "This is a .lit file that guides you through the beginning of setting up a Corporation and " + "provides some tips/pointers for helping you get started with managing it.", clickListener:()=>{ if (!hasHandbook) {homeComp.messages.push(handbookFn);} - Object(__WEBPACK_IMPORTED_MODULE_1__Literature_js__["b" /* showLiterature */])(handbookFn); + Object(__WEBPACK_IMPORTED_MODULE_2__Literature_js__["b" /* showLiterature */])(handbookFn); return false; } })); @@ -43174,40 +43424,42 @@ Corporation.prototype.displayCorporationOverviewContent = function() { //Investors if (this.public) { //Sell share buttons - var sellShares = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var sellShares = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Sell Shares", display:"inline-block", tooltip:"Sell your shares in the company. This is the only way to " + "profit from your business venture.", clickListener:()=>{ var popupId = "cmpy-mgmt-sell-shares-popup"; var currentStockPrice = this.sharePrice; - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { - innerHTML: "Enter the number of shares you would like to sell. The current price of your " + - "company's stock is " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(currentStockPrice).format("$0.000a"), + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { + innerHTML: "Enter the number of shares you would like to sell. The money from " + + "selling your shares will go directly to you (NOT your Corporation). " + + "The current price of your " + + "company's stock is " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(currentStockPrice).format("$0.000a"), }); - var profitIndicator = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); - var input = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var profitIndicator = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); + var input = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Shares to sell", margin:"5px", inputListener: ()=> { var numShares = Math.round(input.value); - if (isNaN(numShares) || shares <= 0) { + if (isNaN(numShares) || numShares <= 0) { profitIndicator.innerText = "ERROR: Invalid value entered for number of shares to sell" } else if (numShares > this.numShares) { profitIndicator.innerText = "You don't have this many shares to sell!"; } else { profitIndicator.innerText = "Sell " + numShares + " shares for a total of " + - __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(numShares * currentStockPrice).format('$0.000a'); + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(numShares * currentStockPrice).format('$0.000a'); } } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Sell shares", display:"inline-block", clickListener:()=>{ var shares = Math.round(input.value); if (isNaN(shares) || shares <= 0) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: Invalid value for number of shares"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: Invalid value for number of shares"); } else if (shares > this.numShares) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: You don't have this many shares to sell"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: You don't have this many shares to sell"); } else { this.numShares -= shares; if (isNaN(this.issuedShares)) { @@ -43221,65 +43473,68 @@ Corporation.prototype.displayCorporationOverviewContent = function() { } } this.issuedShares += shares; - __WEBPACK_IMPORTED_MODULE_3__Player_js__["a" /* Player */].gainMoney(shares * this.sharePrice); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + __WEBPACK_IMPORTED_MODULE_4__Player_js__["a" /* Player */].gainMoney(shares * this.sharePrice); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", display:"inline-block", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, profitIndicator, input, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, profitIndicator, input, confirmBtn, cancelBtn]); } }); //Buyback shares button - var buybackShares = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var buybackShares = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Buyback shares", display:"inline-block", tooltip:"Buy back shares you that previously issued or sold at market price.", clickListener:()=>{ var popupId = "cmpy-mgmt-buyback-shares-popup"; var currentStockPrice = this.sharePrice; - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { - innerHTML: "Enter the number of shares you would like to buy back at market price. The current price of your " + - "company's stock is " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(currentStockPrice).format("$0.000a") + - ". Your company currently has " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.issuedShares, 3) + " outstanding stock shares", + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { + innerHTML: "Enter the number of shares you would like to buy back at market price. To purchase " + + "these shares, you must use your own money (NOT your Corporation's funds). " + + "The current price of your " + + "company's stock is " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(currentStockPrice).format("$0.000a") + + ". Your company currently has " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.issuedShares, 3) + " outstanding stock shares", }); - var costIndicator = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); - var input = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var costIndicator = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); + var input = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Shares to buyback", margin:"5px", inputListener: ()=> { var numShares = Math.round(input.value); //TODO add conditional for if player doesn't have enough money - if (isNaN(numShares) || shares <= 0) { + if (isNaN(numShares) || numShares <= 0) { costIndicator.innerText = "ERROR: Invalid value entered for number of shares to buyback" } else if (numShares > this.issuedShares) { costIndicator.innerText = "There are not this many shares available to buy back. " + "There are only " + this.issuedShares + " outstanding shares."; } else { + console.log("here"); costIndicator.innerText = "Purchase " + numShares + " shares for a total of " + - __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(numShares * currentStockPrice).format('$0.000a'); + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(numShares * currentStockPrice).format('$0.000a'); } } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Buy shares", display:"inline-block", clickListener:()=>{ var shares = Math.round(input.value); var tempStockPrice = this.sharePrice; if (isNaN(shares) || shares <= 0) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: Invalid value for number of shares"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: Invalid value for number of shares"); } else if (shares > this.issuedShares) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: There are not this many oustanding shares to buy back"); - } else if (shares * tempStockPrice > __WEBPACK_IMPORTED_MODULE_3__Player_js__["a" /* Player */].money) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: You do not have enough money to purchase this many shares (you need " + - __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(shares * tempStockPrice).format("$0.000a") + ")"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: There are not this many oustanding shares to buy back"); + } else if (shares * tempStockPrice > __WEBPACK_IMPORTED_MODULE_4__Player_js__["a" /* Player */].money) { + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: You do not have enough money to purchase this many shares (you need " + + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(shares * tempStockPrice).format("$0.000a") + ")"); } else { this.numShares += shares; if (isNaN(this.issuedShares)) { @@ -43293,31 +43548,139 @@ Corporation.prototype.displayCorporationOverviewContent = function() { } } this.issuedShares -= shares; - __WEBPACK_IMPORTED_MODULE_3__Player_js__["a" /* Player */].loseMoney(shares * tempStockPrice); + __WEBPACK_IMPORTED_MODULE_4__Player_js__["a" /* Player */].loseMoney(shares * tempStockPrice); //TODO REMOVE from Player money - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); } return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", display:"inline-block", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, costIndicator, input, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, costIndicator, input, confirmBtn, cancelBtn]); } }); companyManagementPanel.appendChild(sellShares); companyManagementPanel.appendChild(buybackShares); + + //If your Corporation is big enough, buy faction influence through bribes + var canBribe = this.determineValuation() >= BribeThreshold; + var bribeFactions = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { + class: canBribe ? "a-link-button" : "a-link-button-inactive", + innerText:"Bribe Factions", display:"inline-block", + tooltip:canBribe + ? "Use your Corporations power and influence to bribe Faction leaders in exchange for reputation" + : "Your Corporation is not powerful enough to bribe Faction leaders", + clickListener:()=>{ + var popupId = "cmpy-mgmt-bribe-factions-popup"; + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { + innerText:"You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation" + }); + var factionSelector = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("select", {margin:"3px"}); + for (var facName in __WEBPACK_IMPORTED_MODULE_4__Player_js__["a" /* Player */].factions) { + if (__WEBPACK_IMPORTED_MODULE_4__Player_js__["a" /* Player */].factions.hasOwnProperty(facName)) { + factionSelector.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option"), { + text:facName, value:facName + }); + } + } + var repGainText = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p"); + var stockSharesInput; + var moneyInput = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { + type:"number", placeholder:"Corporation funds", margin:"5px", + inputListener:()=>{ + var money = moneyInput.value == null ? 0 : moneyInput.value; + var stockPrice = this.sharePrice; + var stockShares = stockSharesInput.value == null ? 0 : Math.round(stockSharesInput.value); + if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) { + repGainText.innerText = "ERROR: Invalid value(s) entered"; + } else if (this.funds.lt(money)) { + repGainText.innerText = "ERROR: You do not have this much money to bribe with"; + } else if (this.stockShares > this.numShares) { + repGainText.innerText = "ERROR: You do not have this many shares to bribe with"; + } else { + var totalAmount = money + (stockShares * stockPrice); + var repGain = totalAmount / BribeToRepRatio; + repGainText.innerText = "You will gain " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(repGain, 0) + + " reputation with " + + factionSelector.options[factionSelector.selectedIndex].value + + " with this bribe"; + } + } + }); + stockSharesInput = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { + type:"number", placeholder:"Stock Shares", margin: "5px", + inputListener:()=>{ + var money = moneyInput.value == null ? 0 : moneyInput.value; + var stockPrice = this.sharePrice; + var stockShares = stockSharesInput.value == null ? 0 : Math.round(stockSharesInput.value); + if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) { + repGainText.innerText = "ERROR: Invalid value(s) entered"; + } else if (this.funds.lt(money)) { + repGainText.innerText = "ERROR: You do not have this much money to bribe with"; + } else if (this.stockShares > this.numShares) { + repGainText.innerText = "ERROR: You do not have this many shares to bribe with"; + } else { + var totalAmount = money + (stockShares * stockPrice); + var repGain = totalAmount / BribeToRepRatio; + repGainText.innerText = "You will gain " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(repGain, 0) + + " reputation with " + + factionSelector.options[factionSelector.selectedIndex].value + + " with this bribe"; + } + } + }); + var confirmButton = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { + class:"a-link-button", innerText:"Bribe", display:"inline-block", + clickListener:()=>{ + var money = moneyInput.value == null ? 0 : moneyInput.value; + var stockPrice = this.sharePrice; + var stockShares = stockSharesInput.value == null ? 0 : Math.round(stockSharesInput.value); + var fac = Factions[factionSelector.options[factionSelector.selectedIndex].value]; + if (fac == null) { + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: You must select a faction to bribe"); + return false; + } + if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) { + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: Invalid value(s) entered"); + } else if (this.funds.lt(money)) { + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: You do not have this much money to bribe with"); + } else if (this.stockShares > this.numShares) { + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: You do not have this many shares to bribe with"); + } else { + var totalAmount = money + (stockShares * stockPrice); + var repGain = totalAmount / BribeToRepRatio; + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You gained " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(repGain, 0) + + " reputation with " + fac.name + " by bribing them."); + fac.playerReputation += repGain; + this.funds = this.funds.lt(money); + this.numShares -= stockShares; + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + return false; + } + } + }); + var cancelButton = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { + class:"a-link-button", innerText:"Cancel", display:"inline-block", + clickListener:()=>{ + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + return false; + } + }); + } + }); + companyManagementPanel.appendChild(bribeFactions); } else { - var findInvestors = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var findInvestors = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class: this.fundingRound >= 4 ? "a-link-button-inactive" : "a-link-button tooltip", innerText: "Find Investors", display:"inline-block", @@ -43326,7 +43689,7 @@ Corporation.prototype.displayCorporationOverviewContent = function() { } }); if (this.fundingRound < 4) { - var findInvestorsTooltip = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("span", { + var findInvestorsTooltip = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("span", { class:"tooltiptext", innerText:"Search for private investors who will give you startup funding in exchange " + "for equity (stock shares) in your company" @@ -43334,7 +43697,7 @@ Corporation.prototype.displayCorporationOverviewContent = function() { findInvestors.appendChild(findInvestorsTooltip); } - var goPublic = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var goPublic = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button tooltip", innerText:"Go Public", display:"inline-block", @@ -43343,7 +43706,7 @@ Corporation.prototype.displayCorporationOverviewContent = function() { return false; } }); - var goPublicTooltip = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("span", { + var goPublicTooltip = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("span", { class:"tooltiptext", innerText: "Become a publicly traded and owned entity. Going public involves " + "issuing shares for an IPO. Once you are a public company, " + @@ -43361,10 +43724,10 @@ Corporation.prototype.displayCorporationOverviewContent = function() { //Don't show upgrades if player hasn't opened any divisions if (this.divisions.length <= 0) {return; } //Corporation Upgrades - var upgradeContainer = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var upgradeContainer = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-upgrade-container", }); - upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("h1", { + upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("h1", { innerText:"Unlocks", margin:"6px", padding:"6px", })); @@ -43389,13 +43752,13 @@ Corporation.prototype.displayCorporationOverviewContent = function() { return; } - upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-upgrade-div", width:"45%", - innerHTML:upgrade[2] + " - " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(upgrade[1]).format("$0.000a"), + innerHTML:upgrade[2] + " - " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(upgrade[1]).format("$0.000a"), tooltip: upgrade[3], clickListener:()=>{ if (corp.funds.lt(upgrade[1])) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Insufficient funds"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Insufficient funds"); } else { corp.unlock(upgrade); corp.displayCorporationOverviewContent(); @@ -43407,7 +43770,7 @@ Corporation.prototype.displayCorporationOverviewContent = function() { } //Levelable upgrades - upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("h1", { + upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("h1", { innerText:"Upgrades", margin:"6px", padding:"6px", })); @@ -43421,13 +43784,13 @@ Corporation.prototype.displayCorporationOverviewContent = function() { var baseCost = upgrade[1], priceMult = upgrade[2]; var cost = baseCost * Math.pow(priceMult, corp.upgrades[i]); - upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-upgrade-div", width:"45%", - innerHTML:upgrade[4] + " - " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(cost).format("$0.000a"), + innerHTML:upgrade[4] + " - " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(cost).format("$0.000a"), tooltip:upgrade[5], clickListener:()=>{ if (corp.funds.lt(cost)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Insufficient funds"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Insufficient funds"); } else { corp.upgrade(upgrade); corp.displayCorporationOverviewContent(); @@ -43447,19 +43810,19 @@ Corporation.prototype.updateCorporationOverviewContent = function() { return; } var totalFunds = this.funds, - totalRevenue = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0), - totalExpenses = new __WEBPACK_IMPORTED_MODULE_4__utils_decimal_js___default.a(0); + totalRevenue = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0), + totalExpenses = new __WEBPACK_IMPORTED_MODULE_5__utils_decimal_js___default.a(0); var profit = this.revenue.minus(this.expenses).toNumber(), - profitStr = profit >= 0 ? __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(profit).format("$0.000a") : "-" + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(-1 * profit).format("$0.000a"); + profitStr = profit >= 0 ? __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(profit).format("$0.000a") : "-" + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(-1 * profit).format("$0.000a"); - var txt = "Total Funds: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(totalFunds.toNumber()).format('$0.000a') + "
" + - "Total Revenue: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(this.revenue.toNumber()).format("$0.000a") + " / s
" + - "Total Expenses: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(this.expenses.toNumber()).format("$0.000a") + "/ s
" + + var txt = "Total Funds: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(totalFunds.toNumber()).format('$0.000a') + "
" + + "Total Revenue: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(this.revenue.toNumber()).format("$0.000a") + " / s
" + + "Total Expenses: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(this.expenses.toNumber()).format("$0.000a") + "/ s
" + "Total Profits: " + profitStr + " / s
" + "Publicly Traded: " + (this.public ? "Yes" : "No") + "
" + - "Owned Stock Shares: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(this.numShares).format('0.000a') + "
" + - "Stock Price: " + (this.public ? "$" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sharePrice, 2) : "N/A") + "

"; + "Owned Stock Shares: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(this.numShares).format('0.000a') + "
" + + "Stock Price: " + (this.public ? "$" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sharePrice, 2) : "N/A") + "

"; var prodMult = this.getProductionMultiplier(), storageMult = this.getStorageMultiplier(), @@ -43470,15 +43833,15 @@ Corporation.prototype.updateCorporationOverviewContent = function() { empEffMult = this.getEmployeeEffMultiplier(), salesMult = this.getSalesMultiplier(), sciResMult = this.getScientificResearchMultiplier(); - if (prodMult > 1) {txt += "Production Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(prodMult, 3) + "
";} - if (storageMult > 1) {txt += "Storage Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(storageMult, 3) + "
";} - if (advMult > 1) {txt += "Advertising Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(advMult, 3) + "
";} - if (empCreMult > 1) {txt += "Empl. Creativity Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(empCreMult, 3) + "
";} - if (empChaMult > 1) {txt += "Empl. Charisma Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(empChaMult, 3) + "
";} - if (empIntMult > 1) {txt += "Empl. Intelligence Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(empIntMult, 3) + "
";} - if (empEffMult > 1) {txt += "Empl. Efficiency Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(empEffMult, 3) + "
";} - if (salesMult > 1) {txt += "Sales Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(salesMult, 3) + "
";} - if (sciResMult > 1) {txt += "Scientific Research Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(sciResMult, 3) + "
";} + if (prodMult > 1) {txt += "Production Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(prodMult, 3) + "
";} + if (storageMult > 1) {txt += "Storage Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(storageMult, 3) + "
";} + if (advMult > 1) {txt += "Advertising Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(advMult, 3) + "
";} + if (empCreMult > 1) {txt += "Empl. Creativity Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(empCreMult, 3) + "
";} + if (empChaMult > 1) {txt += "Empl. Charisma Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(empChaMult, 3) + "
";} + if (empIntMult > 1) {txt += "Empl. Intelligence Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(empIntMult, 3) + "
";} + if (empEffMult > 1) {txt += "Empl. Efficiency Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(empEffMult, 3) + "
";} + if (salesMult > 1) {txt += "Sales Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(salesMult, 3) + "
";} + if (sciResMult > 1) {txt += "Scientific Research Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(sciResMult, 3) + "
";} p.innerHTML = txt; } @@ -43498,19 +43861,19 @@ Corporation.prototype.displayDivisionContent = function(division, city) { } //Expand into new City button - companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("button", { + companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("button", { class:"cmpy-mgmt-city-tab", innerText:"Expand into new City", display:"inline-block", clickListener:()=>{ var popupId = "cmpy-mgmt-expand-city-popup"; - var text = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var text = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText: "Would you like to expand into a new city by opening an office? " + - "This would cost " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(OfficeInitialCost).format('$0.000a'), + "This would cost " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(OfficeInitialCost).format('$0.000a'), }); - var citySelector = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("select", {margin:"5px"}); + var citySelector = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("select", {margin:"5px"}); for (var cityName in division.offices) { if (division.offices.hasOwnProperty(cityName)) { if (!(division.offices[cityName] instanceof OfficeSpace)) { - citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("option", { + citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option", { text: cityName, value: cityName })); @@ -43518,37 +43881,37 @@ Corporation.prototype.displayDivisionContent = function(division, city) { } } - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Confirm", class:"a-link-button", display:"inline-block", margin:"3px", clickListener:()=>{ var city = citySelector.options[citySelector.selectedIndex].value; if (this.funds.lt(OfficeInitialCost)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to open a new office!"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to open a new office!"); } else { this.funds = this.funds.minus(OfficeInitialCost); - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Opened a new office in " + city + "!"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Opened a new office in " + city + "!"); division.offices[city] = new OfficeSpace({ loc:city, size:OfficeInitialSize, }); this.displayDivisionContent(division, city); } - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Cancel", class:"a-link-button", display:"inline-block", margin:"3px", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }) - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [text, citySelector, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [text, citySelector, confirmBtn, cancelBtn]); return false; } })); - companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); // Force line break + companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); // Force line break //Get office object var office = division.offices[currentCityUi]; @@ -43558,42 +43921,42 @@ Corporation.prototype.displayDivisionContent = function(division, city) { } //Left and right panels - var leftPanel = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", {class:"cmpy-mgmt-industry-left-panel"}); - var rightPanel = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", {class:"cmpy-mgmt-industry-right-panel"}); + var leftPanel = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", {class:"cmpy-mgmt-industry-left-panel"}); + var rightPanel = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", {class:"cmpy-mgmt-industry-right-panel"}); companyManagementPanel.appendChild(leftPanel); companyManagementPanel.appendChild(rightPanel); //Different sections (Overview, Employee/Office, and Warehouse) - industryOverviewPanel = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + industryOverviewPanel = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { id:"cmpy-mgmt-industry-overview-panel", class:"cmpy-mgmt-industry-overview-panel" }); leftPanel.appendChild(industryOverviewPanel); - industryEmployeePanel = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + industryEmployeePanel = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { id:"cmpy-mgmt-employee-panel", class:"cmpy-mgmt-employee-panel" }); leftPanel.appendChild(industryEmployeePanel); - industryWarehousePanel = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + industryWarehousePanel = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { id:"cmpy-mgmt-warehouse-panel", class:"cmpy-mgmt-warehouse-panel" }); rightPanel.appendChild(industryWarehousePanel); //Industry overview text - industryOverviewText = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); + industryOverviewText = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); industryOverviewPanel.appendChild(industryOverviewText); - industryOverviewPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryOverviewPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); //Industry overview Purchases & Upgrades var numUpgrades = Object.keys(IndustryUpgrades).length; while (division.upgrades.length < numUpgrades) {division.upgrades.push(0);} //Backwards compatibility - var industryOverviewUpgrades = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", {}); - industryOverviewUpgrades.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("u", { + var industryOverviewUpgrades = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", {}); + industryOverviewUpgrades.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("u", { innerText:"Purchases & Upgrades", margin:"2px", padding:"2px", fontSize:"14px", })); - industryOverviewUpgrades.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryOverviewUpgrades.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); for (var i = 0; i < numUpgrades; ++i) { (function(i, corp, division, office) { var upgrade = IndustryUpgrades[i.toString()]; @@ -43611,13 +43974,13 @@ Corporation.prototype.displayDivisionContent = function(division, city) { cost = baseCost * Math.pow(priceMult, division.upgrades[i]); break; } - industryOverviewUpgrades.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", { + industryOverviewUpgrades.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-upgrade-div", display:"inline-block", - innerHTML:upgrade[4] + ' - ' + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(cost).format("$0.000a"), + innerHTML:upgrade[4] + ' - ' + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(cost).format("$0.000a"), tooltip:upgrade[5], clickListener:()=>{ if (corp.funds.lt(cost)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Insufficient funds"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Insufficient funds"); } else { corp.funds = corp.funds.minus(cost); division.upgrade(upgrade, { @@ -43628,7 +43991,7 @@ Corporation.prototype.displayDivisionContent = function(division, city) { } } })); - industryOverviewUpgrades.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryOverviewUpgrades.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); })(i, this, division, office); } @@ -43687,17 +44050,17 @@ Corporation.prototype.displayDivisionContent = function(division, city) { "Investing money in marketing the product will help the product's sales."; //Create the button - industryOverviewPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryOverviewPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:createProductButtonText, margin:"6px", display:"inline-block", clickListener:()=>{ var popupId = "cmpy-mgmt-create-product-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML:createProductPopupText, }); - var designCity = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); + var designCity = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); for (var cityName in division.offices) { if (division.offices[cityName] instanceof OfficeSpace) { - designCity.add(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("option", { + designCity.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option", { value:cityName, text:cityName })); @@ -43711,19 +44074,19 @@ Corporation.prototype.displayDivisionContent = function(division, city) { } else if (division.type === Industries.RealEstate) { foo = "Property Name"; } - var productNameInput = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var productNameInput = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { placeholder:foo, }); - var lineBreak1 = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br",{}); - var designInvestInput = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var lineBreak1 = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br",{}); + var designInvestInput = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Design investment" }); - var marketingInvestInput = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var marketingInvestInput = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Marketing investment" }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Develop Product", clickListener:()=>{ @@ -43732,13 +44095,13 @@ Corporation.prototype.displayDivisionContent = function(division, city) { var designInvest = parseFloat(designInvestInput.value), marketingInvest = parseFloat(marketingInvestInput.value); if (productNameInput.value == null || productNameInput.value === "") { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You must specify a name for your product!"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You must specify a name for your product!"); } else if (isNaN(designInvest)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for design investment"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for design investment"); } else if (isNaN(marketingInvest)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for marketing investment"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for marketing investment"); } else if (this.funds.lt(designInvest + marketingInvest)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to make this large of an investment"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to make this large of an investment"); } else { var product = new Product({ name:productNameInput.value.replace(/[<>]/g, ''), //Sanitize for HTMl elements @@ -43748,28 +44111,28 @@ Corporation.prototype.displayDivisionContent = function(division, city) { }); this.funds = this.funds.minus(designInvest + marketingInvest); division.products[product.name] = product; - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); } this.updateUIContent(); return false; } }) - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }) - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, designCity, productNameInput, lineBreak1, + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, designCity, productNameInput, lineBreak1, designInvestInput, marketingInvestInput, confirmBtn, cancelBtn]); } })); } //Employee and Office Panel - industryEmployeeText = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + industryEmployeeText = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { id: "cmpy-mgmt-employee-p", display:"block", innerHTML: "

Office Space


" + @@ -43781,18 +44144,32 @@ Corporation.prototype.displayDivisionContent = function(division, city) { industryEmployeePanel.appendChild(industryEmployeeText); //Hire Employee button - industryEmployeeHireButton = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { - class:"a-link-button",display:"inline-block", - innerText:"Hire Employee", fontSize:"13px", - clickListener:()=>{ - office.findEmployees({corporation:this, division:division}); - return false; - } - }); + if (office.employees.length === 0) { + industryEmployeeHireButton = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { + class:"a-link-button",display:"inline-block", + innerText:"Hire Employee", fontSize:"13px", + tooltip:"You'll need to hire some employees to get your operations started! " + + "It's recommended to have at least one employee in every position", + clickListener:()=>{ + office.findEmployees({corporation:this, division:division}); + return false; + } + }); + //industryEmployeeHireButton.classList.add("flashing-button"); + } else { + industryEmployeeHireButton = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { + class:"a-link-button",display:"inline-block", + innerText:"Hire Employee", fontSize:"13px", + clickListener:()=>{ + office.findEmployees({corporation:this, division:division}); + return false; + } + }); + } industryEmployeePanel.appendChild(industryEmployeeHireButton); //Autohire Employee button - industryEmployeeAutohireButton = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryEmployeeAutohireButton = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Autohire Employee", fontSize:"13px", tooltip:"Automatically hires an employee and gives him/her a random name", @@ -43804,120 +44181,120 @@ Corporation.prototype.displayDivisionContent = function(division, city) { industryEmployeePanel.appendChild(industryEmployeeAutohireButton); //Upgrade Office Size button - industryEmployeePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); - industryOfficeUpgradeSizeButton = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryEmployeePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryOfficeUpgradeSizeButton = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Upgrade size", display:"inline-block", margin:"6px", fontSize:"13px", tooltip:"Upgrade the office's size so that it can hold more employees!", clickListener:()=>{ var popupId = "cmpy-mgmt-upgrade-office-size-popup"; var upgradeCost = OfficeInitialCost * Math.pow(1.07, Math.round(office.size / OfficeInitialSize)); - var text = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var text = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML:"Increase the size of your office space to fit " + OfficeInitialSize + - " more employees. This will cost " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(upgradeCost).format('$0.000a'), + " more employees. This will cost " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(upgradeCost).format('$0.000a'), }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", margin:"8px", innerText:"Upgrade Office Size", clickListener:()=>{ if (this.funds.lt(upgradeCost)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to purchase this upgrade!"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to purchase this upgrade!"); } else { office.size += OfficeInitialSize; this.funds = this.funds.minus(upgradeCost); - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Office space increased! It can now hold " + office.size + " employees"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Office space increased! It can now hold " + office.size + " employees"); this.updateUIContent(); } - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", display:"inline-block", margin:"8px", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }) - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [text, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [text, confirmBtn, cancelBtn]); return false; } }); industryEmployeePanel.appendChild(industryOfficeUpgradeSizeButton); //Throw Office Party - industryEmployeePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryEmployeePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Throw Party", fontSize:"13px", tooltip:"Throw an office party to increase your employee's morale and happiness", clickListener:()=>{ var popupId = "cmpy-mgmt-throw-office-party-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Enter the amount of money you would like to spend PER EMPLOYEE " + "on this office party" }); - var totalCostTxt = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var totalCostTxt = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Throwing this party will cost a total of $0" }); - var input = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var input = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", margin:"5px", placeholder:"$ / employee", inputListener:()=>{ if (isNaN(input.value) || input.value < 0) { totalCostTxt.innerText = "Invalid value entered!" } else { var totalCost = input.value * office.employees.length; - totalCostTxt.innerText = "Throwing this party will cost a total of " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(totalCost).format('$0.000a'); + totalCostTxt.innerText = "Throwing this party will cost a total of " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(totalCost).format('$0.000a'); } } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Throw Party", clickListener:()=>{ if (isNaN(input.value) || input.value < 0) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value entered"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value entered"); } else { var totalCost = input.value * office.employees.length; if (this.funds.lt(totalCost)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to throw this party!"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to throw this party!"); } else { this.funds = this.funds.minus(totalCost); var mult; for (var fooit = 0; fooit < office.employees.length; ++fooit) { mult = office.employees[fooit].throwParty(input.value); } - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You threw a party for the office! The morale and happiness " + - "of each employee increased by " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])((mult-1) * 100, 2) + "%."); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You threw a party for the office! The morale and happiness " + + "of each employee increased by " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])((mult-1) * 100, 2) + "%."); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); } } return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, totalCostTxt, input, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, totalCostTxt, input, confirmBtn, cancelBtn]); } })); - industryEmployeeManagementUI = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", {}); - industryEmployeeInfo = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", {margin:"4px", padding:"4px"}); + industryEmployeeManagementUI = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", {}); + industryEmployeeInfo = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", {margin:"4px", padding:"4px"}); if (empManualAssignmentModeActive) { //Employees manually assigned - industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", margin:"4px", innerText:"Switch to Auto Mode", tooltip:"Switch to Automatic Assignment Mode, which will automatically " + @@ -43928,16 +44305,16 @@ Corporation.prototype.displayDivisionContent = function(division, city) { this.displayDivisionContent(division, city); } })); - industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); - industryIndividualEmployeeInfo = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("div", {margin:"4px", padding:"4px"}); - var selector = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("select", { + industryIndividualEmployeeInfo = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("div", {margin:"4px", padding:"4px"}); + var selector = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("select", { color: "white", backgroundColor:"black", margin:"4px", padding:"4px", changeListener:()=>{ var name = selector.options[selector.selectedIndex].text; for (var i = 0; i < office.employees.length; ++i) { if (office.employees[i].name === name) { - Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(industryIndividualEmployeeInfo); + Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(industryIndividualEmployeeInfo); office.employees[i].createUI(industryIndividualEmployeeInfo, this); return; } @@ -43947,7 +44324,7 @@ Corporation.prototype.displayDivisionContent = function(division, city) { }); for (var i = 0; i < office.employees.length; ++i) { - selector.add(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("option", {text:office.employees[i].name})); + selector.add(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("option", {text:office.employees[i].name})); } selector.selectedIndex = -1; @@ -43957,7 +44334,7 @@ Corporation.prototype.displayDivisionContent = function(division, city) { industryEmployeeManagementUI.appendChild(industryIndividualEmployeeInfo); } else { //Player only manages the number of each occupation, not who gets what job - industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", margin:"4px", innerText:"Switch to Manual Mode", tooltip:"Switch to Manual Assignment Mode, which allows you to " + @@ -43967,7 +44344,7 @@ Corporation.prototype.displayDivisionContent = function(division, city) { this.displayDivisionContent(division, city); } })); - industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); var opCount = 0, engCount = 0, busCount = 0, mgmtCount = 0, rndCount = 0, unassignedCount = 0, @@ -43995,15 +44372,15 @@ Corporation.prototype.displayDivisionContent = function(division, city) { } //Unassigned employee count display - industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { + industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { display:"inline-block", innerText:"Unassigned Employees: " + unassignedCount, })); - industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); //General display of employee information (avg morale, avg energy, etc.) industryEmployeeManagementUI.appendChild(industryEmployeeInfo); - industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryEmployeeManagementUI.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); var positions = [EmployeePositions.Operations, EmployeePositions.Engineer, EmployeePositions.Business, EmployeePositions.Management, @@ -44017,12 +44394,12 @@ Corporation.prototype.displayDivisionContent = function(division, city) { var counts = [opCount, engCount, busCount, mgmtCount, rndCount, trainingCount]; for (var i = 0; i < positions.length; ++i) { (function(corp, i) { - var info = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("h2", { + var info = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("h2", { display:"inline-block", width:"40%", fontSize:"15px", innerText: positions[i] + "(" + counts[i] + ")", tooltipleft: descriptions[i] }); - var plusBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var plusBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class: unassignedCount > 0 ? "a-link-button" : "a-link-button-inactive", display:"inline-block", innerText:"+", clickListener:()=>{ @@ -44030,7 +44407,7 @@ Corporation.prototype.displayDivisionContent = function(division, city) { corp.displayDivisionContent(division, city); } }); - var minusBtn = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var minusBtn = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { class: counts[i] > 0 ? "a-link-button" : "a-link-button-inactive", display:"inline-block", innerText:"-", clickListener:()=>{ @@ -44038,7 +44415,7 @@ Corporation.prototype.displayDivisionContent = function(division, city) { corp.displayDivisionContent(division, city); } }); - var newline = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {}); + var newline = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {}); industryEmployeeManagementUI.appendChild(info); industryEmployeeManagementUI.appendChild(plusBtn); industryEmployeeManagementUI.appendChild(minusBtn); @@ -44053,12 +44430,12 @@ Corporation.prototype.displayDivisionContent = function(division, city) { if (warehouse instanceof Warehouse) { warehouse.createUI({industry:division, company: this}); } else { - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Purchase Warehouse ($5b)", class: "a-link-button", clickListener:()=>{ if (this.funds.lt(WarehouseInitialCost)) { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You do not have enough funds to do this!"); + Object(__WEBPACK_IMPORTED_MODULE_6__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You do not have enough funds to do this!"); } else { division.warehouses[currentCityUi] = new Warehouse({ loc:currentCityUi, @@ -44082,7 +44459,7 @@ Corporation.prototype.updateDivisionContent = function(division) { var vechain = (this.unlockUpgrades[4] === 1); //Industry Overview Text var profit = division.lastCycleRevenue.minus(division.lastCycleExpenses).toNumber(), - profitStr = profit >= 0 ? __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(profit).format("$0.000a") : "-" + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(-1 * profit).format("$0.000a"); + profitStr = profit >= 0 ? __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(profit).format("$0.000a") : "-" + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(-1 * profit).format("$0.000a"); var advertisingInfo = ""; if (vechain) { var advertisingFactors = division.getAdvertisingFactors(); @@ -44091,25 +44468,25 @@ Corporation.prototype.updateDivisionContent = function(division) { var ratioFac = advertisingFactors[3]; var totalAdvertisingFac = advertisingFactors[0]; advertisingInfo = - "

Advertising Multiplier: x" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalAdvertisingFac, 3) + + "

Advertising Multiplier: x" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalAdvertisingFac, 3) + "Total multiplier for this industry's sales due to its awareness and popularity
" + - "Awareness Bonus: x" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(awarenessFac, 3) + "
" + - "Popularity Bonus: x" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(popularityFac, 3) + "
" + - "Ratio Multiplier: x" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(ratioFac, 3) + "


" + "Awareness Bonus: x" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(awarenessFac, 3) + "
" + + "Popularity Bonus: x" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(popularityFac, 3) + "
" + + "Ratio Multiplier: x" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(ratioFac, 3) + "


" } industryOverviewText.innerHTML = "Industry: " + division.type + "

" + - "Awareness: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.awareness, 3) + "
" + - "Popularity: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.popularity, 3) + "
" + + "Awareness: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.awareness, 3) + "
" + + "Popularity: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.popularity, 3) + "
" + advertisingInfo + "
" + - "Revenue: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(division.lastCycleRevenue.toNumber()).format("$0.000a") + " / s
" + - "Expenses: " + __WEBPACK_IMPORTED_MODULE_8__utils_numeral_min_js___default()(division.lastCycleExpenses.toNumber()).format("$0.000a") + " /s
" + + "Revenue: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(division.lastCycleRevenue.toNumber()).format("$0.000a") + " / s
" + + "Expenses: " + __WEBPACK_IMPORTED_MODULE_9__utils_numeral_min_js___default()(division.lastCycleExpenses.toNumber()).format("$0.000a") + " /s
" + "Profit: " + profitStr + " / s

" + - "

Production Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.prodMult, 2) + + "

Production Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.prodMult, 2) + "Production gain from owning production-boosting materials " + "such as hardware, Robots, AI Cores, and Real Estate


" + - "Scientific Research: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.sciResearch.qty, 3); + "Scientific Research: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.sciResearch.qty, 3); //Office and Employee List var office = division.offices[currentCityUi]; @@ -44122,6 +44499,9 @@ Corporation.prototype.updateDivisionContent = function(division) { if (office.employees.length >= office.size) { industryEmployeeHireButton.className = "a-link-button-inactive"; industryEmployeeAutohireButton.className = "a-link-button-inactive tooltip"; + } else if (office.employees.length === 0) { + industryEmployeeHireButton.className = "a-link-button tooltip flashing-button"; + industryEmployeeAutohireButton.className = "a-link-button tooltip"; } else { industryEmployeeHireButton.className = "a-link-button"; industryEmployeeAutohireButton.className = "a-link-button tooltip"; @@ -44142,27 +44522,27 @@ Corporation.prototype.updateDivisionContent = function(division) { avgEnergy = totalEnergy / office.employees.length; } industryEmployeeInfo.innerHTML = - "Avg Employee Morale: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(avgMorale, 3) + "
" + - "Avg Employee Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(avgHappiness, 3) + "
" + - "Avg Employee Energy: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(avgEnergy, 3); + "Avg Employee Morale: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(avgMorale, 3) + "
" + + "Avg Employee Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(avgHappiness, 3) + "
" + + "Avg Employee Energy: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(avgEnergy, 3); if (vechain) { //VeChain - Statistics - industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); - industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { - innerText:"Material Production: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.getOfficeProductivity(office), 3), + industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { + innerText:"Material Production: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.getOfficeProductivity(office), 3), tooltip: "The base amount of material this office can produce. Does not include " + "production multipliers from upgrades and materials. This value is based off " + "the productivity of your Operations, Engineering, and Management employees" })); - industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); - industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { - innerText:"Product Production: " + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.getOfficeProductivity(office, {forProduct:true}), 3), + industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { + innerText:"Product Production: " + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.getOfficeProductivity(office, {forProduct:true}), 3), tooltip: "The base amount of any given Product this office can produce. Does not include " + "production multipliers from upgrades and materials. This value is based off " + "the productivity of your Operations, Engineering, and Management employees" })); - industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); - industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("p", { - innerText: "Business Multiplier: x" + Object(__WEBPACK_IMPORTED_MODULE_9__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.getBusinessFactor(office), 3), + industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); + industryEmployeeInfo.appendChild(Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("p", { + innerText: "Business Multiplier: x" + Object(__WEBPACK_IMPORTED_MODULE_10__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.getBusinessFactor(office), 3), tooltip: "The effect this office's 'Business' employees has on boosting sales" })); } @@ -44175,7 +44555,7 @@ Corporation.prototype.updateDivisionContent = function(division) { } Corporation.prototype.createCityUITab = function(city, division) { - var tab = Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["f" /* createElement */])("button", { + var tab = Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["f" /* createElement */])("button", { id:"cmpy-mgmt-city-" + city + "-tab", class:"cmpy-mgmt-city-tab", innerText:city, @@ -44201,7 +44581,7 @@ Corporation.prototype.selectCityTab = function(activeTab, city) { Corporation.prototype.clearUI = function() { //Delete everything - if (companyManagementDiv != null) {Object(__WEBPACK_IMPORTED_MODULE_6__utils_HelperFunctions_js__["m" /* removeElementById */])(companyManagementDiv.id);} + if (companyManagementDiv != null) {Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["m" /* removeElementById */])(companyManagementDiv.id);} //Reset global DOM variables companyManagementDiv = null; @@ -44234,14 +44614,14 @@ Corporation.prototype.clearUI = function() { } Corporation.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Corporation", this); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Corporation", this); } Corporation.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Corporation, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Corporation, value.data); } -__WEBPACK_IMPORTED_MODULE_7__utils_JSONReviver_js__["c" /* Reviver */].constructors.Corporation = Corporation; +__WEBPACK_IMPORTED_MODULE_8__utils_JSONReviver_js__["c" /* Reviver */].constructors.Corporation = Corporation; @@ -45776,18 +46156,19 @@ function applySourceFile(srcFile) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return makeRuntimeRejectMsg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return netscriptDelay; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return runScriptFromScript; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return scriptCalculateHackingChance; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return scriptCalculateHackingTime; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return scriptCalculateExpGain; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return scriptCalculatePercentMoneyHacked; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return scriptCalculateGrowTime; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return scriptCalculateWeakenTime; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return makeRuntimeRejectMsg; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return netscriptDelay; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return runScriptFromScript; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return scriptCalculateHackingChance; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return scriptCalculateHackingTime; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return scriptCalculateExpGain; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return scriptCalculatePercentMoneyHacked; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return scriptCalculateGrowTime; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return scriptCalculateWeakenTime; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return evaluate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isScriptErrorMessage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return killNetscriptDelay; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isScriptErrorMessage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return killNetscriptDelay; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return evaluateImport; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BitNode_js__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Constants_js__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Player_js__ = __webpack_require__(0); @@ -45815,7 +46196,7 @@ function applySourceFile(srcFile) { -var Promise = __webpack_require__(69); +var Promise = __webpack_require__(70); Promise.config({ warnings: false, @@ -45833,7 +46214,7 @@ function evaluate(exp, workerScript) { var env = workerScript.env; if (env.stopFlag) {return Promise.reject(workerScript);} if (exp == null) { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Error: NULL expression")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Error: NULL expression", exp)); } if (env.stopFlag) {return Promise.reject(workerScript);} switch (exp.type) { @@ -45861,11 +46242,11 @@ function evaluate(exp, workerScript) { case "Identifier": //Javascript constructor() method can be used as an exploit to run arbitrary code if (exp.name == "constructor") { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Illegal usage of constructor() method. If you have your own function named 'constructor', you must re-name it.")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Illegal usage of constructor() method. If you have your own function named 'constructor', you must re-name it.", exp)); } if (!(exp.name in env.vars)){ - return Promise.reject(makeRuntimeRejectMsg(workerScript, "variable " + exp.name + " not defined")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "variable " + exp.name + " not defined", exp)); } return Promise.resolve(env.get(exp.name)) break; @@ -45937,7 +46318,7 @@ function evaluate(exp, workerScript) { return Promise.reject(makeRuntimeRejectMsg(workerScript, e.toString())); } }); - } else if (exp.callee.type == "MemberExpression"){ + } else if (exp.callee.type === "MemberExpression"){ return evaluate(exp.callee.object, workerScript).then(function(object) { try { if (func === "NETSCRIPTFOREACH") { @@ -45950,7 +46331,7 @@ function evaluate(exp, workerScript) { var res = func.apply(object,args); return Promise.resolve(res); } catch (e) { - return Promise.reject(makeRuntimeRejectMsg(workerScript, e)); + return Promise.reject(makeRuntimeRejectMsg(workerScript, e, exp)); } }); } else { @@ -45960,6 +46341,11 @@ function evaluate(exp, workerScript) { return out.then(function(res) { return Promise.resolve(res) }).catch(function(e) { + if (isScriptErrorMessage(e)) { + //Functions don't have line number appended in error message, so add it + var num = getErrorLineNumber(exp, workerScript); + e += " (Line " + num + ")"; + } return Promise.reject(e); }); } else { @@ -45967,9 +46353,14 @@ function evaluate(exp, workerScript) { } } catch (e) { if (isScriptErrorMessage(e)) { + if (isScriptErrorMessage(e)) { + //Functions don't have line number appended in error message, so add it + var num = getErrorLineNumber(exp, workerScript); + e += " (Line " + num + ")"; + } return Promise.reject(e); } else { - return Promise.reject(makeRuntimeRejectMsg(workerScript, e)); + return Promise.reject(makeRuntimeRejectMsg(workerScript, e, exp)); } } } @@ -45981,19 +46372,19 @@ function evaluate(exp, workerScript) { if (exp.computed){ return evaluate(exp.property, workerScript).then(function(index) { if (index >= object.length) { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid index for arrays")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid index for arrays", exp)); } return Promise.resolve(object[index]); }).catch(function(e) { if (e instanceof __WEBPACK_IMPORTED_MODULE_4__NetscriptWorker_js__["b" /* WorkerScript */] || isScriptErrorMessage(e)) { return Promise.reject(e); } else { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid MemberExpression")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid MemberExpression", exp)); } }); } else { if (exp.property.name === "constructor") { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Illegal usage of constructor() method. If you have your own function named 'constructor', you must re-name it.")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Illegal usage of constructor() method. If you have your own function named 'constructor', you must re-name it.", exp)); } if (object != null && object instanceof Array && exp.property.name === "forEach") { return "NETSCRIPTFOREACH"; @@ -46001,7 +46392,7 @@ function evaluate(exp, workerScript) { try { return Promise.resolve(object[exp.property.name]) } catch (e) { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to get property: " + e.toString())); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to get property: " + e.toString(), exp)); } } }); @@ -46037,14 +46428,14 @@ function evaluate(exp, workerScript) { } switch (exp.operator){ default: - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Unrecognized token: " + exp.type + ". You are trying to use code that is currently unsupported")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Unrecognized token: " + exp.type + ". You are trying to use code that is currently unsupported", exp)); } return Promise.resolve(env.get(exp.argument.name)) } else { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "variable " + exp.argument.name + " not defined")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "variable " + exp.argument.name + " not defined", exp)); } } else { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "argument must be an identifier")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "argument must be an identifier", exp)); } break; case "EmptyStatement": @@ -46065,8 +46456,7 @@ function evaluate(exp, workerScript) { return evaluateIf(exp, workerScript); break; case "SwitchStatement": - var lineNum = getErrorLineNumber(exp, workerScript); - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Switch statements are not yet implemented in Netscript (line " + (lineNum+1) + ")")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Switch statements are not yet implemented in Netscript", exp)); break; case "WhileStatement": return evaluateWhile(exp, workerScript).then(function(res) { @@ -46099,13 +46489,24 @@ function evaluate(exp, workerScript) { env.set(exp.id.name, exp); return Promise.resolve(true); } else { - var lineNum = getErrorLineNumber(exp, workerScript); - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid function declaration at line " + lineNum+1)); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid function declaration", exp)); } break; + case "ImportDeclaration": + return evaluateImport(exp, workerScript).then(function(res) { + return Promise.resolve(res); + }).catch(function(e) { + return Promise.reject(e); + }); + break; + case "ThrowStatement": + //return Promise.reject(makeRuntimeRejectMsg(workerScript)) + return evaluate(exp.argument, workerScript).then(function(res) { + return Promise.reject(makeRuntimeRejectMsg(workerScript, res)); + }); + break; default: - var lineNum = getErrorLineNumber(exp, workerScript); - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Unrecognized token: " + exp.type + " (line " + (lineNum+1) + "). This is currently unsupported in Netscript")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Unrecognized token: " + exp.type + ". This is currently unsupported in Netscript", exp)); break; } //End switch }).catch(function(e) { @@ -46240,6 +46641,9 @@ function evalAssignment(exp, workerScript) { return evaluate(exp.right, workerScript).then(function(expRight) { if (exp.left.type == "MemberExpression") { + if (!exp.left.computed) { + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Cannot assign to an object's property. This is currently unsupported in Netscript", exp)); + } //Assign to array element //Array object designed by exp.left.object.name //Index designated by exp.left.property @@ -46252,37 +46656,38 @@ function evalAssignment(exp, workerScript) { var arrName = res.splice(1, 1); arrName = arrName[0]; - env.setArrayElement(arrName, res, expRight); - return Promise.resolve(false); + var res; + try { + res = env.setArrayElement(arrName, res, expRight); + } catch (e) { + return Promise.reject(makeRuntimeRejectMsg(workerScript, e)); + } + return Promise.resolve(res); }).catch(function(e) { return Promise.reject(e); }); } else { //Other assignments try { + var assign; switch (exp.operator) { case "=": - env.set(exp.left.name,expRight); - break; + assign = expRight; break; case "+=": - env.set(exp.left.name,env.get(exp.left.name) + expRight); - break; + assign = env.get(exp.left.name) + expRight; break; case "-=": - env.set(exp.left.name,env.get(exp.left.name) - expRight); - break; + assign = env.get(exp.left.name) - expRight; break; case "*=": - env.set(exp.left.name,env.get(exp.left.name) * expRight); - break; + assign = env.get(exp.left.name) * expRight; break; case "/=": - env.set(exp.left.name,env.get(exp.left.name) / expRight); - break; + assign = env.get(exp.left.name) / expRight; break; case "%=": - env.set(exp.left.name,env.get(exp.left.name) % expRight); - break; + assign = env.get(exp.left.name) % expRight; break; default: return Promise.reject(makeRuntimeRejectMsg(workerScript, "Bitwise assignment is not implemented")); } - return Promise.resolve(false); + env.set(exp.left.name, assign); + return Promise.resolve(assign); } catch (e) { return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to set environment variable: " + e.toString())); } @@ -46439,14 +46844,117 @@ function evaluateProg(exp, workerScript, index) { } } -function killNetscriptDelay(workerScript) { - /* - if (workerScript instanceof WorkerScript) { - if (workerScript.delay) { - workerScript.delay.cancel(); +function evaluateImport(exp, workerScript, checkingRam=false) { + //When its checking RAM, it exports an array of nodes for each imported function + var ramCheckRes = []; + + var env = workerScript.env; + if (env.stopFlag) { + if (checkingRam) {return ramCheckRes;} + return Promise.reject(workerScript); + } + + //Get source script and name of all functions to import + var scriptName = exp.source.value; + var namespace, namespaceObj, allFns = false, fnNames = []; + if (exp.specifiers.length === 1 && exp.specifiers[0].type === "ImportNamespaceSpecifier") { + allFns = true; + namespace = exp.specifiers[0].local.name; + } else { + for (var i = 0; i < exp.specifiers.length; ++i) { + fnNames.push(exp.specifiers[i].local.name); } } - */ + + //Get the code + var server = Object(__WEBPACK_IMPORTED_MODULE_5__Server_js__["e" /* getServer */])(workerScript.serverIp), code = ""; + if (server == null) { + if (checkingRam) {return ramCheckRes;} + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to identify server. This is a bug please report to dev", exp)); + } + for (var i = 0; i < server.scripts.length; ++i) { + if (server.scripts[i].filename === scriptName) { + code = server.scripts[i].code; + break; + } + } + if (code === "") { + if (checkingRam) {return ramCheckRes;} + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Could not find script " + scriptName + " to import", exp)); + } + + //Create the AST + try { + var ast = Object(__WEBPACK_IMPORTED_MODULE_8__utils_acorn_js__["parse"])(code, {sourceType:"module"}); + } catch(e) { + console.log("Failed to parse import script"); + if (checkingRam) {return ramCheckRes;} + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to import functions from " + scriptName + + " This is most likely due to a syntax error in the imported script", exp)); + } + + if (allFns) { + //A namespace is implemented as a JS obj + env.set(namespace, {}); + namespaceObj = env.get(namespace); + } + + //Search through the AST for all imported functions + var queue = [ast]; + while (queue.length != 0) { + var node = queue.shift(); + switch (node.type) { + case "BlockStatement": + case "Program": + for (var i = 0; i < node.body.length; ++i) { + if (node.body[i] instanceof __WEBPACK_IMPORTED_MODULE_8__utils_acorn_js__["Node"]) { + queue.push(node.body[i]); + } + } + break; + case "FunctionDeclaration": + if (node.id && node.id.name) { + if (allFns) { + //Import all functions under this namespace + if (checkingRam) { + ramCheckRes.push(node); + } else { + namespaceObj[node.id.name] = node; + } + } else { + //Only import specified functions + if (fnNames.includes(node.id.name)) { + if (checkingRam) { + ramCheckRes.push(node); + } else { + env.set(node.id.name, node); + } + + } + } + } else { + if (checkingRam) {return ramCheckRes;} + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid function declaration in imported script " + scriptName, exp)); + } + break; + default: + break; + } + + for (var prop in node) { + if (node.hasOwnProperty(prop)) { + if (node[prop] instanceof __WEBPACK_IMPORTED_MODULE_8__utils_acorn_js__["Node"]) { + queue.push(node[prop]); + } + } + } + } + if (!checkingRam) {workerScript.scriptRef.log("Imported functions from " + scriptName);} + if (checkingRam) {return ramCheckRes;} + return Promise.resolve(true); +} + +function killNetscriptDelay(workerScript) { if (workerScript instanceof __WEBPACK_IMPORTED_MODULE_4__NetscriptWorker_js__["b" /* WorkerScript */]) { if (workerScript.delay) { clearTimeout(workerScript.delay); @@ -46456,19 +46964,6 @@ function killNetscriptDelay(workerScript) { } function netscriptDelay(time, workerScript) { - /* - workerScript.delay = new Promise(function(resolve, reject, onCancel) { - Promise.delay(time).then(function() { - resolve(); - workerScript.delay = null; - }); - onCancel(function() { - console.log("Cancelling and rejecting this Promise"); - reject(workerScript); - }) - }); - return workerScript.delay; - */ return new Promise(function(resolve, reject) { workerScript.delay = setTimeout(()=>{ workerScript.delay = null; @@ -46478,41 +46973,15 @@ function netscriptDelay(time, workerScript) { }); } -function makeRuntimeRejectMsg(workerScript, msg) { - return "|"+workerScript.serverIp+"|"+workerScript.name+"|" + msg; +function makeRuntimeRejectMsg(workerScript, msg, exp=null) { + var lineNum = ""; + if (exp != null) { + var num = getErrorLineNumber(exp, workerScript); + lineNum = " (Line " + num + ")" + } + return "|"+workerScript.serverIp+"|"+workerScript.name+"|" + msg + lineNum; } -/* -function apply_op(op, a, b) { - function num(x) { - if (typeof x != "number") - throw new Error("Expected number but got " + x); - return x; - } - function div(x) { - if (num(x) == 0) - throw new Error("Divide by zero"); - return x; - } - switch (op) { - case "+": return a + b; - case "-": return num(a) - num(b); - case "*": return num(a) * num(b); - case "/": return num(a) / div(b); - case "%": return num(a) % div(b); - case "&&": return a !== false && b; - case "||": return a !== false ? a : b; - case "<": return num(a) < num(b); - case ">": return num(a) > num(b); - case "<=": return num(a) <= num(b); - case ">=": return num(a) >= num(b); - case "==": return a === b; - case "!=": return a !== b; - } - throw new Error("Can't apply operator " + op); -} -*/ - //Run a script from inside a script using run() command function runScriptFromScript(server, scriptname, args, workerScript, threads=1) { //Check if the script is already running @@ -46561,13 +47030,16 @@ function runScriptFromScript(server, scriptname, args, workerScript, threads=1) return Promise.resolve(false); } -//Takes in a function getErrorLineNumber(exp, workerScript) { var code = workerScript.scriptRef.scriptRef.code; //Split code up to the start of the node - code = code.substring(0, exp.start); - return (code.match(/\n/g) || []).length; + try { + code = code.substring(0, exp.start); + return (code.match(/\n/g) || []).length + 1; + } catch(e) { + return -1; + } } function isScriptErrorMessage(msg) { @@ -46645,7 +47117,12 @@ function scriptCalculateWeakenTime(server) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Environment; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__NetscriptFunctions_js__ = __webpack_require__(23); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__HacknetNode_js__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__NetscriptFunctions_js__ = __webpack_require__(23); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__NetscriptPort_js__ = __webpack_require__(76); + + + /* Environment * NetScript program environment @@ -46656,7 +47133,7 @@ function Environment(workerScript,parent) { //this.vars = parent.vars; this.vars = Object.assign({}, parent.vars); } else { - this.vars = Object(__WEBPACK_IMPORTED_MODULE_0__NetscriptFunctions_js__["a" /* NetscriptFunctions */])(workerScript); + this.vars = Object(__WEBPACK_IMPORTED_MODULE_1__NetscriptFunctions_js__["a" /* NetscriptFunctions */])(workerScript); } this.parent = parent; this.stopFlag = false; @@ -46721,6 +47198,14 @@ Environment.prototype = { } res = res[i]; } + + //Cant assign to ports or HacknetNodes + if (res[idx[idx.length-1]] instanceof __WEBPACK_IMPORTED_MODULE_0__HacknetNode_js__["a" /* HacknetNode */]) { + throw new Error("Cannot assign a Hacknet Node handle to a new value"); + } + if (res[idx[idx.length-1]] instanceof __WEBPACK_IMPORTED_MODULE_2__NetscriptPort_js__["a" /* NetscriptPort */]) { + throw new Error("Cannot assign a Netscript Port handle to a new value"); + } return res[idx[idx.length-1]] = value; }, @@ -50402,15 +50887,15 @@ module.exports = g; "use strict"; /* unused harmony export hacknetNodesInit */ -/* unused harmony export HacknetNode */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return purchaseHacknet; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HacknetNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return purchaseHacknet; }); /* unused harmony export updateTotalHacknetProduction */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCostOfNextHacknetNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getCostOfNextHacknetNode; }); /* unused harmony export updateHacknetNodesMultiplierButtons */ /* unused harmony export getMaxNumberLevelUpgrades */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return displayHacknetNodesContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return updateHacknetNodesContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return processAllHacknetNodeEarnings; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return displayHacknetNodesContent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return updateHacknetNodesContent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return processAllHacknetNodeEarnings; }); /* unused harmony export getHacknetNode */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BitNode_js__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Constants_js__ = __webpack_require__(3); @@ -52417,6 +52902,13 @@ module.exports = function() { /***/ }), /* 45 */ +/***/ (function(module, exports) { + +module.exports.id = 'ace/mode/javascript_worker'; +module.exports.src = "\"no use strict\";!function(window){function resolveModuleId(id,paths){for(var testPath=id,tail=\"\";testPath;){var alias=paths[testPath];if(\"string\"==typeof alias)return alias+tail;if(alias)return alias.location.replace(/\\/*$/,\"/\")+(tail||alias.main||alias.name);if(alias===!1)return\"\";var i=testPath.lastIndexOf(\"/\");if(-1===i)break;tail=testPath.substr(i)+tail,testPath=testPath.slice(0,i)}return id}if(!(void 0!==window.window&&window.document||window.acequire&&window.define)){window.console||(window.console=function(){var msgs=Array.prototype.slice.call(arguments,0);postMessage({type:\"log\",data:msgs})},window.console.error=window.console.warn=window.console.log=window.console.trace=window.console),window.window=window,window.ace=window,window.onerror=function(message,file,line,col,err){postMessage({type:\"error\",data:{message:message,data:err.data,file:file,line:line,col:col,stack:err.stack}})},window.normalizeModule=function(parentId,moduleName){if(-1!==moduleName.indexOf(\"!\")){var chunks=moduleName.split(\"!\");return window.normalizeModule(parentId,chunks[0])+\"!\"+window.normalizeModule(parentId,chunks[1])}if(\".\"==moduleName.charAt(0)){var base=parentId.split(\"/\").slice(0,-1).join(\"/\");for(moduleName=(base?base+\"/\":\"\")+moduleName;-1!==moduleName.indexOf(\".\")&&previous!=moduleName;){var previous=moduleName;moduleName=moduleName.replace(/^\\.\\//,\"\").replace(/\\/\\.\\//,\"/\").replace(/[^\\/]+\\/\\.\\.\\//,\"\")}}return moduleName},window.acequire=function acequire(parentId,id){if(id||(id=parentId,parentId=null),!id.charAt)throw Error(\"worker.js acequire() accepts only (parentId, id) as arguments\");id=window.normalizeModule(parentId,id);var module=window.acequire.modules[id];if(module)return module.initialized||(module.initialized=!0,module.exports=module.factory().exports),module.exports;if(!window.acequire.tlns)return console.log(\"unable to load \"+id);var path=resolveModuleId(id,window.acequire.tlns);return\".js\"!=path.slice(-3)&&(path+=\".js\"),window.acequire.id=id,window.acequire.modules[id]={},importScripts(path),window.acequire(parentId,id)},window.acequire.modules={},window.acequire.tlns={},window.define=function(id,deps,factory){if(2==arguments.length?(factory=deps,\"string\"!=typeof id&&(deps=id,id=window.acequire.id)):1==arguments.length&&(factory=id,deps=[],id=window.acequire.id),\"function\"!=typeof factory)return window.acequire.modules[id]={exports:factory,initialized:!0},void 0;deps.length||(deps=[\"require\",\"exports\",\"module\"]);var req=function(childId){return window.acequire(id,childId)};window.acequire.modules[id]={exports:{},factory:function(){var module=this,returnExports=factory.apply(this,deps.map(function(dep){switch(dep){case\"require\":return req;case\"exports\":return module.exports;case\"module\":return module;default:return req(dep)}}));return returnExports&&(module.exports=returnExports),module}}},window.define.amd={},acequire.tlns={},window.initBaseUrls=function(topLevelNamespaces){for(var i in topLevelNamespaces)acequire.tlns[i]=topLevelNamespaces[i]},window.initSender=function(){var EventEmitter=window.acequire(\"ace/lib/event_emitter\").EventEmitter,oop=window.acequire(\"ace/lib/oop\"),Sender=function(){};return function(){oop.implement(this,EventEmitter),this.callback=function(data,callbackId){postMessage({type:\"call\",id:callbackId,data:data})},this.emit=function(name,data){postMessage({type:\"event\",name:name,data:data})}}.call(Sender.prototype),new Sender};var main=window.main=null,sender=window.sender=null;window.onmessage=function(e){var msg=e.data;if(msg.event&&sender)sender._signal(msg.event,msg.data);else if(msg.command)if(main[msg.command])main[msg.command].apply(main,msg.args);else{if(!window[msg.command])throw Error(\"Unknown command:\"+msg.command);window[msg.command].apply(window,msg.args)}else if(msg.init){window.initBaseUrls(msg.tlns),acequire(\"ace/lib/es5-shim\"),sender=window.sender=window.initSender();var clazz=acequire(msg.module)[msg.classname];main=window.main=new clazz(sender)}}}}(this),ace.define(\"ace/lib/oop\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";exports.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports.mixin=function(obj,mixin){for(var key in mixin)obj[key]=mixin[key];return obj},exports.implement=function(proto,mixin){exports.mixin(proto,mixin)}}),ace.define(\"ace/range\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn},this.end={row:endRow,column:endColumn}};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column},this.toString=function(){return\"Range: [\"+this.start.row+\"/\"+this.start.column+\"] -> [\"+this.end.row+\"/\"+this.end.column+\"]\"},this.contains=function(row,column){return 0==this.compare(row,column)},this.compareRange=function(range){var cmp,end=range.end,start=range.start;return cmp=this.compare(end.row,end.column),1==cmp?(cmp=this.compare(start.row,start.column),1==cmp?2:0==cmp?1:0):-1==cmp?-2:(cmp=this.compare(start.row,start.column),-1==cmp?-1:1==cmp?42:0)},this.comparePoint=function(p){return this.compare(p.row,p.column)},this.containsRange=function(range){return 0==this.comparePoint(range.start)&&0==this.comparePoint(range.end)},this.intersects=function(range){var cmp=this.compareRange(range);return-1==cmp||0==cmp||1==cmp},this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column},this.isStart=function(row,column){return this.start.row==row&&this.start.column==column},this.setStart=function(row,column){\"object\"==typeof row?(this.start.column=row.column,this.start.row=row.row):(this.start.row=row,this.start.column=column)},this.setEnd=function(row,column){\"object\"==typeof row?(this.end.column=row.column,this.end.row=row.row):(this.end.row=row,this.end.column=column)},this.inside=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)||this.isStart(row,column)?!1:!0:!1},this.insideStart=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)?!1:!0:!1},this.insideEnd=function(row,column){return 0==this.compare(row,column)?this.isStart(row,column)?!1:!0:!1},this.compare=function(row,column){return this.isMultiLine()||row!==this.start.row?this.start.row>row?-1:row>this.end.row?1:this.start.row===row?column>=this.start.column?0:-1:this.end.row===row?this.end.column>=column?0:1:0:this.start.column>column?-1:column>this.end.column?1:0},this.compareStart=function(row,column){return this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.compareEnd=function(row,column){return this.end.row==row&&this.end.column==column?1:this.compare(row,column)},this.compareInside=function(row,column){return this.end.row==row&&this.end.column==column?1:this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.clipRows=function(firstRow,lastRow){if(this.end.row>lastRow)var end={row:lastRow+1,column:0};else if(firstRow>this.end.row)var end={row:firstRow,column:0};if(this.start.row>lastRow)var start={row:lastRow+1,column:0};else if(firstRow>this.start.row)var start={row:firstRow,column:0};return Range.fromPoints(start||this.start,end||this.end)},this.extend=function(row,column){var cmp=this.compare(row,column);if(0==cmp)return this;if(-1==cmp)var start={row:row,column:column};else var end={row:row,column:column};return Range.fromPoints(start||this.start,end||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return Range.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new Range(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new Range(this.start.row,0,this.end.row,0)},this.toScreenRange=function(session){var screenPosStart=session.documentToScreenPosition(this.start),screenPosEnd=session.documentToScreenPosition(this.end);return new Range(screenPosStart.row,screenPosStart.column,screenPosEnd.row,screenPosEnd.column)},this.moveBy=function(row,column){this.start.row+=row,this.start.column+=column,this.end.row+=row,this.end.column+=column}}).call(Range.prototype),Range.fromPoints=function(start,end){return new Range(start.row,start.column,end.row,end.column)},Range.comparePoints=comparePoints,Range.comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},exports.Range=Range}),ace.define(\"ace/apply_delta\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";exports.applyDelta=function(docLines,delta){var row=delta.start.row,startColumn=delta.start.column,line=docLines[row]||\"\";switch(delta.action){case\"insert\":var lines=delta.lines;if(1===lines.length)docLines[row]=line.substring(0,startColumn)+delta.lines[0]+line.substring(startColumn);else{var args=[row,1].concat(delta.lines);docLines.splice.apply(docLines,args),docLines[row]=line.substring(0,startColumn)+docLines[row],docLines[row+delta.lines.length-1]+=line.substring(startColumn)}break;case\"remove\":var endColumn=delta.end.column,endRow=delta.end.row;row===endRow?docLines[row]=line.substring(0,startColumn)+line.substring(endColumn):docLines.splice(row,endRow-row+1,line.substring(0,startColumn)+docLines[endRow].substring(endColumn))}}}),ace.define(\"ace/lib/event_emitter\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";var EventEmitter={},stopPropagation=function(){this.propagationStopped=!0},preventDefault=function(){this.defaultPrevented=!0};EventEmitter._emit=EventEmitter._dispatchEvent=function(eventName,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var listeners=this._eventRegistry[eventName]||[],defaultHandler=this._defaultHandlers[eventName];if(listeners.length||defaultHandler){\"object\"==typeof e&&e||(e={}),e.type||(e.type=eventName),e.stopPropagation||(e.stopPropagation=stopPropagation),e.preventDefault||(e.preventDefault=preventDefault),listeners=listeners.slice();for(var i=0;listeners.length>i&&(listeners[i](e,this),!e.propagationStopped);i++);return defaultHandler&&!e.defaultPrevented?defaultHandler(e,this):void 0}},EventEmitter._signal=function(eventName,e){var listeners=(this._eventRegistry||{})[eventName];if(listeners){listeners=listeners.slice();for(var i=0;listeners.length>i;i++)listeners[i](e,this)}},EventEmitter.once=function(eventName,callback){var _self=this;callback&&this.addEventListener(eventName,function newCallback(){_self.removeEventListener(eventName,newCallback),callback.apply(null,arguments)})},EventEmitter.setDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers||(handlers=this._defaultHandlers={_disabled_:{}}),handlers[eventName]){var old=handlers[eventName],disabled=handlers._disabled_[eventName];disabled||(handlers._disabled_[eventName]=disabled=[]),disabled.push(old);var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}handlers[eventName]=callback},EventEmitter.removeDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers){var disabled=handlers._disabled_[eventName];if(handlers[eventName]==callback)handlers[eventName],disabled&&this.setDefaultHandler(eventName,disabled.pop());else if(disabled){var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}}},EventEmitter.on=EventEmitter.addEventListener=function(eventName,callback,capturing){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];return listeners||(listeners=this._eventRegistry[eventName]=[]),-1==listeners.indexOf(callback)&&listeners[capturing?\"unshift\":\"push\"](callback),callback},EventEmitter.off=EventEmitter.removeListener=EventEmitter.removeEventListener=function(eventName,callback){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];if(listeners){var index=listeners.indexOf(callback);-1!==index&&listeners.splice(index,1)}},EventEmitter.removeAllListeners=function(eventName){this._eventRegistry&&(this._eventRegistry[eventName]=[])},exports.EventEmitter=EventEmitter}),ace.define(\"ace/anchor\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"],function(acequire,exports){\"use strict\";var oop=acequire(\"./lib/oop\"),EventEmitter=acequire(\"./lib/event_emitter\").EventEmitter,Anchor=exports.Anchor=function(doc,row,column){this.$onChange=this.onChange.bind(this),this.attach(doc),column===void 0?this.setPosition(row.row,row.column):this.setPosition(row,column)};(function(){function $pointsInOrder(point1,point2,equalPointsInOrder){var bColIsAfter=equalPointsInOrder?point1.column<=point2.column:point1.columnthis.row)){var point=$getTransformedPoint(delta,{row:this.row,column:this.column},this.$insertRight);this.setPosition(point.row,point.column,!0)}},this.setPosition=function(row,column,noClip){var pos;if(pos=noClip?{row:row,column:column}:this.$clipPositionToDocument(row,column),this.row!=pos.row||this.column!=pos.column){var old={row:this.row,column:this.column};this.row=pos.row,this.column=pos.column,this._signal(\"change\",{old:old,value:pos})}},this.detach=function(){this.document.removeEventListener(\"change\",this.$onChange)},this.attach=function(doc){this.document=doc||this.document,this.document.on(\"change\",this.$onChange)},this.$clipPositionToDocument=function(row,column){var pos={};return row>=this.document.getLength()?(pos.row=Math.max(0,this.document.getLength()-1),pos.column=this.document.getLine(pos.row).length):0>row?(pos.row=0,pos.column=0):(pos.row=row,pos.column=Math.min(this.document.getLine(pos.row).length,Math.max(0,column))),0>column&&(pos.column=0),pos}}).call(Anchor.prototype)}),ace.define(\"ace/document\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/apply_delta\",\"ace/lib/event_emitter\",\"ace/range\",\"ace/anchor\"],function(acequire,exports){\"use strict\";var oop=acequire(\"./lib/oop\"),applyDelta=acequire(\"./apply_delta\").applyDelta,EventEmitter=acequire(\"./lib/event_emitter\").EventEmitter,Range=acequire(\"./range\").Range,Anchor=acequire(\"./anchor\").Anchor,Document=function(textOrLines){this.$lines=[\"\"],0===textOrLines.length?this.$lines=[\"\"]:Array.isArray(textOrLines)?this.insertMergedLines({row:0,column:0},textOrLines):this.insert({row:0,column:0},textOrLines)};(function(){oop.implement(this,EventEmitter),this.setValue=function(text){var len=this.getLength()-1;this.remove(new Range(0,0,len,this.getLine(len).length)),this.insert({row:0,column:0},text)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(row,column){return new Anchor(this,row,column)},this.$split=0===\"aaa\".split(/a/).length?function(text){return text.replace(/\\r\\n|\\r/g,\"\\n\").split(\"\\n\")}:function(text){return text.split(/\\r\\n|\\r|\\n/)},this.$detectNewLine=function(text){var match=text.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=match?match[1]:\"\\n\",this._signal(\"changeNewLineMode\")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case\"windows\":return\"\\r\\n\";case\"unix\":return\"\\n\";default:return this.$autoNewLine||\"\\n\"}},this.$autoNewLine=\"\",this.$newLineMode=\"auto\",this.setNewLineMode=function(newLineMode){this.$newLineMode!==newLineMode&&(this.$newLineMode=newLineMode,this._signal(\"changeNewLineMode\"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(text){return\"\\r\\n\"==text||\"\\r\"==text||\"\\n\"==text},this.getLine=function(row){return this.$lines[row]||\"\"},this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(range){return this.getLinesForRange(range).join(this.getNewLineCharacter())},this.getLinesForRange=function(range){var lines;if(range.start.row===range.end.row)lines=[this.getLine(range.start.row).substring(range.start.column,range.end.column)];else{lines=this.getLines(range.start.row,range.end.row),lines[0]=(lines[0]||\"\").substring(range.start.column);var l=lines.length-1;range.end.row-range.start.row==l&&(lines[l]=lines[l].substring(0,range.end.column))}return lines},this.insertLines=function(row,lines){return console.warn(\"Use of document.insertLines is deprecated. Use the insertFullLines method instead.\"),this.insertFullLines(row,lines)},this.removeLines=function(firstRow,lastRow){return console.warn(\"Use of document.removeLines is deprecated. Use the removeFullLines method instead.\"),this.removeFullLines(firstRow,lastRow)},this.insertNewLine=function(position){return console.warn(\"Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.\"),this.insertMergedLines(position,[\"\",\"\"])},this.insert=function(position,text){return 1>=this.getLength()&&this.$detectNewLine(text),this.insertMergedLines(position,this.$split(text))},this.insertInLine=function(position,text){var start=this.clippedPos(position.row,position.column),end=this.pos(position.row,position.column+text.length);return this.applyDelta({start:start,end:end,action:\"insert\",lines:[text]},!0),this.clonePos(end)},this.clippedPos=function(row,column){var length=this.getLength();void 0===row?row=length:0>row?row=0:row>=length&&(row=length-1,column=void 0);var line=this.getLine(row);return void 0==column&&(column=line.length),column=Math.min(Math.max(column,0),line.length),{row:row,column:column}},this.clonePos=function(pos){return{row:pos.row,column:pos.column}},this.pos=function(row,column){return{row:row,column:column}},this.$clipPosition=function(position){var length=this.getLength();return position.row>=length?(position.row=Math.max(0,length-1),position.column=this.getLine(length-1).length):(position.row=Math.max(0,position.row),position.column=Math.min(Math.max(position.column,0),this.getLine(position.row).length)),position},this.insertFullLines=function(row,lines){row=Math.min(Math.max(row,0),this.getLength());var column=0;this.getLength()>row?(lines=lines.concat([\"\"]),column=0):(lines=[\"\"].concat(lines),row--,column=this.$lines[row].length),this.insertMergedLines({row:row,column:column},lines)},this.insertMergedLines=function(position,lines){var start=this.clippedPos(position.row,position.column),end={row:start.row+lines.length-1,column:(1==lines.length?start.column:0)+lines[lines.length-1].length};return this.applyDelta({start:start,end:end,action:\"insert\",lines:lines}),this.clonePos(end)},this.remove=function(range){var start=this.clippedPos(range.start.row,range.start.column),end=this.clippedPos(range.end.row,range.end.column);return this.applyDelta({start:start,end:end,action:\"remove\",lines:this.getLinesForRange({start:start,end:end})}),this.clonePos(start)},this.removeInLine=function(row,startColumn,endColumn){var start=this.clippedPos(row,startColumn),end=this.clippedPos(row,endColumn);return this.applyDelta({start:start,end:end,action:\"remove\",lines:this.getLinesForRange({start:start,end:end})},!0),this.clonePos(start)},this.removeFullLines=function(firstRow,lastRow){firstRow=Math.min(Math.max(0,firstRow),this.getLength()-1),lastRow=Math.min(Math.max(0,lastRow),this.getLength()-1);var deleteFirstNewLine=lastRow==this.getLength()-1&&firstRow>0,deleteLastNewLine=this.getLength()-1>lastRow,startRow=deleteFirstNewLine?firstRow-1:firstRow,startCol=deleteFirstNewLine?this.getLine(startRow).length:0,endRow=deleteLastNewLine?lastRow+1:lastRow,endCol=deleteLastNewLine?0:this.getLine(endRow).length,range=new Range(startRow,startCol,endRow,endCol),deletedLines=this.$lines.slice(firstRow,lastRow+1);return this.applyDelta({start:range.start,end:range.end,action:\"remove\",lines:this.getLinesForRange(range)}),deletedLines},this.removeNewLine=function(row){this.getLength()-1>row&&row>=0&&this.applyDelta({start:this.pos(row,this.getLine(row).length),end:this.pos(row+1,0),action:\"remove\",lines:[\"\",\"\"]})},this.replace=function(range,text){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),0===text.length&&range.isEmpty())return range.start;if(text==this.getTextRange(range))return range.end;this.remove(range);var end;return end=text?this.insert(range.start,text):range.start},this.applyDeltas=function(deltas){for(var i=0;deltas.length>i;i++)this.applyDelta(deltas[i])},this.revertDeltas=function(deltas){for(var i=deltas.length-1;i>=0;i--)this.revertDelta(deltas[i])},this.applyDelta=function(delta,doNotValidate){var isInsert=\"insert\"==delta.action;(isInsert?1>=delta.lines.length&&!delta.lines[0]:!Range.comparePoints(delta.start,delta.end))||(isInsert&&delta.lines.length>2e4&&this.$splitAndapplyLargeDelta(delta,2e4),applyDelta(this.$lines,delta,doNotValidate),this._signal(\"change\",delta))},this.$splitAndapplyLargeDelta=function(delta,MAX){for(var lines=delta.lines,l=lines.length,row=delta.start.row,column=delta.start.column,from=0,to=0;;){from=to,to+=MAX-1;var chunk=lines.slice(from,to);if(to>l){delta.lines=chunk,delta.start.row=row+from,delta.start.column=column;break}chunk.push(\"\"),this.applyDelta({start:this.pos(row+from,column),end:this.pos(row+to,column=0),action:delta.action,lines:chunk},!0)}},this.revertDelta=function(delta){this.applyDelta({start:this.clonePos(delta.start),end:this.clonePos(delta.end),action:\"insert\"==delta.action?\"remove\":\"insert\",lines:delta.lines.slice()})},this.indexToPosition=function(index,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,i=startRow||0,l=lines.length;l>i;i++)if(index-=lines[i].length+newlineLength,0>index)return{row:i,column:index+lines[i].length+newlineLength};return{row:l-1,column:lines[l-1].length}},this.positionToIndex=function(pos,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,index=0,row=Math.min(pos.row,lines.length),i=startRow||0;row>i;++i)index+=lines[i].length+newlineLength;return index+pos.column}}).call(Document.prototype),exports.Document=Document}),ace.define(\"ace/lib/lang\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";exports.last=function(a){return a[a.length-1]},exports.stringReverse=function(string){return string.split(\"\").reverse().join(\"\")},exports.stringRepeat=function(string,count){for(var result=\"\";count>0;)1&count&&(result+=string),(count>>=1)&&(string+=string);return result};var trimBeginRegexp=/^\\s\\s*/,trimEndRegexp=/\\s\\s*$/;exports.stringTrimLeft=function(string){return string.replace(trimBeginRegexp,\"\")},exports.stringTrimRight=function(string){return string.replace(trimEndRegexp,\"\")},exports.copyObject=function(obj){var copy={};for(var key in obj)copy[key]=obj[key];return copy},exports.copyArray=function(array){for(var copy=[],i=0,l=array.length;l>i;i++)copy[i]=array[i]&&\"object\"==typeof array[i]?this.copyObject(array[i]):array[i];return copy},exports.deepCopy=function deepCopy(obj){if(\"object\"!=typeof obj||!obj)return obj;var copy;if(Array.isArray(obj)){copy=[];for(var key=0;obj.length>key;key++)copy[key]=deepCopy(obj[key]);return copy}if(\"[object Object]\"!==Object.prototype.toString.call(obj))return obj;copy={};for(var key in obj)copy[key]=deepCopy(obj[key]);return copy},exports.arrayToMap=function(arr){for(var map={},i=0;arr.length>i;i++)map[arr[i]]=1;return map},exports.createMap=function(props){var map=Object.create(null);for(var i in props)map[i]=props[i];return map},exports.arrayRemove=function(array,value){for(var i=0;array.length>=i;i++)value===array[i]&&array.splice(i,1)},exports.escapeRegExp=function(str){return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g,\"\\\\$1\")},exports.escapeHTML=function(str){return str.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/'/g,\"'\").replace(/i;i+=2){if(Array.isArray(data[i+1]))var d={action:\"insert\",start:data[i],lines:data[i+1]};else var d={action:\"remove\",start:data[i],end:data[i+1]};doc.applyDelta(d,!0)}return _self.$timeout?deferredUpdate.schedule(_self.$timeout):(_self.onUpdate(),void 0)})};(function(){this.$timeout=500,this.setTimeout=function(timeout){this.$timeout=timeout},this.setValue=function(value){this.doc.setValue(value),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(callbackId){this.sender.callback(this.doc.getValue(),callbackId)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(Mirror.prototype)}),ace.define(\"ace/mode/javascript/jshint\",[\"require\",\"exports\",\"module\"],function(acequire,exports,module){module.exports=function outer(modules,cache,entry){function newRequire(name,jumped){if(!cache[name]){if(!modules[name]){var currentRequire=\"function\"==typeof acequire&&acequire;if(!jumped&¤tRequire)return currentRequire(name,!0);if(previousRequire)return previousRequire(name,!0);var err=Error(\"Cannot find module '\"+name+\"'\");throw err.code=\"MODULE_NOT_FOUND\",err}var m=cache[name]={exports:{}};modules[name][0].call(m.exports,function(x){var id=modules[name][1][x];return newRequire(id?id:x)},m,m.exports,outer,modules,cache,entry)}return cache[name].exports}for(var previousRequire=\"function\"==typeof acequire&&acequire,i=0;entry.length>i;i++)newRequire(entry[i]);return newRequire(entry[0])}({\"/node_modules/browserify/node_modules/events/events.js\":[function(_dereq_,module){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return\"function\"==typeof arg}function isNumber(arg){return\"number\"==typeof arg}function isObject(arg){return\"object\"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||0>n||isNaN(n))throw TypeError(\"n must be a positive number\");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),\"error\"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(er=arguments[1],er instanceof Error)throw er;throw TypeError('Uncaught, unspecified \"error\" event.')}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:for(len=arguments.length,args=Array(len-1),i=1;len>i;i++)args[i-1]=arguments[i];handler.apply(this,args)}else if(isObject(handler)){for(len=arguments.length,args=Array(len-1),i=1;len>i;i++)args[i-1]=arguments[i];for(listeners=handler.slice(),len=listeners.length,i=0;len>i;i++)listeners[i].apply(this,args)}return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError(\"listener must be a function\");if(this._events||(this._events={}),this._events.newListener&&this.emit(\"newListener\",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned){var m;m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,m&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error(\"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.\",this._events[type].length),\"function\"==typeof console.trace&&console.trace())}return this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError(\"listener must be a function\");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit(\"removeListener\",type,listener);else if(isObject(list)){for(i=length;i-->0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(0>position)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit(\"removeListener\",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)\"removeListener\"!==key&&this.removeAllListeners(key);return this.removeAllListeners(\"removeListener\"),this._events={},this\n}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.listenerCount=function(emitter,type){var ret;return ret=emitter._events&&emitter._events[type]?isFunction(emitter._events[type])?1:emitter._events[type].length:0}},{}],\"/node_modules/jshint/data/ascii-identifier-data.js\":[function(_dereq_,module){for(var identifierStartTable=[],i=0;128>i;i++)identifierStartTable[i]=36===i||i>=65&&90>=i||95===i||i>=97&&122>=i;for(var identifierPartTable=[],i=0;128>i;i++)identifierPartTable[i]=identifierStartTable[i]||i>=48&&57>=i;module.exports={asciiIdentifierStartTable:identifierStartTable,asciiIdentifierPartTable:identifierPartTable}},{}],\"/node_modules/jshint/lodash.js\":[function(_dereq_,module,exports){(function(global){(function(){function baseFindIndex(array,predicate,fromRight){for(var length=array.length,index=fromRight?length:-1;fromRight?index--:length>++index;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){if(value!==value)return indexOfNaN(array,fromIndex);for(var index=fromIndex-1,length=array.length;length>++index;)if(array[index]===value)return index;return-1}function baseIsFunction(value){return\"function\"==typeof value||!1}function baseToString(value){return\"string\"==typeof value?value:null==value?\"\":value+\"\"}function indexOfNaN(array,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?0:-1);fromRight?index--:length>++index;){var other=array[index];if(other!==other)return index}return-1}function isObjectLike(value){return!!value&&\"object\"==typeof value}function lodash(){}function arrayCopy(source,array){var index=-1,length=source.length;for(array||(array=Array(length));length>++index;)array[index]=source[index];return array}function arrayEach(array,iteratee){for(var index=-1,length=array.length;length>++index&&iteratee(array[index],index,array)!==!1;);return array}function arrayFilter(array,predicate){for(var index=-1,length=array.length,resIndex=-1,result=[];length>++index;){var value=array[index];predicate(value,index,array)&&(result[++resIndex]=value)}return result}function arrayMap(array,iteratee){for(var index=-1,length=array.length,result=Array(length);length>++index;)result[index]=iteratee(array[index],index,array);return result}function arrayMax(array){for(var index=-1,length=array.length,result=NEGATIVE_INFINITY;length>++index;){var value=array[index];value>result&&(result=value)}return result}function arraySome(array,predicate){for(var index=-1,length=array.length;length>++index;)if(predicate(array[index],index,array))return!0;return!1}function assignWith(object,source,customizer){var props=keys(source);push.apply(props,getSymbols(source));for(var index=-1,length=props.length;length>++index;){var key=props[index],value=object[key],result=customizer(value,source[key],key,object,source);(result===result?result===value:value!==value)&&(value!==undefined||key in object)||(object[key]=result)}return object}function baseCopy(source,props,object){object||(object={});for(var index=-1,length=props.length;length>++index;){var key=props[index];object[key]=source[key]}return object}function baseCallback(func,thisArg,argCount){var type=typeof func;return\"function\"==type?thisArg===undefined?func:bindCallback(func,thisArg,argCount):null==func?identity:\"object\"==type?baseMatches(func):thisArg===undefined?property(func):baseMatchesProperty(func,thisArg)}function baseClone(value,isDeep,customizer,key,object,stackA,stackB){var result;if(customizer&&(result=object?customizer(value,key,object):customizer(value)),result!==undefined)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=initCloneArray(value),!isDeep)return arrayCopy(value,result)}else{var tag=objToString.call(value),isFunc=tag==funcTag;if(tag!=objectTag&&tag!=argsTag&&(!isFunc||object))return cloneableTags[tag]?initCloneByTag(value,tag,isDeep):object?value:{};if(result=initCloneObject(isFunc?{}:value),!isDeep)return baseAssign(result,value)}stackA||(stackA=[]),stackB||(stackB=[]);for(var length=stackA.length;length--;)if(stackA[length]==value)return stackB[length];return stackA.push(value),stackB.push(result),(isArr?arrayEach:baseForOwn)(value,function(subValue,key){result[key]=baseClone(subValue,isDeep,customizer,key,value,stackA,stackB)}),result}function baseFilter(collection,predicate){var result=[];return baseEach(collection,function(value,index,collection){predicate(value,index,collection)&&result.push(value)}),result}function baseForIn(object,iteratee){return baseFor(object,iteratee,keysIn)}function baseForOwn(object,iteratee){return baseFor(object,iteratee,keys)}function baseGet(object,path,pathKey){if(null!=object){pathKey!==undefined&&pathKey in toObject(object)&&(path=[pathKey]);for(var index=-1,length=path.length;null!=object&&length>++index;)var result=object=object[path[index]];return result}}function baseIsEqual(value,other,customizer,isLoose,stackA,stackB){if(value===other)return 0!==value||1/value==1/other;var valType=typeof value,othType=typeof other;return\"function\"!=valType&&\"object\"!=valType&&\"function\"!=othType&&\"object\"!=othType||null==value||null==other?value!==value&&other!==other:baseIsEqualDeep(value,other,baseIsEqual,customizer,isLoose,stackA,stackB)}function baseIsEqualDeep(object,other,equalFunc,customizer,isLoose,stackA,stackB){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=arrayTag,othTag=arrayTag;objIsArr||(objTag=objToString.call(object),objTag==argsTag?objTag=objectTag:objTag!=objectTag&&(objIsArr=isTypedArray(object))),othIsArr||(othTag=objToString.call(other),othTag==argsTag?othTag=objectTag:othTag!=objectTag&&(othIsArr=isTypedArray(other)));var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&!objIsArr&&!objIsObj)return equalByTag(object,other,objTag);if(!isLoose){var valWrapped=objIsObj&&hasOwnProperty.call(object,\"__wrapped__\"),othWrapped=othIsObj&&hasOwnProperty.call(other,\"__wrapped__\");if(valWrapped||othWrapped)return equalFunc(valWrapped?object.value():object,othWrapped?other.value():other,customizer,isLoose,stackA,stackB)}if(!isSameTag)return!1;stackA||(stackA=[]),stackB||(stackB=[]);for(var length=stackA.length;length--;)if(stackA[length]==object)return stackB[length]==other;stackA.push(object),stackB.push(other);var result=(objIsArr?equalArrays:equalObjects)(object,other,equalFunc,customizer,isLoose,stackA,stackB);return stackA.pop(),stackB.pop(),result}function baseIsMatch(object,props,values,strictCompareFlags,customizer){for(var index=-1,length=props.length,noCustomizer=!customizer;length>++index;)if(noCustomizer&&strictCompareFlags[index]?values[index]!==object[props[index]]:!(props[index]in object))return!1;for(index=-1;length>++index;){var key=props[index],objValue=object[key],srcValue=values[index];if(noCustomizer&&strictCompareFlags[index])var result=objValue!==undefined||key in object;else result=customizer?customizer(objValue,srcValue,key):undefined,result===undefined&&(result=baseIsEqual(srcValue,objValue,customizer,!0));if(!result)return!1}return!0}function baseMatches(source){var props=keys(source),length=props.length;if(!length)return constant(!0);if(1==length){var key=props[0],value=source[key];if(isStrictComparable(value))return function(object){return null==object?!1:object[key]===value&&(value!==undefined||key in toObject(object))}}for(var values=Array(length),strictCompareFlags=Array(length);length--;)value=source[props[length]],values[length]=value,strictCompareFlags[length]=isStrictComparable(value);return function(object){return null!=object&&baseIsMatch(toObject(object),props,values,strictCompareFlags)}}function baseMatchesProperty(path,value){var isArr=isArray(path),isCommon=isKey(path)&&isStrictComparable(value),pathKey=path+\"\";return path=toPath(path),function(object){if(null==object)return!1;var key=pathKey;if(object=toObject(object),!(!isArr&&isCommon||key in object)){if(object=1==path.length?object:baseGet(object,baseSlice(path,0,-1)),null==object)return!1;key=last(path),object=toObject(object)}return object[key]===value?value!==undefined||key in object:baseIsEqual(value,object[key],null,!0)}}function baseMerge(object,source,customizer,stackA,stackB){if(!isObject(object))return object;var isSrcArr=isLength(source.length)&&(isArray(source)||isTypedArray(source));if(!isSrcArr){var props=keys(source);push.apply(props,getSymbols(source))}return arrayEach(props||source,function(srcValue,key){if(props&&(key=srcValue,srcValue=source[key]),isObjectLike(srcValue))stackA||(stackA=[]),stackB||(stackB=[]),baseMergeDeep(object,source,key,baseMerge,customizer,stackA,stackB);else{var value=object[key],result=customizer?customizer(value,srcValue,key,object,source):undefined,isCommon=result===undefined;isCommon&&(result=srcValue),!isSrcArr&&result===undefined||!isCommon&&(result===result?result===value:value!==value)||(object[key]=result)}}),object}function baseMergeDeep(object,source,key,mergeFunc,customizer,stackA,stackB){for(var length=stackA.length,srcValue=source[key];length--;)if(stackA[length]==srcValue)return object[key]=stackB[length],undefined;var value=object[key],result=customizer?customizer(value,srcValue,key,object,source):undefined,isCommon=result===undefined;isCommon&&(result=srcValue,isLength(srcValue.length)&&(isArray(srcValue)||isTypedArray(srcValue))?result=isArray(value)?value:getLength(value)?arrayCopy(value):[]:isPlainObject(srcValue)||isArguments(srcValue)?result=isArguments(value)?toPlainObject(value):isPlainObject(value)?value:{}:isCommon=!1),stackA.push(srcValue),stackB.push(result),isCommon?object[key]=mergeFunc(result,srcValue,customizer,stackA,stackB):(result===result?result!==value:value===value)&&(object[key]=result)}function baseProperty(key){return function(object){return null==object?undefined:object[key]}}function basePropertyDeep(path){var pathKey=path+\"\";return path=toPath(path),function(object){return baseGet(object,path,pathKey)}}function baseSlice(array,start,end){var index=-1,length=array.length;start=null==start?0:+start||0,0>start&&(start=-start>length?0:length+start),end=end===undefined||end>length?length:+end||0,0>end&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);length>++index;)result[index]=array[index+start];return result}function baseSome(collection,predicate){var result;return baseEach(collection,function(value,index,collection){return result=predicate(value,index,collection),!result}),!!result}function baseValues(object,props){for(var index=-1,length=props.length,result=Array(length);length>++index;)result[index]=object[props[index]];return result}function binaryIndex(array,value,retHighest){var low=0,high=array?array.length:low;if(\"number\"==typeof value&&value===value&&HALF_MAX_ARRAY_LENGTH>=high){for(;high>low;){var mid=low+high>>>1,computed=array[mid];(retHighest?value>=computed:value>computed)?low=mid+1:high=mid}return high}return binaryIndexBy(array,value,identity,retHighest)}function binaryIndexBy(array,value,iteratee,retHighest){value=iteratee(value);for(var low=0,high=array?array.length:0,valIsNaN=value!==value,valIsUndef=value===undefined;high>low;){var mid=floor((low+high)/2),computed=iteratee(array[mid]),isReflexive=computed===computed;if(valIsNaN)var setLow=isReflexive||retHighest;else setLow=valIsUndef?isReflexive&&(retHighest||computed!==undefined):retHighest?value>=computed:value>computed;setLow?low=mid+1:high=mid}return nativeMin(high,MAX_ARRAY_INDEX)}function bindCallback(func,thisArg,argCount){if(\"function\"!=typeof func)return identity;if(thisArg===undefined)return func;switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)};case 5:return function(value,other,key,object,source){return func.call(thisArg,value,other,key,object,source)}}return function(){return func.apply(thisArg,arguments)}}function bufferClone(buffer){return bufferSlice.call(buffer,0)}function createAssigner(assigner){return restParam(function(object,sources){var index=-1,length=null==object?0:sources.length,customizer=length>2&&sources[length-2],guard=length>2&&sources[2],thisArg=length>1&&sources[length-1];for(\"function\"==typeof customizer?(customizer=bindCallback(customizer,thisArg,5),length-=2):(customizer=\"function\"==typeof thisArg?thisArg:null,length-=customizer?1:0),guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=3>length?null:customizer,length=1);length>++index;){var source=sources[index];source&&assigner(object,source,customizer)}return object})}function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){var length=collection?getLength(collection):0;if(!isLength(length))return eachFunc(collection,iteratee);for(var index=fromRight?length:-1,iterable=toObject(collection);(fromRight?index--:length>++index)&&iteratee(iterable[index],index,iterable)!==!1;);return collection}}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){for(var iterable=toObject(object),props=keysFunc(object),length=props.length,index=fromRight?length:-1;fromRight?index--:length>++index;){var key=props[index];if(iteratee(iterable[key],key,iterable)===!1)break}return object}}function createFindIndex(fromRight){return function(array,predicate,thisArg){return array&&array.length?(predicate=getCallback(predicate,thisArg,3),baseFindIndex(array,predicate,fromRight)):-1}}function createForEach(arrayFunc,eachFunc){return function(collection,iteratee,thisArg){return\"function\"==typeof iteratee&&thisArg===undefined&&isArray(collection)?arrayFunc(collection,iteratee):eachFunc(collection,bindCallback(iteratee,thisArg,3))}}function equalArrays(array,other,equalFunc,customizer,isLoose,stackA,stackB){var index=-1,arrLength=array.length,othLength=other.length,result=!0;if(arrLength!=othLength&&!(isLoose&&othLength>arrLength))return!1;for(;result&&arrLength>++index;){var arrValue=array[index],othValue=other[index];if(result=undefined,customizer&&(result=isLoose?customizer(othValue,arrValue,index):customizer(arrValue,othValue,index)),result===undefined)if(isLoose)for(var othIndex=othLength;othIndex--&&(othValue=other[othIndex],!(result=arrValue&&arrValue===othValue||equalFunc(arrValue,othValue,customizer,isLoose,stackA,stackB))););else result=arrValue&&arrValue===othValue||equalFunc(arrValue,othValue,customizer,isLoose,stackA,stackB)}return!!result}function equalByTag(object,other,tag){switch(tag){case boolTag:case dateTag:return+object==+other;case errorTag:return object.name==other.name&&object.message==other.message;case numberTag:return object!=+object?other!=+other:0==object?1/object==1/other:object==+other;case regexpTag:case stringTag:return object==other+\"\"}return!1}function equalObjects(object,other,equalFunc,customizer,isLoose,stackA,stackB){var objProps=keys(object),objLength=objProps.length,othProps=keys(other),othLength=othProps.length;if(objLength!=othLength&&!isLoose)return!1;for(var skipCtor=isLoose,index=-1;objLength>++index;){var key=objProps[index],result=isLoose?key in other:hasOwnProperty.call(other,key);if(result){var objValue=object[key],othValue=other[key];result=undefined,customizer&&(result=isLoose?customizer(othValue,objValue,key):customizer(objValue,othValue,key)),result===undefined&&(result=objValue&&objValue===othValue||equalFunc(objValue,othValue,customizer,isLoose,stackA,stackB))}if(!result)return!1;skipCtor||(skipCtor=\"constructor\"==key)}if(!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;if(objCtor!=othCtor&&\"constructor\"in object&&\"constructor\"in other&&!(\"function\"==typeof objCtor&&objCtor instanceof objCtor&&\"function\"==typeof othCtor&&othCtor instanceof othCtor))return!1}return!0}function getCallback(func,thisArg,argCount){var result=lodash.callback||callback;return result=result===callback?baseCallback:result,argCount?result(func,thisArg,argCount):result}function getIndexOf(collection,target,fromIndex){var result=lodash.indexOf||indexOf;return result=result===indexOf?baseIndexOf:result,collection?result(collection,target,fromIndex):result}function initCloneArray(array){var length=array.length,result=new array.constructor(length);return length&&\"string\"==typeof array[0]&&hasOwnProperty.call(array,\"index\")&&(result.index=array.index,result.input=array.input),result}function initCloneObject(object){var Ctor=object.constructor;return\"function\"==typeof Ctor&&Ctor instanceof Ctor||(Ctor=Object),new Ctor}function initCloneByTag(object,tag,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return bufferClone(object);case boolTag:case dateTag:return new Ctor(+object);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:var buffer=object.buffer;return new Ctor(isDeep?bufferClone(buffer):buffer,object.byteOffset,object.length);case numberTag:case stringTag:return new Ctor(object);case regexpTag:var result=new Ctor(object.source,reFlags.exec(object));result.lastIndex=object.lastIndex}return result}function isIndex(value,length){return value=+value,length=null==length?MAX_SAFE_INTEGER:length,value>-1&&0==value%1&&length>value}function isIterateeCall(value,index,object){if(!isObject(object))return!1;var type=typeof index;if(\"number\"==type)var length=getLength(object),prereq=isLength(length)&&isIndex(index,length);else prereq=\"string\"==type&&index in object;if(prereq){var other=object[index];return value===value?value===other:other!==other}return!1}function isKey(value,object){var type=typeof value;if(\"string\"==type&&reIsPlainProp.test(value)||\"number\"==type)return!0;if(isArray(value))return!1;var result=!reIsDeepProp.test(value);return result||null!=object&&value in toObject(object)}function isLength(value){return\"number\"==typeof value&&value>-1&&0==value%1&&MAX_SAFE_INTEGER>=value}function isStrictComparable(value){return value===value&&(0===value?1/value>0:!isObject(value))}function shimIsPlainObject(value){var Ctor;if(lodash.support,!isObjectLike(value)||objToString.call(value)!=objectTag||!hasOwnProperty.call(value,\"constructor\")&&(Ctor=value.constructor,\"function\"==typeof Ctor&&!(Ctor instanceof Ctor)))return!1;var result;return baseForIn(value,function(subValue,key){result=key}),result===undefined||hasOwnProperty.call(value,result)}function shimKeys(object){for(var props=keysIn(object),propsLength=props.length,length=propsLength&&object.length,support=lodash.support,allowIndexes=length&&isLength(length)&&(isArray(object)||support.nonEnumArgs&&isArguments(object)),index=-1,result=[];propsLength>++index;){var key=props[index];(allowIndexes&&isIndex(key,length)||hasOwnProperty.call(object,key))&&result.push(key)}return result}function toObject(value){return isObject(value)?value:Object(value)}function toPath(value){if(isArray(value))return value;var result=[];return baseToString(value).replace(rePropName,function(match,number,quote,string){result.push(quote?string.replace(reEscapeChar,\"$1\"):number||match)}),result}function indexOf(array,value,fromIndex){var length=array?array.length:0;if(!length)return-1;if(\"number\"==typeof fromIndex)fromIndex=0>fromIndex?nativeMax(length+fromIndex,0):fromIndex;else if(fromIndex){var index=binaryIndex(array,value),other=array[index];return(value===value?value===other:other!==other)?index:-1}return baseIndexOf(array,value,fromIndex||0)}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function slice(array,start,end){var length=array?array.length:0;return length?(end&&\"number\"!=typeof end&&isIterateeCall(array,start,end)&&(start=0,end=length),baseSlice(array,start,end)):[]}function unzip(array){for(var index=-1,length=(array&&array.length&&arrayMax(arrayMap(array,getLength)))>>>0,result=Array(length);length>++index;)result[index]=arrayMap(array,baseProperty(index));return result}function includes(collection,target,fromIndex,guard){var length=collection?getLength(collection):0;return isLength(length)||(collection=values(collection),length=collection.length),length?(fromIndex=\"number\"!=typeof fromIndex||guard&&isIterateeCall(target,fromIndex,guard)?0:0>fromIndex?nativeMax(length+fromIndex,0):fromIndex||0,\"string\"==typeof collection||!isArray(collection)&&isString(collection)?length>fromIndex&&collection.indexOf(target,fromIndex)>-1:getIndexOf(collection,target,fromIndex)>-1):!1}function reject(collection,predicate,thisArg){var func=isArray(collection)?arrayFilter:baseFilter;return predicate=getCallback(predicate,thisArg,3),func(collection,function(value,index,collection){return!predicate(value,index,collection)})}function some(collection,predicate,thisArg){var func=isArray(collection)?arraySome:baseSome;return thisArg&&isIterateeCall(collection,predicate,thisArg)&&(predicate=null),(\"function\"!=typeof predicate||thisArg!==undefined)&&(predicate=getCallback(predicate,thisArg,3)),func(collection,predicate)}function restParam(func,start){if(\"function\"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=nativeMax(start===undefined?func.length-1:+start||0,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),rest=Array(length);length>++index;)rest[index]=args[start+index];switch(start){case 0:return func.call(this,rest);case 1:return func.call(this,args[0],rest);case 2:return func.call(this,args[0],args[1],rest)}var otherArgs=Array(start+1);for(index=-1;start>++index;)otherArgs[index]=args[index];return otherArgs[start]=rest,func.apply(this,otherArgs)}}function clone(value,isDeep,customizer,thisArg){return isDeep&&\"boolean\"!=typeof isDeep&&isIterateeCall(value,isDeep,customizer)?isDeep=!1:\"function\"==typeof isDeep&&(thisArg=customizer,customizer=isDeep,isDeep=!1),customizer=\"function\"==typeof customizer&&bindCallback(customizer,thisArg,1),baseClone(value,isDeep,customizer)}function isArguments(value){var length=isObjectLike(value)?value.length:undefined;return isLength(length)&&objToString.call(value)==argsTag}function isEmpty(value){if(null==value)return!0;var length=getLength(value);return isLength(length)&&(isArray(value)||isString(value)||isArguments(value)||isObjectLike(value)&&isFunction(value.splice))?!length:!keys(value).length}function isObject(value){var type=typeof value;return\"function\"==type||!!value&&\"object\"==type}function isNative(value){return null==value?!1:objToString.call(value)==funcTag?reIsNative.test(fnToString.call(value)):isObjectLike(value)&&reIsHostCtor.test(value)}function isNumber(value){return\"number\"==typeof value||isObjectLike(value)&&objToString.call(value)==numberTag}function isString(value){return\"string\"==typeof value||isObjectLike(value)&&objToString.call(value)==stringTag}function isTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[objToString.call(value)]}function toPlainObject(value){return baseCopy(value,keysIn(value))}function has(object,path){if(null==object)return!1;var result=hasOwnProperty.call(object,path);return result||isKey(path)||(path=toPath(path),object=1==path.length?object:baseGet(object,baseSlice(path,0,-1)),path=last(path),result=null!=object&&hasOwnProperty.call(object,path)),result}function keysIn(object){if(null==object)return[];isObject(object)||(object=Object(object));var length=object.length;length=length&&isLength(length)&&(isArray(object)||support.nonEnumArgs&&isArguments(object))&&length||0;for(var Ctor=object.constructor,index=-1,isProto=\"function\"==typeof Ctor&&Ctor.prototype===object,result=Array(length),skipIndexes=length>0;length>++index;)result[index]=index+\"\";for(var key in object)skipIndexes&&isIndex(key,length)||\"constructor\"==key&&(isProto||!hasOwnProperty.call(object,key))||result.push(key);return result}function values(object){return baseValues(object,keys(object))}function escapeRegExp(string){return string=baseToString(string),string&&reHasRegExpChars.test(string)?string.replace(reRegExpChars,\"\\\\$&\"):string}function callback(func,thisArg,guard){return guard&&isIterateeCall(func,thisArg,guard)&&(thisArg=null),baseCallback(func,thisArg)}function constant(value){return function(){return value}}function identity(value){return value}function property(path){return isKey(path)?baseProperty(path):basePropertyDeep(path)}var undefined,VERSION=\"3.7.0\",FUNC_ERROR_TEXT=\"Expected a function\",argsTag=\"[object Arguments]\",arrayTag=\"[object Array]\",boolTag=\"[object Boolean]\",dateTag=\"[object Date]\",errorTag=\"[object Error]\",funcTag=\"[object Function]\",mapTag=\"[object Map]\",numberTag=\"[object Number]\",objectTag=\"[object Object]\",regexpTag=\"[object RegExp]\",setTag=\"[object Set]\",stringTag=\"[object String]\",weakMapTag=\"[object WeakMap]\",arrayBufferTag=\"[object ArrayBuffer]\",float32Tag=\"[object Float32Array]\",float64Tag=\"[object Float64Array]\",int8Tag=\"[object Int8Array]\",int16Tag=\"[object Int16Array]\",int32Tag=\"[object Int32Array]\",uint8Tag=\"[object Uint8Array]\",uint8ClampedTag=\"[object Uint8ClampedArray]\",uint16Tag=\"[object Uint16Array]\",uint32Tag=\"[object Uint32Array]\",reIsDeepProp=/\\.|\\[(?:[^[\\]]+|([\"'])(?:(?!\\1)[^\\n\\\\]|\\\\.)*?)\\1\\]/,reIsPlainProp=/^\\w*$/,rePropName=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\n\\\\]|\\\\.)*?)\\2)\\]/g,reRegExpChars=/[.*+?^${}()|[\\]\\/\\\\]/g,reHasRegExpChars=RegExp(reRegExpChars.source),reEscapeChar=/\\\\(\\\\)?/g,reFlags=/\\w*$/,reIsHostCtor=/^\\[object .+?Constructor\\]$/,typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[stringTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[mapTag]=cloneableTags[setTag]=cloneableTags[weakMapTag]=!1;var objectTypes={\"function\":!0,object:!0},freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports,freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module,freeGlobal=freeExports&&freeModule&&\"object\"==typeof global&&global&&global.Object&&global,freeSelf=objectTypes[typeof self]&&self&&self.Object&&self,freeWindow=objectTypes[typeof window]&&window&&window.Object&&window,moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports,root=freeGlobal||freeWindow!==(this&&this.window)&&freeWindow||freeSelf||this,arrayProto=Array.prototype,objectProto=Object.prototype,fnToString=Function.prototype.toString,hasOwnProperty=objectProto.hasOwnProperty,objToString=objectProto.toString,reIsNative=RegExp(\"^\"+escapeRegExp(objToString).replace(/toString|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\"),ArrayBuffer=isNative(ArrayBuffer=root.ArrayBuffer)&&ArrayBuffer,bufferSlice=isNative(bufferSlice=ArrayBuffer&&new ArrayBuffer(0).slice)&&bufferSlice,floor=Math.floor,getOwnPropertySymbols=isNative(getOwnPropertySymbols=Object.getOwnPropertySymbols)&&getOwnPropertySymbols,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,push=arrayProto.push,preventExtensions=isNative(Object.preventExtensions=Object.preventExtensions)&&preventExtensions,propertyIsEnumerable=objectProto.propertyIsEnumerable,Uint8Array=isNative(Uint8Array=root.Uint8Array)&&Uint8Array,Float64Array=function(){try{var func=isNative(func=root.Float64Array)&&func,result=new func(new ArrayBuffer(10),0,1)&&func}catch(e){}return result}(),nativeAssign=function(){var object={1:0},func=preventExtensions&&isNative(func=Object.assign)&&func;try{func(preventExtensions(object),\"xo\")}catch(e){}return!object[1]&&func}(),nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,MAX_ARRAY_LENGTH=Math.pow(2,32)-1,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1,FLOAT64_BYTES_PER_ELEMENT=Float64Array?Float64Array.BYTES_PER_ELEMENT:0,MAX_SAFE_INTEGER=Math.pow(2,53)-1,support=lodash.support={};(function(x){var Ctor=function(){this.x=x},props=[];Ctor.prototype={valueOf:x,y:x};for(var key in new Ctor)props.push(key);support.funcDecomp=/\\bthis\\b/.test(function(){return this}),support.funcNames=\"string\"==typeof Function.name;try{support.nonEnumArgs=!propertyIsEnumerable.call(arguments,1)}catch(e){support.nonEnumArgs=!0}})(1,0);var baseAssign=nativeAssign||function(object,source){return null==source?object:baseCopy(source,getSymbols(source),baseCopy(source,keys(source),object))},baseEach=createBaseEach(baseForOwn),baseFor=createBaseFor();bufferSlice||(bufferClone=ArrayBuffer&&Uint8Array?function(buffer){var byteLength=buffer.byteLength,floatLength=Float64Array?floor(byteLength/FLOAT64_BYTES_PER_ELEMENT):0,offset=floatLength*FLOAT64_BYTES_PER_ELEMENT,result=new ArrayBuffer(byteLength);if(floatLength){var view=new Float64Array(result,0,floatLength);view.set(new Float64Array(buffer,0,floatLength))}return byteLength!=offset&&(view=new Uint8Array(result,offset),view.set(new Uint8Array(buffer,offset))),result}:constant(null));var getLength=baseProperty(\"length\"),getSymbols=getOwnPropertySymbols?function(object){return getOwnPropertySymbols(toObject(object))}:constant([]),findLastIndex=createFindIndex(!0),zip=restParam(unzip),forEach=createForEach(arrayEach,baseEach),isArray=nativeIsArray||function(value){return isObjectLike(value)&&isLength(value.length)&&objToString.call(value)==arrayTag},isFunction=baseIsFunction(/x/)||Uint8Array&&!baseIsFunction(Uint8Array)?function(value){return objToString.call(value)==funcTag}:baseIsFunction,isPlainObject=getPrototypeOf?function(value){if(!value||objToString.call(value)!=objectTag)return!1;var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)}:shimIsPlainObject,assign=createAssigner(function(object,source,customizer){return customizer?assignWith(object,source,customizer):baseAssign(object,source)}),keys=nativeKeys?function(object){if(object)var Ctor=object.constructor,length=object.length;return\"function\"==typeof Ctor&&Ctor.prototype===object||\"function\"!=typeof object&&isLength(length)?shimKeys(object):isObject(object)?nativeKeys(object):[]}:shimKeys,merge=createAssigner(baseMerge);lodash.assign=assign,lodash.callback=callback,lodash.constant=constant,lodash.forEach=forEach,lodash.keys=keys,lodash.keysIn=keysIn,lodash.merge=merge,lodash.property=property,lodash.reject=reject,lodash.restParam=restParam,lodash.slice=slice,lodash.toPlainObject=toPlainObject,lodash.unzip=unzip,lodash.values=values,lodash.zip=zip,lodash.each=forEach,lodash.extend=assign,lodash.iteratee=callback,lodash.clone=clone,lodash.escapeRegExp=escapeRegExp,lodash.findLastIndex=findLastIndex,lodash.has=has,lodash.identity=identity,lodash.includes=includes,lodash.indexOf=indexOf,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isEmpty=isEmpty,lodash.isFunction=isFunction,lodash.isNative=isNative,lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isPlainObject=isPlainObject,lodash.isString=isString,lodash.isTypedArray=isTypedArray,lodash.last=last,lodash.some=some,lodash.any=some,lodash.contains=includes,lodash.include=includes,lodash.VERSION=VERSION,freeExports&&freeModule?moduleExports?(freeModule.exports=lodash)._=lodash:freeExports._=lodash:root._=lodash\n}).call(this)}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}],\"/node_modules/jshint/src/jshint.js\":[function(_dereq_,module,exports){var _=_dereq_(\"../lodash\"),events=_dereq_(\"events\"),vars=_dereq_(\"./vars.js\"),messages=_dereq_(\"./messages.js\"),Lexer=_dereq_(\"./lex.js\").Lexer,reg=_dereq_(\"./reg.js\"),state=_dereq_(\"./state.js\").state,style=_dereq_(\"./style.js\"),options=_dereq_(\"./options.js\"),scopeManager=_dereq_(\"./scope-manager.js\"),JSHINT=function(){\"use strict\";function checkOption(name,t){return name=name.trim(),/^[+-]W\\d{3}$/g.test(name)?!0:-1!==options.validNames.indexOf(name)||\"jslint\"===t.type||_.has(options.removed,name)?!0:(error(\"E001\",t,name),!1)}function isString(obj){return\"[object String]\"===Object.prototype.toString.call(obj)}function isIdentifier(tkn,value){return tkn?tkn.identifier&&tkn.value===value?!0:!1:!1}function isReserved(token){if(!token.reserved)return!1;var meta=token.meta;if(meta&&meta.isFutureReservedWord&&state.inES5()){if(!meta.es5)return!1;if(meta.strictOnly&&!state.option.strict&&!state.isStrict())return!1;if(token.isProperty)return!1}return!0}function supplant(str,data){return str.replace(/\\{([^{}]*)\\}/g,function(a,b){var r=data[b];return\"string\"==typeof r||\"number\"==typeof r?r:a})}function combine(dest,src){Object.keys(src).forEach(function(name){_.has(JSHINT.blacklist,name)||(dest[name]=src[name])})}function processenforceall(){if(state.option.enforceall){for(var enforceopt in options.bool.enforcing)void 0!==state.option[enforceopt]||options.noenforceall[enforceopt]||(state.option[enforceopt]=!0);for(var relaxopt in options.bool.relaxing)void 0===state.option[relaxopt]&&(state.option[relaxopt]=!1)}}function assume(){processenforceall(),state.option.esversion||state.option.moz||(state.option.esversion=state.option.es3?3:state.option.esnext?6:5),state.inES5()&&combine(predefined,vars.ecmaIdentifiers[5]),state.inES6()&&combine(predefined,vars.ecmaIdentifiers[6]),state.option.module&&(state.option.strict===!0&&(state.option.strict=\"global\"),state.inES6()||warning(\"W134\",state.tokens.next,\"module\",6)),state.option.couch&&combine(predefined,vars.couch),state.option.qunit&&combine(predefined,vars.qunit),state.option.rhino&&combine(predefined,vars.rhino),state.option.shelljs&&(combine(predefined,vars.shelljs),combine(predefined,vars.node)),state.option.typed&&combine(predefined,vars.typed),state.option.phantom&&(combine(predefined,vars.phantom),state.option.strict===!0&&(state.option.strict=\"global\")),state.option.prototypejs&&combine(predefined,vars.prototypejs),state.option.node&&(combine(predefined,vars.node),combine(predefined,vars.typed),state.option.strict===!0&&(state.option.strict=\"global\")),state.option.devel&&combine(predefined,vars.devel),state.option.dojo&&combine(predefined,vars.dojo),state.option.browser&&(combine(predefined,vars.browser),combine(predefined,vars.typed)),state.option.browserify&&(combine(predefined,vars.browser),combine(predefined,vars.typed),combine(predefined,vars.browserify),state.option.strict===!0&&(state.option.strict=\"global\")),state.option.nonstandard&&combine(predefined,vars.nonstandard),state.option.jasmine&&combine(predefined,vars.jasmine),state.option.jquery&&combine(predefined,vars.jquery),state.option.mootools&&combine(predefined,vars.mootools),state.option.worker&&combine(predefined,vars.worker),state.option.wsh&&combine(predefined,vars.wsh),state.option.globalstrict&&state.option.strict!==!1&&(state.option.strict=\"global\"),state.option.yui&&combine(predefined,vars.yui),state.option.mocha&&combine(predefined,vars.mocha)}function quit(code,line,chr){var percentage=Math.floor(100*(line/state.lines.length)),message=messages.errors[code].desc;throw{name:\"JSHintError\",line:line,character:chr,message:message+\" (\"+percentage+\"% scanned).\",raw:message,code:code}}function removeIgnoredMessages(){var ignored=state.ignoredLines;_.isEmpty(ignored)||(JSHINT.errors=_.reject(JSHINT.errors,function(err){return ignored[err.line]}))}function warning(code,t,a,b,c,d){var ch,l,w,msg;if(/^W\\d{3}$/.test(code)){if(state.ignored[code])return;msg=messages.warnings[code]}else/E\\d{3}/.test(code)?msg=messages.errors[code]:/I\\d{3}/.test(code)&&(msg=messages.info[code]);return t=t||state.tokens.next||{},\"(end)\"===t.id&&(t=state.tokens.curr),l=t.line||0,ch=t.from||0,w={id:\"(error)\",raw:msg.desc,code:msg.code,evidence:state.lines[l-1]||\"\",line:l,character:ch,scope:JSHINT.scope,a:a,b:b,c:c,d:d},w.reason=supplant(msg.desc,w),JSHINT.errors.push(w),removeIgnoredMessages(),JSHINT.errors.length>=state.option.maxerr&&quit(\"E043\",l,ch),w}function warningAt(m,l,ch,a,b,c,d){return warning(m,{line:l,from:ch},a,b,c,d)}function error(m,t,a,b,c,d){warning(m,t,a,b,c,d)}function errorAt(m,l,ch,a,b,c,d){return error(m,{line:l,from:ch},a,b,c,d)}function addInternalSrc(elem,src){var i;return i={id:\"(internal)\",elem:elem,value:src},JSHINT.internals.push(i),i}function doOption(){var nt=state.tokens.next,body=nt.body.match(/(-\\s+)?[^\\s,:]+(?:\\s*:\\s*(-\\s+)?[^\\s,]+)?/g)||[],predef={};if(\"globals\"===nt.type){body.forEach(function(g,idx){g=g.split(\":\");var key=(g[0]||\"\").trim(),val=(g[1]||\"\").trim();if(\"-\"===key||!key.length){if(idx>0&&idx===body.length-1)return;return error(\"E002\",nt),void 0}\"-\"===key.charAt(0)?(key=key.slice(1),val=!1,JSHINT.blacklist[key]=key,delete predefined[key]):predef[key]=\"true\"===val}),combine(predefined,predef);for(var key in predef)_.has(predef,key)&&(declared[key]=nt)}\"exported\"===nt.type&&body.forEach(function(e,idx){if(!e.length){if(idx>0&&idx===body.length-1)return;return error(\"E002\",nt),void 0}state.funct[\"(scope)\"].addExported(e)}),\"members\"===nt.type&&(membersOnly=membersOnly||{},body.forEach(function(m){var ch1=m.charAt(0),ch2=m.charAt(m.length-1);ch1!==ch2||'\"'!==ch1&&\"'\"!==ch1||(m=m.substr(1,m.length-2).replace('\\\\\"','\"')),membersOnly[m]=!1}));var numvals=[\"maxstatements\",\"maxparams\",\"maxdepth\",\"maxcomplexity\",\"maxerr\",\"maxlen\",\"indent\"];(\"jshint\"===nt.type||\"jslint\"===nt.type)&&(body.forEach(function(g){g=g.split(\":\");var key=(g[0]||\"\").trim(),val=(g[1]||\"\").trim();if(checkOption(key,nt))if(numvals.indexOf(key)>=0)if(\"false\"!==val){if(val=+val,\"number\"!=typeof val||!isFinite(val)||0>=val||Math.floor(val)!==val)return error(\"E032\",nt,g[1].trim()),void 0;state.option[key]=val}else state.option[key]=\"indent\"===key?4:!1;else{if(\"validthis\"===key)return state.funct[\"(global)\"]?void error(\"E009\"):\"true\"!==val&&\"false\"!==val?void error(\"E002\",nt):(state.option.validthis=\"true\"===val,void 0);if(\"quotmark\"!==key)if(\"shadow\"!==key)if(\"unused\"!==key)if(\"latedef\"!==key)if(\"ignore\"!==key)if(\"strict\"!==key){\"module\"===key&&(hasParsedCode(state.funct)||error(\"E055\",state.tokens.next,\"module\"));var esversions={es3:3,es5:5,esnext:6};if(!_.has(esversions,key)){if(\"esversion\"===key){switch(val){case\"5\":state.inES5(!0)&&warning(\"I003\");case\"3\":case\"6\":state.option.moz=!1,state.option.esversion=+val;break;case\"2015\":state.option.moz=!1,state.option.esversion=6;break;default:error(\"E002\",nt)}return hasParsedCode(state.funct)||error(\"E055\",state.tokens.next,\"esversion\"),void 0}var match=/^([+-])(W\\d{3})$/g.exec(key);if(match)return state.ignored[match[2]]=\"-\"===match[1],void 0;var tn;return\"true\"===val||\"false\"===val?(\"jslint\"===nt.type?(tn=options.renamed[key]||key,state.option[tn]=\"true\"===val,void 0!==options.inverted[tn]&&(state.option[tn]=!state.option[tn])):state.option[key]=\"true\"===val,\"newcap\"===key&&(state.option[\"(explicitNewcap)\"]=!0),void 0):(error(\"E002\",nt),void 0)}switch(val){case\"true\":state.option.moz=!1,state.option.esversion=esversions[key];break;case\"false\":state.option.moz||(state.option.esversion=5);break;default:error(\"E002\",nt)}}else switch(val){case\"true\":state.option.strict=!0;break;case\"false\":state.option.strict=!1;break;case\"func\":case\"global\":case\"implied\":state.option.strict=val;break;default:error(\"E002\",nt)}else switch(val){case\"line\":state.ignoredLines[nt.line]=!0,removeIgnoredMessages();break;default:error(\"E002\",nt)}else switch(val){case\"true\":state.option.latedef=!0;break;case\"false\":state.option.latedef=!1;break;case\"nofunc\":state.option.latedef=\"nofunc\";break;default:error(\"E002\",nt)}else switch(val){case\"true\":state.option.unused=!0;break;case\"false\":state.option.unused=!1;break;case\"vars\":case\"strict\":state.option.unused=val;break;default:error(\"E002\",nt)}else switch(val){case\"true\":state.option.shadow=!0;break;case\"outer\":state.option.shadow=\"outer\";break;case\"false\":case\"inner\":state.option.shadow=\"inner\";break;default:error(\"E002\",nt)}else switch(val){case\"true\":case\"false\":state.option.quotmark=\"true\"===val;break;case\"double\":case\"single\":state.option.quotmark=val;break;default:error(\"E002\",nt)}}}),assume())}function peek(p){var t,i=p||0,j=lookahead.length;if(j>i)return lookahead[i];for(;i>=j;)t=lookahead[j],t||(t=lookahead[j]=lex.token()),j+=1;return t||\"(end)\"!==state.tokens.next.id?t:state.tokens.next}function peekIgnoreEOL(){var t,i=0;do t=peek(i++);while(\"(endline)\"===t.id);return t}function advance(id,t){switch(state.tokens.curr.id){case\"(number)\":\".\"===state.tokens.next.id&&warning(\"W005\",state.tokens.curr);break;case\"-\":(\"-\"===state.tokens.next.id||\"--\"===state.tokens.next.id)&&warning(\"W006\");break;case\"+\":(\"+\"===state.tokens.next.id||\"++\"===state.tokens.next.id)&&warning(\"W007\")}for(id&&state.tokens.next.id!==id&&(t?\"(end)\"===state.tokens.next.id?error(\"E019\",t,t.id):error(\"E020\",state.tokens.next,id,t.id,t.line,state.tokens.next.value):(\"(identifier)\"!==state.tokens.next.type||state.tokens.next.value!==id)&&warning(\"W116\",state.tokens.next,id,state.tokens.next.value)),state.tokens.prev=state.tokens.curr,state.tokens.curr=state.tokens.next;;){if(state.tokens.next=lookahead.shift()||lex.token(),state.tokens.next||quit(\"E041\",state.tokens.curr.line),\"(end)\"===state.tokens.next.id||\"(error)\"===state.tokens.next.id)return;if(state.tokens.next.check&&state.tokens.next.check(),state.tokens.next.isSpecial)\"falls through\"===state.tokens.next.type?state.tokens.curr.caseFallsThrough=!0:doOption();else if(\"(endline)\"!==state.tokens.next.id)break}}function isInfix(token){return token.infix||!token.identifier&&!token.template&&!!token.led}function isEndOfExpr(){var curr=state.tokens.curr,next=state.tokens.next;return\";\"===next.id||\"}\"===next.id||\":\"===next.id?!0:isInfix(next)===isInfix(curr)||\"yield\"===curr.id&&state.inMoz()?curr.line!==startLine(next):!1}function isBeginOfExpr(prev){return!prev.left&&\"unary\"!==prev.arity}function expression(rbp,initial){var left,isArray=!1,isObject=!1,isLetExpr=!1;state.nameStack.push(),initial||\"let\"!==state.tokens.next.value||\"(\"!==peek(0).value||(state.inMoz()||warning(\"W118\",state.tokens.next,\"let expressions\"),isLetExpr=!0,state.funct[\"(scope)\"].stack(),advance(\"let\"),advance(\"(\"),state.tokens.prev.fud(),advance(\")\")),\"(end)\"===state.tokens.next.id&&error(\"E006\",state.tokens.curr);var isDangerous=state.option.asi&&state.tokens.prev.line!==startLine(state.tokens.curr)&&_.contains([\"]\",\")\"],state.tokens.prev.id)&&_.contains([\"[\",\"(\"],state.tokens.curr.id);if(isDangerous&&warning(\"W014\",state.tokens.curr,state.tokens.curr.id),advance(),initial&&(state.funct[\"(verb)\"]=state.tokens.curr.value,state.tokens.curr.beginsStmt=!0),initial===!0&&state.tokens.curr.fud)left=state.tokens.curr.fud();else for(state.tokens.curr.nud?left=state.tokens.curr.nud():error(\"E030\",state.tokens.curr,state.tokens.curr.id);(state.tokens.next.lbp>rbp||\"(template)\"===state.tokens.next.type)&&!isEndOfExpr();)isArray=\"Array\"===state.tokens.curr.value,isObject=\"Object\"===state.tokens.curr.value,left&&(left.value||left.first&&left.first.value)&&(\"new\"!==left.value||left.first&&left.first.value&&\".\"===left.first.value)&&(isArray=!1,left.value!==state.tokens.curr.value&&(isObject=!1)),advance(),isArray&&\"(\"===state.tokens.curr.id&&\")\"===state.tokens.next.id&&warning(\"W009\",state.tokens.curr),isObject&&\"(\"===state.tokens.curr.id&&\")\"===state.tokens.next.id&&warning(\"W010\",state.tokens.curr),left&&state.tokens.curr.led?left=state.tokens.curr.led(left):error(\"E033\",state.tokens.curr,state.tokens.curr.id);return isLetExpr&&state.funct[\"(scope)\"].unstack(),state.nameStack.pop(),left}function startLine(token){return token.startLine||token.line}function nobreaknonadjacent(left,right){left=left||state.tokens.curr,right=right||state.tokens.next,state.option.laxbreak||left.line===startLine(right)||warning(\"W014\",right,right.value)}function nolinebreak(t){t=t||state.tokens.curr,t.line!==startLine(state.tokens.next)&&warning(\"E022\",t,t.value)}function nobreakcomma(left,right){left.line!==startLine(right)&&(state.option.laxcomma||(comma.first&&(warning(\"I001\"),comma.first=!1),warning(\"W014\",left,right.value)))}function comma(opts){if(opts=opts||{},opts.peek?nobreakcomma(state.tokens.prev,state.tokens.curr):(nobreakcomma(state.tokens.curr,state.tokens.next),advance(\",\")),state.tokens.next.identifier&&(!opts.property||!state.inES5()))switch(state.tokens.next.value){case\"break\":case\"case\":case\"catch\":case\"continue\":case\"default\":case\"do\":case\"else\":case\"finally\":case\"for\":case\"if\":case\"in\":case\"instanceof\":case\"return\":case\"switch\":case\"throw\":case\"try\":case\"var\":case\"let\":case\"while\":case\"with\":return error(\"E024\",state.tokens.next,state.tokens.next.value),!1}if(\"(punctuator)\"===state.tokens.next.type)switch(state.tokens.next.value){case\"}\":case\"]\":case\",\":if(opts.allowTrailing)return!0;case\")\":return error(\"E024\",state.tokens.next,state.tokens.next.value),!1}return!0}function symbol(s,p){var x=state.syntax[s];return x&&\"object\"==typeof x||(state.syntax[s]=x={id:s,lbp:p,value:s}),x}function delim(s){var x=symbol(s,0);return x.delim=!0,x}function stmt(s,f){var x=delim(s);return x.identifier=x.reserved=!0,x.fud=f,x}function blockstmt(s,f){var x=stmt(s,f);return x.block=!0,x}function reserveName(x){var c=x.id.charAt(0);return(c>=\"a\"&&\"z\">=c||c>=\"A\"&&\"Z\">=c)&&(x.identifier=x.reserved=!0),x}function prefix(s,f){var x=symbol(s,150);return reserveName(x),x.nud=\"function\"==typeof f?f:function(){return this.arity=\"unary\",this.right=expression(150),(\"++\"===this.id||\"--\"===this.id)&&(state.option.plusplus?warning(\"W016\",this,this.id):!this.right||this.right.identifier&&!isReserved(this.right)||\".\"===this.right.id||\"[\"===this.right.id||warning(\"W017\",this),this.right&&this.right.isMetaProperty?error(\"E031\",this):this.right&&this.right.identifier&&state.funct[\"(scope)\"].block.modify(this.right.value,this)),this},x}function type(s,f){var x=delim(s);return x.type=s,x.nud=f,x}function reserve(name,func){var x=type(name,func);return x.identifier=!0,x.reserved=!0,x}function FutureReservedWord(name,meta){var x=type(name,meta&&meta.nud||function(){return this});return meta=meta||{},meta.isFutureReservedWord=!0,x.value=name,x.identifier=!0,x.reserved=!0,x.meta=meta,x}function reservevar(s,v){return reserve(s,function(){return\"function\"==typeof v&&v(this),this})}function infix(s,f,p,w){var x=symbol(s,p);return reserveName(x),x.infix=!0,x.led=function(left){return w||nobreaknonadjacent(state.tokens.prev,state.tokens.curr),\"in\"!==s&&\"instanceof\"!==s||\"!\"!==left.id||warning(\"W018\",left,\"!\"),\"function\"==typeof f?f(left,this):(this.left=left,this.right=expression(p),this)},x}function application(s){var x=symbol(s,42);return x.led=function(left){return nobreaknonadjacent(state.tokens.prev,state.tokens.curr),this.left=left,this.right=doFunction({type:\"arrow\",loneArg:left}),this},x}function relation(s,f){var x=symbol(s,100);return x.led=function(left){nobreaknonadjacent(state.tokens.prev,state.tokens.curr),this.left=left;var right=this.right=expression(100);return isIdentifier(left,\"NaN\")||isIdentifier(right,\"NaN\")?warning(\"W019\",this):f&&f.apply(this,[left,right]),left&&right||quit(\"E041\",state.tokens.curr.line),\"!\"===left.id&&warning(\"W018\",left,\"!\"),\"!\"===right.id&&warning(\"W018\",right,\"!\"),this},x}function isPoorRelation(node){return node&&(\"(number)\"===node.type&&0===+node.value||\"(string)\"===node.type&&\"\"===node.value||\"null\"===node.type&&!state.option.eqnull||\"true\"===node.type||\"false\"===node.type||\"undefined\"===node.type)}function isTypoTypeof(left,right,state){var values;return state.option.notypeof?!1:left&&right?(values=state.inES6()?typeofValues.es6:typeofValues.es3,\"(identifier)\"===right.type&&\"typeof\"===right.value&&\"(string)\"===left.type?!_.contains(values,left.value):!1):!1}function isGlobalEval(left,state){var isGlobal=!1;return\"this\"===left.type&&null===state.funct[\"(context)\"]?isGlobal=!0:\"(identifier)\"===left.type&&(state.option.node&&\"global\"===left.value?isGlobal=!0:!state.option.browser||\"window\"!==left.value&&\"document\"!==left.value||(isGlobal=!0)),isGlobal}function findNativePrototype(left){function walkPrototype(obj){return\"object\"==typeof obj?\"prototype\"===obj.right?obj:walkPrototype(obj.left):void 0}function walkNative(obj){for(;!obj.identifier&&\"object\"==typeof obj.left;)obj=obj.left;return obj.identifier&&natives.indexOf(obj.value)>=0?obj.value:void 0}var natives=[\"Array\",\"ArrayBuffer\",\"Boolean\",\"Collator\",\"DataView\",\"Date\",\"DateTimeFormat\",\"Error\",\"EvalError\",\"Float32Array\",\"Float64Array\",\"Function\",\"Infinity\",\"Intl\",\"Int16Array\",\"Int32Array\",\"Int8Array\",\"Iterator\",\"Number\",\"NumberFormat\",\"Object\",\"RangeError\",\"ReferenceError\",\"RegExp\",\"StopIteration\",\"String\",\"SyntaxError\",\"TypeError\",\"Uint16Array\",\"Uint32Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"URIError\"],prototype=walkPrototype(left);return prototype?walkNative(prototype):void 0}function checkLeftSideAssign(left,assignToken,options){var allowDestructuring=options&&options.allowDestructuring;if(assignToken=assignToken||left,state.option.freeze){var nativeObject=findNativePrototype(left);nativeObject&&warning(\"W121\",left,nativeObject)}return left.identifier&&!left.isMetaProperty&&state.funct[\"(scope)\"].block.reassign(left.value,left),\".\"===left.id?((!left.left||\"arguments\"===left.left.value&&!state.isStrict())&&warning(\"E031\",assignToken),state.nameStack.set(state.tokens.prev),!0):\"{\"===left.id||\"[\"===left.id?(allowDestructuring&&state.tokens.curr.left.destructAssign?state.tokens.curr.left.destructAssign.forEach(function(t){t.id&&state.funct[\"(scope)\"].block.modify(t.id,t.token)}):\"{\"!==left.id&&left.left?\"arguments\"!==left.left.value||state.isStrict()||warning(\"E031\",assignToken):warning(\"E031\",assignToken),\"[\"===left.id&&state.nameStack.set(left.right),!0):left.isMetaProperty?(error(\"E031\",assignToken),!0):left.identifier&&!isReserved(left)?(\"exception\"===state.funct[\"(scope)\"].labeltype(left.value)&&warning(\"W022\",left),state.nameStack.set(left),!0):(left===state.syntax[\"function\"]&&warning(\"W023\",state.tokens.curr),!1)}function assignop(s,f,p){var x=infix(s,\"function\"==typeof f?f:function(left,that){return that.left=left,left&&checkLeftSideAssign(left,that,{allowDestructuring:!0})?(that.right=expression(10),that):(error(\"E031\",that),void 0)},p);return x.exps=!0,x.assign=!0,x}function bitwise(s,f,p){var x=symbol(s,p);return reserveName(x),x.led=\"function\"==typeof f?f:function(left){return state.option.bitwise&&warning(\"W016\",this,this.id),this.left=left,this.right=expression(p),this},x}function bitwiseassignop(s){return assignop(s,function(left,that){return state.option.bitwise&&warning(\"W016\",that,that.id),left&&checkLeftSideAssign(left,that)?(that.right=expression(10),that):(error(\"E031\",that),void 0)},20)}function suffix(s){var x=symbol(s,150);return x.led=function(left){return state.option.plusplus?warning(\"W016\",this,this.id):left.identifier&&!isReserved(left)||\".\"===left.id||\"[\"===left.id||warning(\"W017\",this),left.isMetaProperty?error(\"E031\",this):left&&left.identifier&&state.funct[\"(scope)\"].block.modify(left.value,left),this.left=left,this},x}function optionalidentifier(fnparam,prop,preserve){if(state.tokens.next.identifier){preserve||advance();var curr=state.tokens.curr,val=state.tokens.curr.value;return isReserved(curr)?prop&&state.inES5()?val:fnparam&&\"undefined\"===val?val:(warning(\"W024\",state.tokens.curr,state.tokens.curr.id),val):val}}function identifier(fnparam,prop){var i=optionalidentifier(fnparam,prop,!1);if(i)return i;if(\"...\"===state.tokens.next.value){if(state.inES6(!0)||warning(\"W119\",state.tokens.next,\"spread/rest operator\",\"6\"),advance(),checkPunctuator(state.tokens.next,\"...\"))for(warning(\"E024\",state.tokens.next,\"...\");checkPunctuator(state.tokens.next,\"...\");)advance();return state.tokens.next.identifier?identifier(fnparam,prop):(warning(\"E024\",state.tokens.curr,\"...\"),void 0)}error(\"E030\",state.tokens.next,state.tokens.next.value),\";\"!==state.tokens.next.id&&advance()}function reachable(controlToken){var t,i=0;if(\";\"===state.tokens.next.id&&!controlToken.inBracelessBlock)for(;;){do t=peek(i),i+=1;while(\"(end)\"!==t.id&&\"(comment)\"===t.id);if(t.reach)return;if(\"(endline)\"!==t.id){if(\"function\"===t.id){state.option.latedef===!0&&warning(\"W026\",t);break}warning(\"W027\",t,t.value,controlToken.value);break}}}function parseFinalSemicolon(){if(\";\"!==state.tokens.next.id){if(state.tokens.next.isUnclosed)return advance();var sameLine=startLine(state.tokens.next)===state.tokens.curr.line&&\"(end)\"!==state.tokens.next.id,blockEnd=checkPunctuator(state.tokens.next,\"}\");sameLine&&!blockEnd?errorAt(\"E058\",state.tokens.curr.line,state.tokens.curr.character):state.option.asi||(blockEnd&&!state.option.lastsemic||!sameLine)&&warningAt(\"W033\",state.tokens.curr.line,state.tokens.curr.character)}else advance(\";\")}function statement(){var r,i=indent,t=state.tokens.next,hasOwnScope=!1;if(\";\"===t.id)return advance(\";\"),void 0;var res=isReserved(t);if(res&&t.meta&&t.meta.isFutureReservedWord&&\":\"===peek().id&&(warning(\"W024\",t,t.id),res=!1),t.identifier&&!res&&\":\"===peek().id&&(advance(),advance(\":\"),hasOwnScope=!0,state.funct[\"(scope)\"].stack(),state.funct[\"(scope)\"].block.addBreakLabel(t.value,{token:state.tokens.curr}),state.tokens.next.labelled||\"{\"===state.tokens.next.value||warning(\"W028\",state.tokens.next,t.value,state.tokens.next.value),state.tokens.next.label=t.value,t=state.tokens.next),\"{\"===t.id){var iscase=\"case\"===state.funct[\"(verb)\"]&&\":\"===state.tokens.curr.value;return block(!0,!0,!1,!1,iscase),void 0}return r=expression(0,!0),!r||r.identifier&&\"function\"===r.value||\"(punctuator)\"===r.type&&r.left&&r.left.identifier&&\"function\"===r.left.value||state.isStrict()||\"global\"!==state.option.strict||warning(\"E007\"),t.block||(state.option.expr||r&&r.exps?state.option.nonew&&r&&r.left&&\"(\"===r.id&&\"new\"===r.left.id&&warning(\"W031\",t):warning(\"W030\",state.tokens.curr),parseFinalSemicolon()),indent=i,hasOwnScope&&state.funct[\"(scope)\"].unstack(),r}function statements(){for(var p,a=[];!state.tokens.next.reach&&\"(end)\"!==state.tokens.next.id;)\";\"===state.tokens.next.id?(p=peek(),(!p||\"(\"!==p.id&&\"[\"!==p.id)&&warning(\"W032\"),advance(\";\")):a.push(statement());return a}function directives(){for(var i,p,pn;\"(string)\"===state.tokens.next.id;){if(p=peek(0),\"(endline)\"===p.id){i=1;do pn=peek(i++);while(\"(endline)\"===pn.id);if(\";\"===pn.id)p=pn;else{if(\"[\"===pn.value||\".\"===pn.value)break;state.option.asi&&\"(\"!==pn.value||warning(\"W033\",state.tokens.next)}}else{if(\".\"===p.id||\"[\"===p.id)break;\";\"!==p.id&&warning(\"W033\",p)}advance();var directive=state.tokens.curr.value;(state.directive[directive]||\"use strict\"===directive&&\"implied\"===state.option.strict)&&warning(\"W034\",state.tokens.curr,directive),state.directive[directive]=!0,\";\"===p.id&&advance(\";\")}state.isStrict()&&(state.option[\"(explicitNewcap)\"]||(state.option.newcap=!0),state.option.undef=!0)}function block(ordinary,stmt,isfunc,isfatarrow,iscase){var a,m,t,line,d,b=inblock,old_indent=indent;inblock=ordinary,t=state.tokens.next;var metrics=state.funct[\"(metrics)\"];if(metrics.nestedBlockDepth+=1,metrics.verifyMaxNestedBlockDepthPerFunction(),\"{\"===state.tokens.next.id){if(advance(\"{\"),state.funct[\"(scope)\"].stack(),line=state.tokens.curr.line,\"}\"!==state.tokens.next.id){for(indent+=state.option.indent;!ordinary&&state.tokens.next.from>indent;)indent+=state.option.indent;if(isfunc){m={};for(d in state.directive)_.has(state.directive,d)&&(m[d]=state.directive[d]);directives(),state.option.strict&&state.funct[\"(context)\"][\"(global)\"]&&(m[\"use strict\"]||state.isStrict()||warning(\"E007\"))}a=statements(),metrics.statementCount+=a.length,indent-=state.option.indent}advance(\"}\",t),isfunc&&(state.funct[\"(scope)\"].validateParams(),m&&(state.directive=m)),state.funct[\"(scope)\"].unstack(),indent=old_indent}else if(ordinary)state.funct[\"(noblockscopedvar)\"]=\"for\"!==state.tokens.next.id,state.funct[\"(scope)\"].stack(),(!stmt||state.option.curly)&&warning(\"W116\",state.tokens.next,\"{\",state.tokens.next.value),state.tokens.next.inBracelessBlock=!0,indent+=state.option.indent,a=[statement()],indent-=state.option.indent,state.funct[\"(scope)\"].unstack(),delete state.funct[\"(noblockscopedvar)\"];else if(isfunc){if(state.funct[\"(scope)\"].stack(),m={},!stmt||isfatarrow||state.inMoz()||error(\"W118\",state.tokens.curr,\"function closure expressions\"),!stmt)for(d in state.directive)_.has(state.directive,d)&&(m[d]=state.directive[d]);expression(10),state.option.strict&&state.funct[\"(context)\"][\"(global)\"]&&(m[\"use strict\"]||state.isStrict()||warning(\"E007\")),state.funct[\"(scope)\"].unstack()}else error(\"E021\",state.tokens.next,\"{\",state.tokens.next.value);switch(state.funct[\"(verb)\"]){case\"break\":case\"continue\":case\"return\":case\"throw\":if(iscase)break;default:state.funct[\"(verb)\"]=null}return inblock=b,!ordinary||!state.option.noempty||a&&0!==a.length||warning(\"W035\",state.tokens.prev),metrics.nestedBlockDepth-=1,a}function countMember(m){membersOnly&&\"boolean\"!=typeof membersOnly[m]&&warning(\"W036\",state.tokens.curr,m),\"number\"==typeof member[m]?member[m]+=1:member[m]=1}function comprehensiveArrayExpression(){var res={};res.exps=!0,state.funct[\"(comparray)\"].stack();var reversed=!1;return\"for\"!==state.tokens.next.value&&(reversed=!0,state.inMoz()||warning(\"W116\",state.tokens.next,\"for\",state.tokens.next.value),state.funct[\"(comparray)\"].setState(\"use\"),res.right=expression(10)),advance(\"for\"),\"each\"===state.tokens.next.value&&(advance(\"each\"),state.inMoz()||warning(\"W118\",state.tokens.curr,\"for each\")),advance(\"(\"),state.funct[\"(comparray)\"].setState(\"define\"),res.left=expression(130),_.contains([\"in\",\"of\"],state.tokens.next.value)?advance():error(\"E045\",state.tokens.curr),state.funct[\"(comparray)\"].setState(\"generate\"),expression(10),advance(\")\"),\"if\"===state.tokens.next.value&&(advance(\"if\"),advance(\"(\"),state.funct[\"(comparray)\"].setState(\"filter\"),res.filter=expression(10),advance(\")\")),reversed||(state.funct[\"(comparray)\"].setState(\"use\"),res.right=expression(10)),advance(\"]\"),state.funct[\"(comparray)\"].unstack(),res}function isMethod(){return state.funct[\"(statement)\"]&&\"class\"===state.funct[\"(statement)\"].type||state.funct[\"(context)\"]&&\"class\"===state.funct[\"(context)\"][\"(verb)\"]}function isPropertyName(token){return token.identifier||\"(string)\"===token.id||\"(number)\"===token.id}function propertyName(preserveOrToken){var id,preserve=!0;return\"object\"==typeof preserveOrToken?id=preserveOrToken:(preserve=preserveOrToken,id=optionalidentifier(!1,!0,preserve)),id?\"object\"==typeof id&&(\"(string)\"===id.id||\"(identifier)\"===id.id?id=id.value:\"(number)\"===id.id&&(id=\"\"+id.value)):\"(string)\"===state.tokens.next.id?(id=state.tokens.next.value,preserve||advance()):\"(number)\"===state.tokens.next.id&&(id=\"\"+state.tokens.next.value,preserve||advance()),\"hasOwnProperty\"===id&&warning(\"W001\"),id}function functionparams(options){function addParam(addParamArgs){state.funct[\"(scope)\"].addParam.apply(state.funct[\"(scope)\"],addParamArgs)}var next,ident,t,paramsIds=[],tokens=[],pastDefault=!1,pastRest=!1,arity=0,loneArg=options&&options.loneArg;if(loneArg&&loneArg.identifier===!0)return state.funct[\"(scope)\"].addParam(loneArg.value,loneArg),{arity:1,params:[loneArg.value]};if(next=state.tokens.next,options&&options.parsedOpening||advance(\"(\"),\")\"===state.tokens.next.id)return advance(\")\"),void 0;for(;;){arity++;var currentParams=[];if(_.contains([\"{\",\"[\"],state.tokens.next.id)){tokens=destructuringPattern();for(t in tokens)t=tokens[t],t.id&&(paramsIds.push(t.id),currentParams.push([t.id,t.token]))}else if(checkPunctuator(state.tokens.next,\"...\")&&(pastRest=!0),ident=identifier(!0))paramsIds.push(ident),currentParams.push([ident,state.tokens.curr]);else for(;!checkPunctuators(state.tokens.next,[\",\",\")\"]);)advance();if(pastDefault&&\"=\"!==state.tokens.next.id&&error(\"W138\",state.tokens.current),\"=\"===state.tokens.next.id&&(state.inES6()||warning(\"W119\",state.tokens.next,\"default parameters\",\"6\"),advance(\"=\"),pastDefault=!0,expression(10)),currentParams.forEach(addParam),\",\"!==state.tokens.next.id)return advance(\")\",next),{arity:arity,params:paramsIds};pastRest&&warning(\"W131\",state.tokens.next),comma()}}function functor(name,token,overwrites){var funct={\"(name)\":name,\"(breakage)\":0,\"(loopage)\":0,\"(tokens)\":{},\"(properties)\":{},\"(catch)\":!1,\"(global)\":!1,\"(line)\":null,\"(character)\":null,\"(metrics)\":null,\"(statement)\":null,\"(context)\":null,\"(scope)\":null,\"(comparray)\":null,\"(generator)\":null,\"(arrow)\":null,\"(params)\":null};return token&&_.extend(funct,{\"(line)\":token.line,\"(character)\":token.character,\"(metrics)\":createMetrics(token)}),_.extend(funct,overwrites),funct[\"(context)\"]&&(funct[\"(scope)\"]=funct[\"(context)\"][\"(scope)\"],funct[\"(comparray)\"]=funct[\"(context)\"][\"(comparray)\"]),funct}function isFunctor(token){return\"(scope)\"in token}function hasParsedCode(funct){return funct[\"(global)\"]&&!funct[\"(verb)\"]}function doTemplateLiteral(left){function end(){if(state.tokens.curr.template&&state.tokens.curr.tail&&state.tokens.curr.context===ctx)return!0;var complete=state.tokens.next.template&&state.tokens.next.tail&&state.tokens.next.context===ctx;return complete&&advance(),complete||state.tokens.next.isUnclosed}var ctx=this.context,noSubst=this.noSubst,depth=this.depth;if(!noSubst)for(;!end();)!state.tokens.next.template||state.tokens.next.depth>depth?expression(0):advance();return{id:\"(template)\",type:\"(template)\",tag:left}}function doFunction(options){var f,token,name,statement,classExprBinding,isGenerator,isArrow,ignoreLoopFunc,oldOption=state.option,oldIgnored=state.ignored;options&&(name=options.name,statement=options.statement,classExprBinding=options.classExprBinding,isGenerator=\"generator\"===options.type,isArrow=\"arrow\"===options.type,ignoreLoopFunc=options.ignoreLoopFunc),state.option=Object.create(state.option),state.ignored=Object.create(state.ignored),state.funct=functor(name||state.nameStack.infer(),state.tokens.next,{\"(statement)\":statement,\"(context)\":state.funct,\"(arrow)\":isArrow,\"(generator)\":isGenerator}),f=state.funct,token=state.tokens.curr,token.funct=state.funct,functions.push(state.funct),state.funct[\"(scope)\"].stack(\"functionouter\");var internallyAccessibleName=name||classExprBinding;internallyAccessibleName&&state.funct[\"(scope)\"].block.add(internallyAccessibleName,classExprBinding?\"class\":\"function\",state.tokens.curr,!1),state.funct[\"(scope)\"].stack(\"functionparams\");var paramsInfo=functionparams(options);return paramsInfo?(state.funct[\"(params)\"]=paramsInfo.params,state.funct[\"(metrics)\"].arity=paramsInfo.arity,state.funct[\"(metrics)\"].verifyMaxParametersPerFunction()):state.funct[\"(metrics)\"].arity=0,isArrow&&(state.inES6(!0)||warning(\"W119\",state.tokens.curr,\"arrow function syntax (=>)\",\"6\"),options.loneArg||advance(\"=>\")),block(!1,!0,!0,isArrow),!state.option.noyield&&isGenerator&&\"yielded\"!==state.funct[\"(generator)\"]&&warning(\"W124\",state.tokens.curr),state.funct[\"(metrics)\"].verifyMaxStatementsPerFunction(),state.funct[\"(metrics)\"].verifyMaxComplexityPerFunction(),state.funct[\"(unusedOption)\"]=state.option.unused,state.option=oldOption,state.ignored=oldIgnored,state.funct[\"(last)\"]=state.tokens.curr.line,state.funct[\"(lastcharacter)\"]=state.tokens.curr.character,state.funct[\"(scope)\"].unstack(),state.funct[\"(scope)\"].unstack(),state.funct=state.funct[\"(context)\"],ignoreLoopFunc||state.option.loopfunc||!state.funct[\"(loopage)\"]||f[\"(isCapturing)\"]&&warning(\"W083\",token),f}function createMetrics(functionStartToken){return{statementCount:0,nestedBlockDepth:-1,ComplexityCount:1,arity:0,verifyMaxStatementsPerFunction:function(){state.option.maxstatements&&this.statementCount>state.option.maxstatements&&warning(\"W071\",functionStartToken,this.statementCount)\n},verifyMaxParametersPerFunction:function(){_.isNumber(state.option.maxparams)&&this.arity>state.option.maxparams&&warning(\"W072\",functionStartToken,this.arity)},verifyMaxNestedBlockDepthPerFunction:function(){state.option.maxdepth&&this.nestedBlockDepth>0&&this.nestedBlockDepth===state.option.maxdepth+1&&warning(\"W073\",null,this.nestedBlockDepth)},verifyMaxComplexityPerFunction:function(){var max=state.option.maxcomplexity,cc=this.ComplexityCount;max&&cc>max&&warning(\"W074\",functionStartToken,cc)}}}function increaseComplexityCount(){state.funct[\"(metrics)\"].ComplexityCount+=1}function checkCondAssignment(expr){var id,paren;switch(expr&&(id=expr.id,paren=expr.paren,\",\"===id&&(expr=expr.exprs[expr.exprs.length-1])&&(id=expr.id,paren=paren||expr.paren)),id){case\"=\":case\"+=\":case\"-=\":case\"*=\":case\"%=\":case\"&=\":case\"|=\":case\"^=\":case\"/=\":paren||state.option.boss||warning(\"W084\")}}function checkProperties(props){if(state.inES5())for(var name in props)props[name]&&props[name].setterToken&&!props[name].getterToken&&warning(\"W078\",props[name].setterToken)}function metaProperty(name,c){if(checkPunctuator(state.tokens.next,\".\")){var left=state.tokens.curr.id;advance(\".\");var id=identifier();return state.tokens.curr.isMetaProperty=!0,name!==id?error(\"E057\",state.tokens.prev,left,id):c(),state.tokens.curr}}function destructuringPattern(options){var isAssignment=options&&options.assignment;return state.inES6()||warning(\"W104\",state.tokens.curr,isAssignment?\"destructuring assignment\":\"destructuring binding\",\"6\"),destructuringPatternRecursive(options)}function destructuringPatternRecursive(options){var ids,identifiers=[],openingParsed=options&&options.openingParsed,isAssignment=options&&options.assignment,recursiveOptions=isAssignment?{assignment:isAssignment}:null,firstToken=openingParsed?state.tokens.curr:state.tokens.next,nextInnerDE=function(){var ident;if(checkPunctuators(state.tokens.next,[\"[\",\"{\"])){ids=destructuringPatternRecursive(recursiveOptions);for(var id in ids)id=ids[id],identifiers.push({id:id.id,token:id.token})}else if(checkPunctuator(state.tokens.next,\",\"))identifiers.push({id:null,token:state.tokens.curr});else{if(!checkPunctuator(state.tokens.next,\"(\")){var is_rest=checkPunctuator(state.tokens.next,\"...\");if(isAssignment){var identifierToken=is_rest?peek(0):state.tokens.next;identifierToken.identifier||warning(\"E030\",identifierToken,identifierToken.value);var assignTarget=expression(155);assignTarget&&(checkLeftSideAssign(assignTarget),assignTarget.identifier&&(ident=assignTarget.value))}else ident=identifier();return ident&&identifiers.push({id:ident,token:state.tokens.curr}),is_rest}advance(\"(\"),nextInnerDE(),advance(\")\")}return!1},assignmentProperty=function(){var id;checkPunctuator(state.tokens.next,\"[\")?(advance(\"[\"),expression(10),advance(\"]\"),advance(\":\"),nextInnerDE()):\"(string)\"===state.tokens.next.id||\"(number)\"===state.tokens.next.id?(advance(),advance(\":\"),nextInnerDE()):(id=identifier(),checkPunctuator(state.tokens.next,\":\")?(advance(\":\"),nextInnerDE()):id&&(isAssignment&&checkLeftSideAssign(state.tokens.curr),identifiers.push({id:id,token:state.tokens.curr})))};if(checkPunctuator(firstToken,\"[\")){openingParsed||advance(\"[\"),checkPunctuator(state.tokens.next,\"]\")&&warning(\"W137\",state.tokens.curr);for(var element_after_rest=!1;!checkPunctuator(state.tokens.next,\"]\");)nextInnerDE()&&!element_after_rest&&checkPunctuator(state.tokens.next,\",\")&&(warning(\"W130\",state.tokens.next),element_after_rest=!0),checkPunctuator(state.tokens.next,\"=\")&&(checkPunctuator(state.tokens.prev,\"...\")?advance(\"]\"):advance(\"=\"),\"undefined\"===state.tokens.next.id&&warning(\"W080\",state.tokens.prev,state.tokens.prev.value),expression(10)),checkPunctuator(state.tokens.next,\"]\")||advance(\",\");advance(\"]\")}else if(checkPunctuator(firstToken,\"{\")){for(openingParsed||advance(\"{\"),checkPunctuator(state.tokens.next,\"}\")&&warning(\"W137\",state.tokens.curr);!checkPunctuator(state.tokens.next,\"}\")&&(assignmentProperty(),checkPunctuator(state.tokens.next,\"=\")&&(advance(\"=\"),\"undefined\"===state.tokens.next.id&&warning(\"W080\",state.tokens.prev,state.tokens.prev.value),expression(10)),checkPunctuator(state.tokens.next,\"}\")||(advance(\",\"),!checkPunctuator(state.tokens.next,\"}\"))););advance(\"}\")}return identifiers}function destructuringPatternMatch(tokens,value){var first=value.first;first&&_.zip(tokens,Array.isArray(first)?first:[first]).forEach(function(val){var token=val[0],value=val[1];token&&value?token.first=value:token&&token.first&&!value&&warning(\"W080\",token.first,token.first.value)})}function blockVariableStatement(type,statement,context){var tokens,lone,value,letblock,prefix=context&&context.prefix,inexport=context&&context.inexport,isLet=\"let\"===type,isConst=\"const\"===type;for(state.inES6()||warning(\"W104\",state.tokens.curr,type,\"6\"),isLet&&\"(\"===state.tokens.next.value?(state.inMoz()||warning(\"W118\",state.tokens.next,\"let block\"),advance(\"(\"),state.funct[\"(scope)\"].stack(),letblock=!0):state.funct[\"(noblockscopedvar)\"]&&error(\"E048\",state.tokens.curr,isConst?\"Const\":\"Let\"),statement.first=[];;){var names=[];_.contains([\"{\",\"[\"],state.tokens.next.value)?(tokens=destructuringPattern(),lone=!1):(tokens=[{id:identifier(),token:state.tokens.curr}],lone=!0),!prefix&&isConst&&\"=\"!==state.tokens.next.id&&warning(\"E012\",state.tokens.curr,state.tokens.curr.value);for(var t in tokens)tokens.hasOwnProperty(t)&&(t=tokens[t],state.funct[\"(scope)\"].block.isGlobal()&&predefined[t.id]===!1&&warning(\"W079\",t.token,t.id),t.id&&!state.funct[\"(noblockscopedvar)\"]&&(state.funct[\"(scope)\"].addlabel(t.id,{type:type,token:t.token}),names.push(t.token),lone&&inexport&&state.funct[\"(scope)\"].setExported(t.token.value,t.token)));if(\"=\"===state.tokens.next.id&&(advance(\"=\"),prefix||\"undefined\"!==state.tokens.next.id||warning(\"W080\",state.tokens.prev,state.tokens.prev.value),!prefix&&\"=\"===peek(0).id&&state.tokens.next.identifier&&warning(\"W120\",state.tokens.next,state.tokens.next.value),value=expression(prefix?120:10),lone?tokens[0].first=value:destructuringPatternMatch(names,value)),statement.first=statement.first.concat(names),\",\"!==state.tokens.next.id)break;comma()}return letblock&&(advance(\")\"),block(!0,!0),statement.block=!0,state.funct[\"(scope)\"].unstack()),statement}function classdef(isStatement){return state.inES6()||warning(\"W104\",state.tokens.curr,\"class\",\"6\"),isStatement?(this.name=identifier(),state.funct[\"(scope)\"].addlabel(this.name,{type:\"class\",token:state.tokens.curr})):state.tokens.next.identifier&&\"extends\"!==state.tokens.next.value?(this.name=identifier(),this.namedExpr=!0):this.name=state.nameStack.infer(),classtail(this),this}function classtail(c){var wasInClassBody=state.inClassBody;\"extends\"===state.tokens.next.value&&(advance(\"extends\"),c.heritage=expression(10)),state.inClassBody=!0,advance(\"{\"),c.body=classbody(c),advance(\"}\"),state.inClassBody=wasInClassBody}function classbody(c){for(var name,isStatic,isGenerator,getset,computed,props=Object.create(null),staticProps=Object.create(null),i=0;\"}\"!==state.tokens.next.id;++i)if(name=state.tokens.next,isStatic=!1,isGenerator=!1,getset=null,\";\"!==name.id){if(\"*\"===name.id&&(isGenerator=!0,advance(\"*\"),name=state.tokens.next),\"[\"===name.id)name=computedPropertyName(),computed=!0;else{if(!isPropertyName(name)){warning(\"W052\",state.tokens.next,state.tokens.next.value||state.tokens.next.type),advance();continue}advance(),computed=!1,name.identifier&&\"static\"===name.value&&(checkPunctuator(state.tokens.next,\"*\")&&(isGenerator=!0,advance(\"*\")),(isPropertyName(state.tokens.next)||\"[\"===state.tokens.next.id)&&(computed=\"[\"===state.tokens.next.id,isStatic=!0,name=state.tokens.next,\"[\"===state.tokens.next.id?name=computedPropertyName():advance())),!name.identifier||\"get\"!==name.value&&\"set\"!==name.value||(isPropertyName(state.tokens.next)||\"[\"===state.tokens.next.id)&&(computed=\"[\"===state.tokens.next.id,getset=name,name=state.tokens.next,\"[\"===state.tokens.next.id?name=computedPropertyName():advance())}if(!checkPunctuator(state.tokens.next,\"(\")){for(error(\"E054\",state.tokens.next,state.tokens.next.value);\"}\"!==state.tokens.next.id&&!checkPunctuator(state.tokens.next,\"(\");)advance();\"(\"!==state.tokens.next.value&&doFunction({statement:c})}if(computed||(getset?saveAccessor(getset.value,isStatic?staticProps:props,name.value,name,!0,isStatic):(\"constructor\"===name.value?state.nameStack.set(c):state.nameStack.set(name),saveProperty(isStatic?staticProps:props,name.value,name,!0,isStatic))),getset&&\"constructor\"===name.value){var propDesc=\"get\"===getset.value?\"class getter method\":\"class setter method\";error(\"E049\",name,propDesc,\"constructor\")}else\"prototype\"===name.value&&error(\"E049\",name,\"class method\",\"prototype\");propertyName(name),doFunction({statement:c,type:isGenerator?\"generator\":null,classExprBinding:c.namedExpr?c.name:null})}else warning(\"W032\"),advance(\";\");checkProperties(props)}function saveProperty(props,name,tkn,isClass,isStatic){var msg=[\"key\",\"class method\",\"static class method\"];msg=msg[(isClass||!1)+(isStatic||!1)],tkn.identifier&&(name=tkn.value),props[name]&&\"__proto__\"!==name?warning(\"W075\",state.tokens.next,msg,name):props[name]=Object.create(null),props[name].basic=!0,props[name].basictkn=tkn}function saveAccessor(accessorType,props,name,tkn,isClass,isStatic){var flagName=\"get\"===accessorType?\"getterToken\":\"setterToken\",msg=\"\";isClass?(isStatic&&(msg+=\"static \"),msg+=accessorType+\"ter method\"):msg=\"key\",state.tokens.curr.accessorType=accessorType,state.nameStack.set(tkn),props[name]?(props[name].basic||props[name][flagName])&&\"__proto__\"!==name&&warning(\"W075\",state.tokens.next,msg,name):props[name]=Object.create(null),props[name][flagName]=tkn}function computedPropertyName(){advance(\"[\"),state.inES6()||warning(\"W119\",state.tokens.curr,\"computed property names\",\"6\");var value=expression(10);return advance(\"]\"),value}function checkPunctuators(token,values){return\"(punctuator)\"===token.type?_.contains(values,token.value):!1}function checkPunctuator(token,value){return\"(punctuator)\"===token.type&&token.value===value}function destructuringAssignOrJsonValue(){var block=lookupBlockType();block.notJson?(!state.inES6()&&block.isDestAssign&&warning(\"W104\",state.tokens.curr,\"destructuring assignment\",\"6\"),statements()):(state.option.laxbreak=!0,state.jsonMode=!0,jsonValue())}function jsonValue(){function jsonObject(){var o={},t=state.tokens.next;if(advance(\"{\"),\"}\"!==state.tokens.next.id)for(;;){if(\"(end)\"===state.tokens.next.id)error(\"E026\",state.tokens.next,t.line);else{if(\"}\"===state.tokens.next.id){warning(\"W094\",state.tokens.curr);break}\",\"===state.tokens.next.id?error(\"E028\",state.tokens.next):\"(string)\"!==state.tokens.next.id&&warning(\"W095\",state.tokens.next,state.tokens.next.value)}if(o[state.tokens.next.value]===!0?warning(\"W075\",state.tokens.next,\"key\",state.tokens.next.value):\"__proto__\"===state.tokens.next.value&&!state.option.proto||\"__iterator__\"===state.tokens.next.value&&!state.option.iterator?warning(\"W096\",state.tokens.next,state.tokens.next.value):o[state.tokens.next.value]=!0,advance(),advance(\":\"),jsonValue(),\",\"!==state.tokens.next.id)break;advance(\",\")}advance(\"}\")}function jsonArray(){var t=state.tokens.next;if(advance(\"[\"),\"]\"!==state.tokens.next.id)for(;;){if(\"(end)\"===state.tokens.next.id)error(\"E027\",state.tokens.next,t.line);else{if(\"]\"===state.tokens.next.id){warning(\"W094\",state.tokens.curr);break}\",\"===state.tokens.next.id&&error(\"E028\",state.tokens.next)}if(jsonValue(),\",\"!==state.tokens.next.id)break;advance(\",\")}advance(\"]\")}switch(state.tokens.next.id){case\"{\":jsonObject();break;case\"[\":jsonArray();break;case\"true\":case\"false\":case\"null\":case\"(number)\":case\"(string)\":advance();break;case\"-\":advance(\"-\"),advance(\"(number)\");break;default:error(\"E003\",state.tokens.next)}}var api,declared,functions,inblock,indent,lookahead,lex,member,membersOnly,predefined,stack,urls,bang={\"<\":!0,\"<=\":!0,\"==\":!0,\"===\":!0,\"!==\":!0,\"!=\":!0,\">\":!0,\">=\":!0,\"+\":!0,\"-\":!0,\"*\":!0,\"/\":!0,\"%\":!0},functionicity=[\"closure\",\"exception\",\"global\",\"label\",\"outer\",\"unused\",\"var\"],extraModules=[],emitter=new events.EventEmitter,typeofValues={};typeofValues.legacy=[\"xml\",\"unknown\"],typeofValues.es3=[\"undefined\",\"boolean\",\"number\",\"string\",\"function\",\"object\"],typeofValues.es3=typeofValues.es3.concat(typeofValues.legacy),typeofValues.es6=typeofValues.es3.concat(\"symbol\"),type(\"(number)\",function(){return this}),type(\"(string)\",function(){return this}),state.syntax[\"(identifier)\"]={type:\"(identifier)\",lbp:0,identifier:!0,nud:function(){var v=this.value;return\"=>\"===state.tokens.next.id?this:(state.funct[\"(comparray)\"].check(v)||state.funct[\"(scope)\"].block.use(v,state.tokens.curr),this)},led:function(){error(\"E033\",state.tokens.next,state.tokens.next.value)}};var baseTemplateSyntax={lbp:0,identifier:!1,template:!0};state.syntax[\"(template)\"]=_.extend({type:\"(template)\",nud:doTemplateLiteral,led:doTemplateLiteral,noSubst:!1},baseTemplateSyntax),state.syntax[\"(template middle)\"]=_.extend({type:\"(template middle)\",middle:!0,noSubst:!1},baseTemplateSyntax),state.syntax[\"(template tail)\"]=_.extend({type:\"(template tail)\",tail:!0,noSubst:!1},baseTemplateSyntax),state.syntax[\"(no subst template)\"]=_.extend({type:\"(template)\",nud:doTemplateLiteral,led:doTemplateLiteral,noSubst:!0,tail:!0},baseTemplateSyntax),type(\"(regexp)\",function(){return this}),delim(\"(endline)\"),delim(\"(begin)\"),delim(\"(end)\").reach=!0,delim(\"(error)\").reach=!0,delim(\"}\").reach=!0,delim(\")\"),delim(\"]\"),delim('\"').reach=!0,delim(\"'\").reach=!0,delim(\";\"),delim(\":\").reach=!0,delim(\"#\"),reserve(\"else\"),reserve(\"case\").reach=!0,reserve(\"catch\"),reserve(\"default\").reach=!0,reserve(\"finally\"),reservevar(\"arguments\",function(x){state.isStrict()&&state.funct[\"(global)\"]&&warning(\"E008\",x)}),reservevar(\"eval\"),reservevar(\"false\"),reservevar(\"Infinity\"),reservevar(\"null\"),reservevar(\"this\",function(x){state.isStrict()&&!isMethod()&&!state.option.validthis&&(state.funct[\"(statement)\"]&&state.funct[\"(name)\"].charAt(0)>\"Z\"||state.funct[\"(global)\"])&&warning(\"W040\",x)}),reservevar(\"true\"),reservevar(\"undefined\"),assignop(\"=\",\"assign\",20),assignop(\"+=\",\"assignadd\",20),assignop(\"-=\",\"assignsub\",20),assignop(\"*=\",\"assignmult\",20),assignop(\"/=\",\"assigndiv\",20).nud=function(){error(\"E014\")},assignop(\"%=\",\"assignmod\",20),bitwiseassignop(\"&=\"),bitwiseassignop(\"|=\"),bitwiseassignop(\"^=\"),bitwiseassignop(\"<<=\"),bitwiseassignop(\">>=\"),bitwiseassignop(\">>>=\"),infix(\",\",function(left,that){var expr;if(that.exprs=[left],state.option.nocomma&&warning(\"W127\"),!comma({peek:!0}))return that;for(;;){if(!(expr=expression(10)))break;if(that.exprs.push(expr),\",\"!==state.tokens.next.value||!comma())break}return that},10,!0),infix(\"?\",function(left,that){return increaseComplexityCount(),that.left=left,that.right=expression(10),advance(\":\"),that[\"else\"]=expression(10),that},30);var orPrecendence=40;infix(\"||\",function(left,that){return increaseComplexityCount(),that.left=left,that.right=expression(orPrecendence),that},orPrecendence),infix(\"&&\",\"and\",50),bitwise(\"|\",\"bitor\",70),bitwise(\"^\",\"bitxor\",80),bitwise(\"&\",\"bitand\",90),relation(\"==\",function(left,right){var eqnull=state.option.eqnull&&(\"null\"===(left&&left.value)||\"null\"===(right&&right.value));switch(!0){case!eqnull&&state.option.eqeqeq:this.from=this.character,warning(\"W116\",this,\"===\",\"==\");break;case isPoorRelation(left):warning(\"W041\",this,\"===\",left.value);break;case isPoorRelation(right):warning(\"W041\",this,\"===\",right.value);break;case isTypoTypeof(right,left,state):warning(\"W122\",this,right.value);break;case isTypoTypeof(left,right,state):warning(\"W122\",this,left.value)}return this}),relation(\"===\",function(left,right){return isTypoTypeof(right,left,state)?warning(\"W122\",this,right.value):isTypoTypeof(left,right,state)&&warning(\"W122\",this,left.value),this}),relation(\"!=\",function(left,right){var eqnull=state.option.eqnull&&(\"null\"===(left&&left.value)||\"null\"===(right&&right.value));return!eqnull&&state.option.eqeqeq?(this.from=this.character,warning(\"W116\",this,\"!==\",\"!=\")):isPoorRelation(left)?warning(\"W041\",this,\"!==\",left.value):isPoorRelation(right)?warning(\"W041\",this,\"!==\",right.value):isTypoTypeof(right,left,state)?warning(\"W122\",this,right.value):isTypoTypeof(left,right,state)&&warning(\"W122\",this,left.value),this}),relation(\"!==\",function(left,right){return isTypoTypeof(right,left,state)?warning(\"W122\",this,right.value):isTypoTypeof(left,right,state)&&warning(\"W122\",this,left.value),this}),relation(\"<\"),relation(\">\"),relation(\"<=\"),relation(\">=\"),bitwise(\"<<\",\"shiftleft\",120),bitwise(\">>\",\"shiftright\",120),bitwise(\">>>\",\"shiftrightunsigned\",120),infix(\"in\",\"in\",120),infix(\"instanceof\",\"instanceof\",120),infix(\"+\",function(left,that){var right;return that.left=left,that.right=right=expression(130),left&&right&&\"(string)\"===left.id&&\"(string)\"===right.id?(left.value+=right.value,left.character=right.character,!state.option.scripturl&®.javascriptURL.test(left.value)&&warning(\"W050\",left),left):that},130),prefix(\"+\",\"num\"),prefix(\"+++\",function(){return warning(\"W007\"),this.arity=\"unary\",this.right=expression(150),this}),infix(\"+++\",function(left){return warning(\"W007\"),this.left=left,this.right=expression(130),this},130),infix(\"-\",\"sub\",130),prefix(\"-\",\"neg\"),prefix(\"---\",function(){return warning(\"W006\"),this.arity=\"unary\",this.right=expression(150),this}),infix(\"---\",function(left){return warning(\"W006\"),this.left=left,this.right=expression(130),this},130),infix(\"*\",\"mult\",140),infix(\"/\",\"div\",140),infix(\"%\",\"mod\",140),suffix(\"++\"),prefix(\"++\",\"preinc\"),state.syntax[\"++\"].exps=!0,suffix(\"--\"),prefix(\"--\",\"predec\"),state.syntax[\"--\"].exps=!0,prefix(\"delete\",function(){var p=expression(10);return p?(\".\"!==p.id&&\"[\"!==p.id&&warning(\"W051\"),this.first=p,p.identifier&&!state.isStrict()&&(p.forgiveUndef=!0),this):this}).exps=!0,prefix(\"~\",function(){return state.option.bitwise&&warning(\"W016\",this,\"~\"),this.arity=\"unary\",this.right=expression(150),this}),prefix(\"...\",function(){return state.inES6(!0)||warning(\"W119\",this,\"spread/rest operator\",\"6\"),state.tokens.next.identifier||\"(string)\"===state.tokens.next.type||checkPunctuators(state.tokens.next,[\"[\",\"(\"])||error(\"E030\",state.tokens.next,state.tokens.next.value),expression(150),this}),prefix(\"!\",function(){return this.arity=\"unary\",this.right=expression(150),this.right||quit(\"E041\",this.line||0),bang[this.right.id]===!0&&warning(\"W018\",this,\"!\"),this}),prefix(\"typeof\",function(){var p=expression(150);return this.first=this.right=p,p||quit(\"E041\",this.line||0,this.character||0),p.identifier&&(p.forgiveUndef=!0),this}),prefix(\"new\",function(){var mp=metaProperty(\"target\",function(){state.inES6(!0)||warning(\"W119\",state.tokens.prev,\"new.target\",\"6\");for(var inFunction,c=state.funct;c&&(inFunction=!c[\"(global)\"],c[\"(arrow)\"]);)c=c[\"(context)\"];inFunction||warning(\"W136\",state.tokens.prev,\"new.target\")});if(mp)return mp;var i,c=expression(155);if(c&&\"function\"!==c.id)if(c.identifier)switch(c[\"new\"]=!0,c.value){case\"Number\":case\"String\":case\"Boolean\":case\"Math\":case\"JSON\":warning(\"W053\",state.tokens.prev,c.value);break;case\"Symbol\":state.inES6()&&warning(\"W053\",state.tokens.prev,c.value);break;case\"Function\":state.option.evil||warning(\"W054\");break;case\"Date\":case\"RegExp\":case\"this\":break;default:\"function\"!==c.id&&(i=c.value.substr(0,1),state.option.newcap&&(\"A\">i||i>\"Z\")&&!state.funct[\"(scope)\"].isPredefined(c.value)&&warning(\"W055\",state.tokens.curr))}else\".\"!==c.id&&\"[\"!==c.id&&\"(\"!==c.id&&warning(\"W056\",state.tokens.curr);else state.option.supernew||warning(\"W057\",this);return\"(\"===state.tokens.next.id||state.option.supernew||warning(\"W058\",state.tokens.curr,state.tokens.curr.value),this.first=this.right=c,this}),state.syntax[\"new\"].exps=!0,prefix(\"void\").exps=!0,infix(\".\",function(left,that){var m=identifier(!1,!0);return\"string\"==typeof m&&countMember(m),that.left=left,that.right=m,m&&\"hasOwnProperty\"===m&&\"=\"===state.tokens.next.value&&warning(\"W001\"),!left||\"arguments\"!==left.value||\"callee\"!==m&&\"caller\"!==m?state.option.evil||!left||\"document\"!==left.value||\"write\"!==m&&\"writeln\"!==m||warning(\"W060\",left):state.option.noarg?warning(\"W059\",left,m):state.isStrict()&&error(\"E008\"),state.option.evil||\"eval\"!==m&&\"execScript\"!==m||isGlobalEval(left,state)&&warning(\"W061\"),that},160,!0),infix(\"(\",function(left,that){state.option.immed&&left&&!left.immed&&\"function\"===left.id&&warning(\"W062\");var n=0,p=[];if(left&&\"(identifier)\"===left.type&&left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&-1===\"Array Number String Boolean Date Object Error Symbol\".indexOf(left.value)&&(\"Math\"===left.value?warning(\"W063\",left):state.option.newcap&&warning(\"W064\",left)),\")\"!==state.tokens.next.id)for(;p[p.length]=expression(10),n+=1,\",\"===state.tokens.next.id;)comma();return advance(\")\"),\"object\"==typeof left&&(state.inES5()||\"parseInt\"!==left.value||1!==n||warning(\"W065\",state.tokens.curr),state.option.evil||(\"eval\"===left.value||\"Function\"===left.value||\"execScript\"===left.value?(warning(\"W061\",left),p[0]&&\"(string)\"===[0].id&&addInternalSrc(left,p[0].value)):!p[0]||\"(string)\"!==p[0].id||\"setTimeout\"!==left.value&&\"setInterval\"!==left.value?!p[0]||\"(string)\"!==p[0].id||\".\"!==left.value||\"window\"!==left.left.value||\"setTimeout\"!==left.right&&\"setInterval\"!==left.right||(warning(\"W066\",left),addInternalSrc(left,p[0].value)):(warning(\"W066\",left),addInternalSrc(left,p[0].value))),left.identifier||\".\"===left.id||\"[\"===left.id||\"=>\"===left.id||\"(\"===left.id||\"&&\"===left.id||\"||\"===left.id||\"?\"===left.id||state.inES6()&&left[\"(name)\"]||warning(\"W067\",that)),that.left=left,that},155,!0).exps=!0,prefix(\"(\",function(){var pn1,ret,triggerFnExpr,first,last,pn=state.tokens.next,i=-1,parens=1,opening=state.tokens.curr,preceeding=state.tokens.prev,isNecessary=!state.option.singleGroups;do\"(\"===pn.value?parens+=1:\")\"===pn.value&&(parens-=1),i+=1,pn1=pn,pn=peek(i);while((0!==parens||\")\"!==pn1.value)&&\";\"!==pn.value&&\"(end)\"!==pn.type);if(\"function\"===state.tokens.next.id&&(triggerFnExpr=state.tokens.next.immed=!0),\"=>\"===pn.value)return doFunction({type:\"arrow\",parsedOpening:!0});var exprs=[];if(\")\"!==state.tokens.next.id)for(;exprs.push(expression(10)),\",\"===state.tokens.next.id;)state.option.nocomma&&warning(\"W127\"),comma();return advance(\")\",this),state.option.immed&&exprs[0]&&\"function\"===exprs[0].id&&\"(\"!==state.tokens.next.id&&\".\"!==state.tokens.next.id&&\"[\"!==state.tokens.next.id&&warning(\"W068\",this),exprs.length?(exprs.length>1?(ret=Object.create(state.syntax[\",\"]),ret.exprs=exprs,first=exprs[0],last=exprs[exprs.length-1],isNecessary||(isNecessary=preceeding.assign||preceeding.delim)):(ret=first=last=exprs[0],isNecessary||(isNecessary=opening.beginsStmt&&(\"{\"===ret.id||triggerFnExpr||isFunctor(ret))||triggerFnExpr&&(!isEndOfExpr()||\"}\"!==state.tokens.prev.id)||isFunctor(ret)&&!isEndOfExpr()||\"{\"===ret.id&&\"=>\"===preceeding.id||\"(number)\"===ret.type&&checkPunctuator(pn,\".\")&&/^\\d+$/.test(ret.value))),ret&&(!isNecessary&&(first.left||first.right||ret.exprs)&&(isNecessary=!isBeginOfExpr(preceeding)&&first.lbp<=preceeding.lbp||!isEndOfExpr()&&last.lbp\"),infix(\"[\",function(left,that){var s,e=expression(10);return e&&\"(string)\"===e.type&&(state.option.evil||\"eval\"!==e.value&&\"execScript\"!==e.value||isGlobalEval(left,state)&&warning(\"W061\"),countMember(e.value),!state.option.sub&®.identifier.test(e.value)&&(s=state.syntax[e.value],s&&isReserved(s)||warning(\"W069\",state.tokens.prev,e.value))),advance(\"]\",that),e&&\"hasOwnProperty\"===e.value&&\"=\"===state.tokens.next.value&&warning(\"W001\"),that.left=left,that.right=e,that},160,!0),prefix(\"[\",function(){var blocktype=lookupBlockType();if(blocktype.isCompArray)return state.option.esnext||state.inMoz()||warning(\"W118\",state.tokens.curr,\"array comprehension\"),comprehensiveArrayExpression();if(blocktype.isDestAssign)return this.destructAssign=destructuringPattern({openingParsed:!0,assignment:!0}),this;var b=state.tokens.curr.line!==startLine(state.tokens.next);for(this.first=[],b&&(indent+=state.option.indent,state.tokens.next.from===indent+state.option.indent&&(indent+=state.option.indent));\"(end)\"!==state.tokens.next.id;){for(;\",\"===state.tokens.next.id;){if(!state.option.elision){if(state.inES5()){warning(\"W128\");do advance(\",\");while(\",\"===state.tokens.next.id);continue}warning(\"W070\")}advance(\",\")}if(\"]\"===state.tokens.next.id)break;if(this.first.push(expression(10)),\",\"!==state.tokens.next.id)break;if(comma({allowTrailing:!0}),\"]\"===state.tokens.next.id&&!state.inES5()){warning(\"W070\",state.tokens.curr);break}}return b&&(indent-=state.option.indent),advance(\"]\",this),this}),function(x){x.nud=function(){var b,f,i,p,t,nextVal,isGeneratorMethod=!1,props=Object.create(null);b=state.tokens.curr.line!==startLine(state.tokens.next),b&&(indent+=state.option.indent,state.tokens.next.from===indent+state.option.indent&&(indent+=state.option.indent));var blocktype=lookupBlockType();if(blocktype.isDestAssign)return this.destructAssign=destructuringPattern({openingParsed:!0,assignment:!0}),this;for(;\"}\"!==state.tokens.next.id;){if(nextVal=state.tokens.next.value,!state.tokens.next.identifier||\",\"!==peekIgnoreEOL().id&&\"}\"!==peekIgnoreEOL().id)if(\":\"===peek().id||\"get\"!==nextVal&&\"set\"!==nextVal){if(\"*\"===state.tokens.next.value&&\"(punctuator)\"===state.tokens.next.type?(state.inES6()||warning(\"W104\",state.tokens.next,\"generator functions\",\"6\"),advance(\"*\"),isGeneratorMethod=!0):isGeneratorMethod=!1,\"[\"===state.tokens.next.id)i=computedPropertyName(),state.nameStack.set(i);else if(state.nameStack.set(state.tokens.next),i=propertyName(),saveProperty(props,i,state.tokens.next),\"string\"!=typeof i)break;\"(\"===state.tokens.next.value?(state.inES6()||warning(\"W104\",state.tokens.curr,\"concise methods\",\"6\"),doFunction({type:isGeneratorMethod?\"generator\":null})):(advance(\":\"),expression(10))}else advance(nextVal),state.inES5()||error(\"E034\"),i=propertyName(),i||state.inES6()||error(\"E035\"),i&&saveAccessor(nextVal,props,i,state.tokens.curr),t=state.tokens.next,f=doFunction(),p=f[\"(params)\"],\"get\"===nextVal&&i&&p?warning(\"W076\",t,p[0],i):\"set\"!==nextVal||!i||p&&1===p.length||warning(\"W077\",t,i);else state.inES6()||warning(\"W104\",state.tokens.next,\"object short notation\",\"6\"),i=propertyName(!0),saveProperty(props,i,state.tokens.next),expression(10);if(countMember(i),\",\"!==state.tokens.next.id)break;comma({allowTrailing:!0,property:!0}),\",\"===state.tokens.next.id?warning(\"W070\",state.tokens.curr):\"}\"!==state.tokens.next.id||state.inES5()||warning(\"W070\",state.tokens.curr)}return b&&(indent-=state.option.indent),advance(\"}\",this),checkProperties(props),this},x.fud=function(){error(\"E036\",state.tokens.curr)}}(delim(\"{\"));var conststatement=stmt(\"const\",function(context){return blockVariableStatement(\"const\",this,context)});conststatement.exps=!0;var letstatement=stmt(\"let\",function(context){return blockVariableStatement(\"let\",this,context)});letstatement.exps=!0;var varstatement=stmt(\"var\",function(context){var tokens,lone,value,prefix=context&&context.prefix,inexport=context&&context.inexport,implied=context&&context.implied,report=!(context&&context.ignore);for(this.first=[];;){var names=[];_.contains([\"{\",\"[\"],state.tokens.next.value)?(tokens=destructuringPattern(),lone=!1):(tokens=[{id:identifier(),token:state.tokens.curr}],lone=!0),prefix&&implied||!report||!state.option.varstmt||warning(\"W132\",this),this.first=this.first.concat(names);for(var t in tokens)tokens.hasOwnProperty(t)&&(t=tokens[t],!implied&&state.funct[\"(global)\"]&&(predefined[t.id]===!1?warning(\"W079\",t.token,t.id):state.option.futurehostile===!1&&(!state.inES5()&&vars.ecmaIdentifiers[5][t.id]===!1||!state.inES6()&&vars.ecmaIdentifiers[6][t.id]===!1)&&warning(\"W129\",t.token,t.id)),t.id&&(\"for\"===implied?(state.funct[\"(scope)\"].has(t.id)||report&&warning(\"W088\",t.token,t.id),state.funct[\"(scope)\"].block.use(t.id,t.token)):(state.funct[\"(scope)\"].addlabel(t.id,{type:\"var\",token:t.token}),lone&&inexport&&state.funct[\"(scope)\"].setExported(t.id,t.token)),names.push(t.token)));if(\"=\"===state.tokens.next.id&&(state.nameStack.set(state.tokens.curr),advance(\"=\"),prefix||!report||state.funct[\"(loopage)\"]||\"undefined\"!==state.tokens.next.id||warning(\"W080\",state.tokens.prev,state.tokens.prev.value),\"=\"===peek(0).id&&state.tokens.next.identifier&&(!prefix&&report&&!state.funct[\"(params)\"]||-1===state.funct[\"(params)\"].indexOf(state.tokens.next.value))&&warning(\"W120\",state.tokens.next,state.tokens.next.value),value=expression(prefix?120:10),lone?tokens[0].first=value:destructuringPatternMatch(names,value)),\",\"!==state.tokens.next.id)break;comma()}return this});varstatement.exps=!0,blockstmt(\"class\",function(){return classdef.call(this,!0)}),blockstmt(\"function\",function(context){var inexport=context&&context.inexport,generator=!1;\"*\"===state.tokens.next.value&&(advance(\"*\"),state.inES6({strict:!0})?generator=!0:warning(\"W119\",state.tokens.curr,\"function*\",\"6\")),inblock&&warning(\"W082\",state.tokens.curr);var i=optionalidentifier();return state.funct[\"(scope)\"].addlabel(i,{type:\"function\",token:state.tokens.curr}),void 0===i?warning(\"W025\"):inexport&&state.funct[\"(scope)\"].setExported(i,state.tokens.prev),doFunction({name:i,statement:this,type:generator?\"generator\":null,ignoreLoopFunc:inblock}),\"(\"===state.tokens.next.id&&state.tokens.next.line===state.tokens.curr.line&&error(\"E039\"),this}),prefix(\"function\",function(){var generator=!1;\"*\"===state.tokens.next.value&&(state.inES6()||warning(\"W119\",state.tokens.curr,\"function*\",\"6\"),advance(\"*\"),generator=!0);var i=optionalidentifier();return doFunction({name:i,type:generator?\"generator\":null}),this}),blockstmt(\"if\",function(){var t=state.tokens.next;increaseComplexityCount(),state.condition=!0,advance(\"(\");var expr=expression(0);checkCondAssignment(expr);var forinifcheck=null;state.option.forin&&state.forinifcheckneeded&&(state.forinifcheckneeded=!1,forinifcheck=state.forinifchecks[state.forinifchecks.length-1],forinifcheck.type=\"(punctuator)\"===expr.type&&\"!\"===expr.value?\"(negative)\":\"(positive)\"),advance(\")\",t),state.condition=!1;var s=block(!0,!0);return forinifcheck&&\"(negative)\"===forinifcheck.type&&s&&s[0]&&\"(identifier)\"===s[0].type&&\"continue\"===s[0].value&&(forinifcheck.type=\"(negative-with-continue)\"),\"else\"===state.tokens.next.id&&(advance(\"else\"),\"if\"===state.tokens.next.id||\"switch\"===state.tokens.next.id?statement():block(!0,!0)),this}),blockstmt(\"try\",function(){function doCatch(){if(advance(\"catch\"),advance(\"(\"),state.funct[\"(scope)\"].stack(\"catchparams\"),checkPunctuators(state.tokens.next,[\"[\",\"{\"])){var tokens=destructuringPattern();_.each(tokens,function(token){token.id&&state.funct[\"(scope)\"].addParam(token.id,token,\"exception\")})}else\"(identifier)\"!==state.tokens.next.type?warning(\"E030\",state.tokens.next,state.tokens.next.value):state.funct[\"(scope)\"].addParam(identifier(),state.tokens.curr,\"exception\");\"if\"===state.tokens.next.value&&(state.inMoz()||warning(\"W118\",state.tokens.curr,\"catch filter\"),advance(\"if\"),expression(0)),advance(\")\"),block(!1),state.funct[\"(scope)\"].unstack()}var b;for(block(!0);\"catch\"===state.tokens.next.id;)increaseComplexityCount(),b&&!state.inMoz()&&warning(\"W118\",state.tokens.next,\"multiple catch blocks\"),doCatch(),b=!0;return\"finally\"===state.tokens.next.id?(advance(\"finally\"),block(!0),void 0):(b||error(\"E021\",state.tokens.next,\"catch\",state.tokens.next.value),this)}),blockstmt(\"while\",function(){var t=state.tokens.next;return state.funct[\"(breakage)\"]+=1,state.funct[\"(loopage)\"]+=1,increaseComplexityCount(),advance(\"(\"),checkCondAssignment(expression(0)),advance(\")\",t),block(!0,!0),state.funct[\"(breakage)\"]-=1,state.funct[\"(loopage)\"]-=1,this}).labelled=!0,blockstmt(\"with\",function(){var t=state.tokens.next;return state.isStrict()?error(\"E010\",state.tokens.curr):state.option.withstmt||warning(\"W085\",state.tokens.curr),advance(\"(\"),expression(0),advance(\")\",t),block(!0,!0),this}),blockstmt(\"switch\",function(){var t=state.tokens.next,g=!1,noindent=!1;\nfor(state.funct[\"(breakage)\"]+=1,advance(\"(\"),checkCondAssignment(expression(0)),advance(\")\",t),t=state.tokens.next,advance(\"{\"),state.tokens.next.from===indent&&(noindent=!0),noindent||(indent+=state.option.indent),this.cases=[];;)switch(state.tokens.next.id){case\"case\":switch(state.funct[\"(verb)\"]){case\"yield\":case\"break\":case\"case\":case\"continue\":case\"return\":case\"switch\":case\"throw\":break;default:state.tokens.curr.caseFallsThrough||warning(\"W086\",state.tokens.curr,\"case\")}advance(\"case\"),this.cases.push(expression(0)),increaseComplexityCount(),g=!0,advance(\":\"),state.funct[\"(verb)\"]=\"case\";break;case\"default\":switch(state.funct[\"(verb)\"]){case\"yield\":case\"break\":case\"continue\":case\"return\":case\"throw\":break;default:this.cases.length&&(state.tokens.curr.caseFallsThrough||warning(\"W086\",state.tokens.curr,\"default\"))}advance(\"default\"),g=!0,advance(\":\");break;case\"}\":return noindent||(indent-=state.option.indent),advance(\"}\",t),state.funct[\"(breakage)\"]-=1,state.funct[\"(verb)\"]=void 0,void 0;case\"(end)\":return error(\"E023\",state.tokens.next,\"}\"),void 0;default:if(indent+=state.option.indent,g)switch(state.tokens.curr.id){case\",\":return error(\"E040\"),void 0;case\":\":g=!1,statements();break;default:return error(\"E025\",state.tokens.curr),void 0}else{if(\":\"!==state.tokens.curr.id)return error(\"E021\",state.tokens.next,\"case\",state.tokens.next.value),void 0;advance(\":\"),error(\"E024\",state.tokens.curr,\":\"),statements()}indent-=state.option.indent}return this}).labelled=!0,stmt(\"debugger\",function(){return state.option.debug||warning(\"W087\",this),this}).exps=!0,function(){var x=stmt(\"do\",function(){state.funct[\"(breakage)\"]+=1,state.funct[\"(loopage)\"]+=1,increaseComplexityCount(),this.first=block(!0,!0),advance(\"while\");var t=state.tokens.next;return advance(\"(\"),checkCondAssignment(expression(0)),advance(\")\",t),state.funct[\"(breakage)\"]-=1,state.funct[\"(loopage)\"]-=1,this});x.labelled=!0,x.exps=!0}(),blockstmt(\"for\",function(){var s,t=state.tokens.next,letscope=!1,foreachtok=null;\"each\"===t.value&&(foreachtok=t,advance(\"each\"),state.inMoz()||warning(\"W118\",state.tokens.curr,\"for each\")),increaseComplexityCount(),advance(\"(\");var nextop,comma,initializer,i=0,inof=[\"in\",\"of\"],level=0;checkPunctuators(state.tokens.next,[\"{\",\"[\"])&&++level;do{if(nextop=peek(i),++i,checkPunctuators(nextop,[\"{\",\"[\"])?++level:checkPunctuators(nextop,[\"}\",\"]\"])&&--level,0>level)break;0===level&&(!comma&&checkPunctuator(nextop,\",\")?comma=nextop:!initializer&&checkPunctuator(nextop,\"=\")&&(initializer=nextop))}while(level>0||!_.contains(inof,nextop.value)&&\";\"!==nextop.value&&\"(end)\"!==nextop.type);if(_.contains(inof,nextop.value)){state.inES6()||\"of\"!==nextop.value||warning(\"W104\",nextop,\"for of\",\"6\");var ok=!(initializer||comma);if(initializer&&error(\"W133\",comma,nextop.value,\"initializer is forbidden\"),comma&&error(\"W133\",comma,nextop.value,\"more than one ForBinding\"),\"var\"===state.tokens.next.id?(advance(\"var\"),state.tokens.curr.fud({prefix:!0})):\"let\"===state.tokens.next.id||\"const\"===state.tokens.next.id?(advance(state.tokens.next.id),letscope=!0,state.funct[\"(scope)\"].stack(),state.tokens.curr.fud({prefix:!0})):Object.create(varstatement).fud({prefix:!0,implied:\"for\",ignore:!ok}),advance(nextop.value),expression(20),advance(\")\",t),\"in\"===nextop.value&&state.option.forin&&(state.forinifcheckneeded=!0,void 0===state.forinifchecks&&(state.forinifchecks=[]),state.forinifchecks.push({type:\"(none)\"})),state.funct[\"(breakage)\"]+=1,state.funct[\"(loopage)\"]+=1,s=block(!0,!0),\"in\"===nextop.value&&state.option.forin){if(state.forinifchecks&&state.forinifchecks.length>0){var check=state.forinifchecks.pop();(s&&s.length>0&&(\"object\"!=typeof s[0]||\"if\"!==s[0].value)||\"(positive)\"===check.type&&s.length>1||\"(negative)\"===check.type)&&warning(\"W089\",this)}state.forinifcheckneeded=!1}state.funct[\"(breakage)\"]-=1,state.funct[\"(loopage)\"]-=1}else{if(foreachtok&&error(\"E045\",foreachtok),\";\"!==state.tokens.next.id)if(\"var\"===state.tokens.next.id)advance(\"var\"),state.tokens.curr.fud();else if(\"let\"===state.tokens.next.id)advance(\"let\"),letscope=!0,state.funct[\"(scope)\"].stack(),state.tokens.curr.fud();else for(;expression(0,\"for\"),\",\"===state.tokens.next.id;)comma();if(nolinebreak(state.tokens.curr),advance(\";\"),state.funct[\"(loopage)\"]+=1,\";\"!==state.tokens.next.id&&checkCondAssignment(expression(0)),nolinebreak(state.tokens.curr),advance(\";\"),\";\"===state.tokens.next.id&&error(\"E021\",state.tokens.next,\")\",\";\"),\")\"!==state.tokens.next.id)for(;expression(0,\"for\"),\",\"===state.tokens.next.id;)comma();advance(\")\",t),state.funct[\"(breakage)\"]+=1,block(!0,!0),state.funct[\"(breakage)\"]-=1,state.funct[\"(loopage)\"]-=1}return letscope&&state.funct[\"(scope)\"].unstack(),this}).labelled=!0,stmt(\"break\",function(){var v=state.tokens.next.value;return state.option.asi||nolinebreak(this),\";\"===state.tokens.next.id||state.tokens.next.reach||state.tokens.curr.line!==startLine(state.tokens.next)?0===state.funct[\"(breakage)\"]&&warning(\"W052\",state.tokens.next,this.value):(state.funct[\"(scope)\"].funct.hasBreakLabel(v)||warning(\"W090\",state.tokens.next,v),this.first=state.tokens.next,advance()),reachable(this),this}).exps=!0,stmt(\"continue\",function(){var v=state.tokens.next.value;return 0===state.funct[\"(breakage)\"]&&warning(\"W052\",state.tokens.next,this.value),state.funct[\"(loopage)\"]||warning(\"W052\",state.tokens.next,this.value),state.option.asi||nolinebreak(this),\";\"===state.tokens.next.id||state.tokens.next.reach||state.tokens.curr.line===startLine(state.tokens.next)&&(state.funct[\"(scope)\"].funct.hasBreakLabel(v)||warning(\"W090\",state.tokens.next,v),this.first=state.tokens.next,advance()),reachable(this),this}).exps=!0,stmt(\"return\",function(){return this.line===startLine(state.tokens.next)?\";\"===state.tokens.next.id||state.tokens.next.reach||(this.first=expression(0),!this.first||\"(punctuator)\"!==this.first.type||\"=\"!==this.first.value||this.first.paren||state.option.boss||warningAt(\"W093\",this.first.line,this.first.character)):\"(punctuator)\"===state.tokens.next.type&&[\"[\",\"{\",\"+\",\"-\"].indexOf(state.tokens.next.value)>-1&&nolinebreak(this),reachable(this),this}).exps=!0,function(x){x.exps=!0,x.lbp=25}(prefix(\"yield\",function(){var prev=state.tokens.prev;state.inES6(!0)&&!state.funct[\"(generator)\"]?\"(catch)\"===state.funct[\"(name)\"]&&state.funct[\"(context)\"][\"(generator)\"]||error(\"E046\",state.tokens.curr,\"yield\"):state.inES6()||warning(\"W104\",state.tokens.curr,\"yield\",\"6\"),state.funct[\"(generator)\"]=\"yielded\";var delegatingYield=!1;return\"*\"===state.tokens.next.value&&(delegatingYield=!0,advance(\"*\")),this.line!==startLine(state.tokens.next)&&state.inMoz()?state.option.asi||nolinebreak(this):((delegatingYield||\";\"!==state.tokens.next.id&&!state.option.asi&&!state.tokens.next.reach&&state.tokens.next.nud)&&(nobreaknonadjacent(state.tokens.curr,state.tokens.next),this.first=expression(10),\"(punctuator)\"!==this.first.type||\"=\"!==this.first.value||this.first.paren||state.option.boss||warningAt(\"W093\",this.first.line,this.first.character)),state.inMoz()&&\")\"!==state.tokens.next.id&&(prev.lbp>30||!prev.assign&&!isEndOfExpr()||\"yield\"===prev.id)&&error(\"E050\",this)),this})),stmt(\"throw\",function(){return nolinebreak(this),this.first=expression(20),reachable(this),this}).exps=!0,stmt(\"import\",function(){if(state.inES6()||warning(\"W119\",state.tokens.curr,\"import\",\"6\"),\"(string)\"===state.tokens.next.type)return advance(\"(string)\"),this;if(state.tokens.next.identifier){if(this.name=identifier(),state.funct[\"(scope)\"].addlabel(this.name,{type:\"const\",token:state.tokens.curr}),\",\"!==state.tokens.next.value)return advance(\"from\"),advance(\"(string)\"),this;advance(\",\")}if(\"*\"===state.tokens.next.id)advance(\"*\"),advance(\"as\"),state.tokens.next.identifier&&(this.name=identifier(),state.funct[\"(scope)\"].addlabel(this.name,{type:\"const\",token:state.tokens.curr}));else for(advance(\"{\");;){if(\"}\"===state.tokens.next.value){advance(\"}\");break}var importName;if(\"default\"===state.tokens.next.type?(importName=\"default\",advance(\"default\")):importName=identifier(),\"as\"===state.tokens.next.value&&(advance(\"as\"),importName=identifier()),state.funct[\"(scope)\"].addlabel(importName,{type:\"const\",token:state.tokens.curr}),\",\"!==state.tokens.next.value){if(\"}\"===state.tokens.next.value){advance(\"}\");break}error(\"E024\",state.tokens.next,state.tokens.next.value);break}advance(\",\")}return advance(\"from\"),advance(\"(string)\"),this}).exps=!0,stmt(\"export\",function(){var token,identifier,ok=!0;if(state.inES6()||(warning(\"W119\",state.tokens.curr,\"export\",\"6\"),ok=!1),state.funct[\"(scope)\"].block.isGlobal()||(error(\"E053\",state.tokens.curr),ok=!1),\"*\"===state.tokens.next.value)return advance(\"*\"),advance(\"from\"),advance(\"(string)\"),this;if(\"default\"===state.tokens.next.type){state.nameStack.set(state.tokens.next),advance(\"default\");var exportType=state.tokens.next.id;return(\"function\"===exportType||\"class\"===exportType)&&(this.block=!0),token=peek(),expression(10),identifier=token.value,this.block&&(state.funct[\"(scope)\"].addlabel(identifier,{type:exportType,token:token}),state.funct[\"(scope)\"].setExported(identifier,token)),this}if(\"{\"===state.tokens.next.value){advance(\"{\");for(var exportedTokens=[];;){if(state.tokens.next.identifier||error(\"E030\",state.tokens.next,state.tokens.next.value),advance(),exportedTokens.push(state.tokens.curr),\"as\"===state.tokens.next.value&&(advance(\"as\"),state.tokens.next.identifier||error(\"E030\",state.tokens.next,state.tokens.next.value),advance()),\",\"!==state.tokens.next.value){if(\"}\"===state.tokens.next.value){advance(\"}\");break}error(\"E024\",state.tokens.next,state.tokens.next.value);break}advance(\",\")}return\"from\"===state.tokens.next.value?(advance(\"from\"),advance(\"(string)\")):ok&&exportedTokens.forEach(function(token){state.funct[\"(scope)\"].setExported(token.value,token)}),this}if(\"var\"===state.tokens.next.id)advance(\"var\"),state.tokens.curr.fud({inexport:!0});else if(\"let\"===state.tokens.next.id)advance(\"let\"),state.tokens.curr.fud({inexport:!0});else if(\"const\"===state.tokens.next.id)advance(\"const\"),state.tokens.curr.fud({inexport:!0});else if(\"function\"===state.tokens.next.id)this.block=!0,advance(\"function\"),state.syntax[\"function\"].fud({inexport:!0});else if(\"class\"===state.tokens.next.id){this.block=!0,advance(\"class\");var classNameToken=state.tokens.next;state.syntax[\"class\"].fud(),state.funct[\"(scope)\"].setExported(classNameToken.value,classNameToken)}else error(\"E024\",state.tokens.next,state.tokens.next.value);return this}).exps=!0,FutureReservedWord(\"abstract\"),FutureReservedWord(\"boolean\"),FutureReservedWord(\"byte\"),FutureReservedWord(\"char\"),FutureReservedWord(\"class\",{es5:!0,nud:classdef}),FutureReservedWord(\"double\"),FutureReservedWord(\"enum\",{es5:!0}),FutureReservedWord(\"export\",{es5:!0}),FutureReservedWord(\"extends\",{es5:!0}),FutureReservedWord(\"final\"),FutureReservedWord(\"float\"),FutureReservedWord(\"goto\"),FutureReservedWord(\"implements\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"import\",{es5:!0}),FutureReservedWord(\"int\"),FutureReservedWord(\"interface\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"long\"),FutureReservedWord(\"native\"),FutureReservedWord(\"package\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"private\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"protected\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"public\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"short\"),FutureReservedWord(\"static\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"super\",{es5:!0}),FutureReservedWord(\"synchronized\"),FutureReservedWord(\"transient\"),FutureReservedWord(\"volatile\");var lookupBlockType=function(){var pn,pn1,prev,i=-1,bracketStack=0,ret={};checkPunctuators(state.tokens.curr,[\"[\",\"{\"])&&(bracketStack+=1);do{if(prev=-1===i?state.tokens.curr:pn,pn=-1===i?state.tokens.next:peek(i),pn1=peek(i+1),i+=1,checkPunctuators(pn,[\"[\",\"{\"])?bracketStack+=1:checkPunctuators(pn,[\"]\",\"}\"])&&(bracketStack-=1),1===bracketStack&&pn.identifier&&\"for\"===pn.value&&!checkPunctuator(prev,\".\")){ret.isCompArray=!0,ret.notJson=!0;break}if(0===bracketStack&&checkPunctuators(pn,[\"}\",\"]\"])){if(\"=\"===pn1.value){ret.isDestAssign=!0,ret.notJson=!0;break}if(\".\"===pn1.value){ret.notJson=!0;break}}checkPunctuator(pn,\";\")&&(ret.isBlock=!0,ret.notJson=!0)}while(bracketStack>0&&\"(end)\"!==pn.id);return ret},arrayComprehension=function(){function declare(v){var l=_current.variables.filter(function(elt){return elt.value===v?(elt.undef=!1,v):void 0}).length;return 0!==l}function use(v){var l=_current.variables.filter(function(elt){return elt.value!==v||elt.undef?void 0:(elt.unused===!0&&(elt.unused=!1),v)}).length;return 0===l}var _current,CompArray=function(){this.mode=\"use\",this.variables=[]},_carrays=[];return{stack:function(){_current=new CompArray,_carrays.push(_current)},unstack:function(){_current.variables.filter(function(v){v.unused&&warning(\"W098\",v.token,v.raw_text||v.value),v.undef&&state.funct[\"(scope)\"].block.use(v.value,v.token)}),_carrays.splice(-1,1),_current=_carrays[_carrays.length-1]},setState:function(s){_.contains([\"use\",\"define\",\"generate\",\"filter\"],s)&&(_current.mode=s)},check:function(v){return _current?_current&&\"use\"===_current.mode?(use(v)&&_current.variables.push({funct:state.funct,token:state.tokens.curr,value:v,undef:!0,unused:!1}),!0):_current&&\"define\"===_current.mode?(declare(v)||_current.variables.push({funct:state.funct,token:state.tokens.curr,value:v,undef:!1,unused:!0}),!0):_current&&\"generate\"===_current.mode?(state.funct[\"(scope)\"].block.use(v,state.tokens.curr),!0):_current&&\"filter\"===_current.mode?(use(v)&&state.funct[\"(scope)\"].block.use(v,state.tokens.curr),!0):!1:void 0}}},escapeRegex=function(str){return str.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")},itself=function(s,o,g){function each(obj,cb){obj&&(Array.isArray(obj)||\"object\"!=typeof obj||(obj=Object.keys(obj)),obj.forEach(cb))}var i,k,x,reIgnoreStr,reIgnore,optionKeys,newOptionObj={},newIgnoredObj={};o=_.clone(o),state.reset(),o&&o.scope?JSHINT.scope=o.scope:(JSHINT.errors=[],JSHINT.undefs=[],JSHINT.internals=[],JSHINT.blacklist={},JSHINT.scope=\"(main)\"),predefined=Object.create(null),combine(predefined,vars.ecmaIdentifiers[3]),combine(predefined,vars.reservedVars),combine(predefined,g||{}),declared=Object.create(null);var exported=Object.create(null);if(o)for(each(o.predef||null,function(item){var slice,prop;\"-\"===item[0]?(slice=item.slice(1),JSHINT.blacklist[slice]=slice,delete predefined[slice]):(prop=Object.getOwnPropertyDescriptor(o.predef,item),predefined[item]=prop?prop.value:!1)}),each(o.exported||null,function(item){exported[item]=!0}),delete o.predef,delete o.exported,optionKeys=Object.keys(o),x=0;optionKeys.length>x;x++)if(/^-W\\d{3}$/g.test(optionKeys[x]))newIgnoredObj[optionKeys[x].slice(1)]=!0;else{var optionKey=optionKeys[x];newOptionObj[optionKey]=o[optionKey],(\"esversion\"===optionKey&&5===o[optionKey]||\"es5\"===optionKey&&o[optionKey])&&warning(\"I003\"),\"newcap\"===optionKeys[x]&&o[optionKey]===!1&&(newOptionObj[\"(explicitNewcap)\"]=!0)}state.option=newOptionObj,state.ignored=newIgnoredObj,state.option.indent=state.option.indent||4,state.option.maxerr=state.option.maxerr||50,indent=1;var scopeManagerInst=scopeManager(state,predefined,exported,declared);if(scopeManagerInst.on(\"warning\",function(ev){warning.apply(null,[ev.code,ev.token].concat(ev.data))}),scopeManagerInst.on(\"error\",function(ev){error.apply(null,[ev.code,ev.token].concat(ev.data))}),state.funct=functor(\"(global)\",null,{\"(global)\":!0,\"(scope)\":scopeManagerInst,\"(comparray)\":arrayComprehension(),\"(metrics)\":createMetrics(state.tokens.next)}),functions=[state.funct],urls=[],stack=null,member={},membersOnly=null,inblock=!1,lookahead=[],!isString(s)&&!Array.isArray(s))return errorAt(\"E004\",0),!1;api={get isJSON(){return state.jsonMode},getOption:function(name){return state.option[name]||null},getCache:function(name){return state.cache[name]},setCache:function(name,value){state.cache[name]=value},warn:function(code,data){warningAt.apply(null,[code,data.line,data.char].concat(data.data))},on:function(names,listener){names.split(\" \").forEach(function(name){emitter.on(name,listener)}.bind(this))}},emitter.removeAllListeners(),(extraModules||[]).forEach(function(func){func(api)}),state.tokens.prev=state.tokens.curr=state.tokens.next=state.syntax[\"(begin)\"],o&&o.ignoreDelimiters&&(Array.isArray(o.ignoreDelimiters)||(o.ignoreDelimiters=[o.ignoreDelimiters]),o.ignoreDelimiters.forEach(function(delimiterPair){delimiterPair.start&&delimiterPair.end&&(reIgnoreStr=escapeRegex(delimiterPair.start)+\"[\\\\s\\\\S]*?\"+escapeRegex(delimiterPair.end),reIgnore=RegExp(reIgnoreStr,\"ig\"),s=s.replace(reIgnore,function(match){return match.replace(/./g,\" \")}))})),lex=new Lexer(s),lex.on(\"warning\",function(ev){warningAt.apply(null,[ev.code,ev.line,ev.character].concat(ev.data))}),lex.on(\"error\",function(ev){errorAt.apply(null,[ev.code,ev.line,ev.character].concat(ev.data))}),lex.on(\"fatal\",function(ev){quit(\"E041\",ev.line,ev.from)}),lex.on(\"Identifier\",function(ev){emitter.emit(\"Identifier\",ev)}),lex.on(\"String\",function(ev){emitter.emit(\"String\",ev)}),lex.on(\"Number\",function(ev){emitter.emit(\"Number\",ev)}),lex.start();for(var name in o)_.has(o,name)&&checkOption(name,state.tokens.curr);assume(),combine(predefined,g||{}),comma.first=!0;try{switch(advance(),state.tokens.next.id){case\"{\":case\"[\":destructuringAssignOrJsonValue();break;default:directives(),state.directive[\"use strict\"]&&\"global\"!==state.option.strict&&warning(\"W097\",state.tokens.prev),statements()}\"(end)\"!==state.tokens.next.id&&quit(\"E041\",state.tokens.curr.line),state.funct[\"(scope)\"].unstack()}catch(err){if(!err||\"JSHintError\"!==err.name)throw err;var nt=state.tokens.next||{};JSHINT.errors.push({scope:\"(main)\",raw:err.raw,code:err.code,reason:err.message,line:err.line||nt.line,character:err.character||nt.from},null)}if(\"(main)\"===JSHINT.scope)for(o=o||{},i=0;JSHINT.internals.length>i;i+=1)k=JSHINT.internals[i],o.scope=k.elem,itself(k.value,o,g);return 0===JSHINT.errors.length};return itself.addModule=function(func){extraModules.push(func)},itself.addModule(style.register),itself.data=function(){var fu,f,i,j,n,globals,data={functions:[],options:state.option};itself.errors.length&&(data.errors=itself.errors),state.jsonMode&&(data.json=!0);var impliedGlobals=state.funct[\"(scope)\"].getImpliedGlobals();for(impliedGlobals.length>0&&(data.implieds=impliedGlobals),urls.length>0&&(data.urls=urls),globals=state.funct[\"(scope)\"].getUsedOrDefinedGlobals(),globals.length>0&&(data.globals=globals),i=1;functions.length>i;i+=1){for(f=functions[i],fu={},j=0;functionicity.length>j;j+=1)fu[functionicity[j]]=[];for(j=0;functionicity.length>j;j+=1)0===fu[functionicity[j]].length&&delete fu[functionicity[j]];fu.name=f[\"(name)\"],fu.param=f[\"(params)\"],fu.line=f[\"(line)\"],fu.character=f[\"(character)\"],fu.last=f[\"(last)\"],fu.lastcharacter=f[\"(lastcharacter)\"],fu.metrics={complexity:f[\"(metrics)\"].ComplexityCount,parameters:f[\"(metrics)\"].arity,statements:f[\"(metrics)\"].statementCount},data.functions.push(fu)}var unuseds=state.funct[\"(scope)\"].getUnuseds();unuseds.length>0&&(data.unused=unuseds);for(n in member)if(\"number\"==typeof member[n]){data.member=member;break}return data},itself.jshint=itself,itself}();\"object\"==typeof exports&&exports&&(exports.JSHINT=JSHINT)},{\"../lodash\":\"/node_modules/jshint/lodash.js\",\"./lex.js\":\"/node_modules/jshint/src/lex.js\",\"./messages.js\":\"/node_modules/jshint/src/messages.js\",\"./options.js\":\"/node_modules/jshint/src/options.js\",\"./reg.js\":\"/node_modules/jshint/src/reg.js\",\"./scope-manager.js\":\"/node_modules/jshint/src/scope-manager.js\",\"./state.js\":\"/node_modules/jshint/src/state.js\",\"./style.js\":\"/node_modules/jshint/src/style.js\",\"./vars.js\":\"/node_modules/jshint/src/vars.js\",events:\"/node_modules/browserify/node_modules/events/events.js\"}],\"/node_modules/jshint/src/lex.js\":[function(_dereq_,module,exports){\"use strict\";function asyncTrigger(){var _checks=[];return{push:function(fn){_checks.push(fn)},check:function(){for(var check=0;_checks.length>check;++check)_checks[check]();_checks.splice(0,_checks.length)}}}function Lexer(source){var lines=source;\"string\"==typeof lines&&(lines=lines.replace(/\\r\\n/g,\"\\n\").replace(/\\r/g,\"\\n\").split(\"\\n\")),lines[0]&&\"#!\"===lines[0].substr(0,2)&&(-1!==lines[0].indexOf(\"node\")&&(state.option.node=!0),lines[0]=\"\"),this.emitter=new events.EventEmitter,this.source=source,this.setLines(lines),this.prereg=!0,this.line=0,this.char=1,this.from=1,this.input=\"\",this.inComment=!1,this.context=[],this.templateStarts=[];for(var i=0;state.option.indent>i;i+=1)state.tab+=\" \";this.ignoreLinterErrors=!1}var _=_dereq_(\"../lodash\"),events=_dereq_(\"events\"),reg=_dereq_(\"./reg.js\"),state=_dereq_(\"./state.js\").state,unicodeData=_dereq_(\"../data/ascii-identifier-data.js\"),asciiIdentifierStartTable=unicodeData.asciiIdentifierStartTable,asciiIdentifierPartTable=unicodeData.asciiIdentifierPartTable,Token={Identifier:1,Punctuator:2,NumericLiteral:3,StringLiteral:4,Comment:5,Keyword:6,NullLiteral:7,BooleanLiteral:8,RegExp:9,TemplateHead:10,TemplateMiddle:11,TemplateTail:12,NoSubstTemplate:13},Context={Block:1,Template:2};Lexer.prototype={_lines:[],inContext:function(ctxType){return this.context.length>0&&this.context[this.context.length-1].type===ctxType},pushContext:function(ctxType){this.context.push({type:ctxType})},popContext:function(){return this.context.pop()},isContext:function(context){return this.context.length>0&&this.context[this.context.length-1]===context},currentContext:function(){return this.context.length>0&&this.context[this.context.length-1]},getLines:function(){return this._lines=state.lines,this._lines},setLines:function(val){this._lines=val,state.lines=this._lines},peek:function(i){return this.input.charAt(i||0)},skip:function(i){i=i||1,this.char+=i,this.input=this.input.slice(i)},on:function(names,listener){names.split(\" \").forEach(function(name){this.emitter.on(name,listener)}.bind(this))},trigger:function(){this.emitter.emit.apply(this.emitter,Array.prototype.slice.call(arguments))},triggerAsync:function(type,args,checks,fn){checks.push(function(){fn()&&this.trigger(type,args)}.bind(this))},scanPunctuator:function(){var ch2,ch3,ch4,ch1=this.peek();switch(ch1){case\".\":if(/^[0-9]$/.test(this.peek(1)))return null;if(\".\"===this.peek(1)&&\".\"===this.peek(2))return{type:Token.Punctuator,value:\"...\"};case\"(\":case\")\":case\";\":case\",\":case\"[\":case\"]\":case\":\":case\"~\":case\"?\":return{type:Token.Punctuator,value:ch1};case\"{\":return this.pushContext(Context.Block),{type:Token.Punctuator,value:ch1};case\"}\":return this.inContext(Context.Block)&&this.popContext(),{type:Token.Punctuator,value:ch1};case\"#\":return{type:Token.Punctuator,value:ch1};case\"\":return null}return ch2=this.peek(1),ch3=this.peek(2),ch4=this.peek(3),\">\"===ch1&&\">\"===ch2&&\">\"===ch3&&\"=\"===ch4?{type:Token.Punctuator,value:\">>>=\"}:\"=\"===ch1&&\"=\"===ch2&&\"=\"===ch3?{type:Token.Punctuator,value:\"===\"}:\"!\"===ch1&&\"=\"===ch2&&\"=\"===ch3?{type:Token.Punctuator,value:\"!==\"}:\">\"===ch1&&\">\"===ch2&&\">\"===ch3?{type:Token.Punctuator,value:\">>>\"}:\"<\"===ch1&&\"<\"===ch2&&\"=\"===ch3?{type:Token.Punctuator,value:\"<<=\"}:\">\"===ch1&&\">\"===ch2&&\"=\"===ch3?{type:Token.Punctuator,value:\">>=\"}:\"=\"===ch1&&\">\"===ch2?{type:Token.Punctuator,value:ch1+ch2}:ch1===ch2&&\"+-<>&|\".indexOf(ch1)>=0?{type:Token.Punctuator,value:ch1+ch2}:\"<>=!+-*%&|^\".indexOf(ch1)>=0?\"=\"===ch2?{type:Token.Punctuator,value:ch1+ch2}:{type:Token.Punctuator,value:ch1}:\"/\"===ch1?\"=\"===ch2?{type:Token.Punctuator,value:\"/=\"}:{type:Token.Punctuator,value:\"/\"}:null},scanComments:function(){function commentToken(label,body,opt){var special=[\"jshint\",\"jslint\",\"members\",\"member\",\"globals\",\"global\",\"exported\"],isSpecial=!1,value=label+body,commentType=\"plain\";return opt=opt||{},opt.isMultiline&&(value+=\"*/\"),body=body.replace(/\\n/g,\" \"),\"/*\"===label&®.fallsThrough.test(body)&&(isSpecial=!0,commentType=\"falls through\"),special.forEach(function(str){if(!isSpecial&&(\"//\"!==label||\"jshint\"===str)&&(\" \"===body.charAt(str.length)&&body.substr(0,str.length)===str&&(isSpecial=!0,label+=str,body=body.substr(str.length)),isSpecial||\" \"!==body.charAt(0)||\" \"!==body.charAt(str.length+1)||body.substr(1,str.length)!==str||(isSpecial=!0,label=label+\" \"+str,body=body.substr(str.length+1)),isSpecial))switch(str){case\"member\":commentType=\"members\";break;case\"global\":commentType=\"globals\";break;default:var options=body.split(\":\").map(function(v){return v.replace(/^\\s+/,\"\").replace(/\\s+$/,\"\")});if(2===options.length)switch(options[0]){case\"ignore\":switch(options[1]){case\"start\":self.ignoringLinterErrors=!0,isSpecial=!1;break;case\"end\":self.ignoringLinterErrors=!1,isSpecial=!1}}commentType=str}}),{type:Token.Comment,commentType:commentType,value:value,body:body,isSpecial:isSpecial,isMultiline:opt.isMultiline||!1,isMalformed:opt.isMalformed||!1}}var ch1=this.peek(),ch2=this.peek(1),rest=this.input.substr(2),startLine=this.line,startChar=this.char,self=this;if(\"*\"===ch1&&\"/\"===ch2)return this.trigger(\"error\",{code:\"E018\",line:startLine,character:startChar}),this.skip(2),null;if(\"/\"!==ch1||\"*\"!==ch2&&\"/\"!==ch2)return null;if(\"/\"===ch2)return this.skip(this.input.length),commentToken(\"//\",rest);var body=\"\";if(\"*\"===ch2){for(this.inComment=!0,this.skip(2);\"*\"!==this.peek()||\"/\"!==this.peek(1);)if(\"\"===this.peek()){if(body+=\"\\n\",!this.nextLine())return this.trigger(\"error\",{code:\"E017\",line:startLine,character:startChar}),this.inComment=!1,commentToken(\"/*\",body,{isMultiline:!0,isMalformed:!0})}else body+=this.peek(),this.skip();return this.skip(2),this.inComment=!1,commentToken(\"/*\",body,{isMultiline:!0})}},scanKeyword:function(){var result=/^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input),keywords=[\"if\",\"in\",\"do\",\"var\",\"for\",\"new\",\"try\",\"let\",\"this\",\"else\",\"case\",\"void\",\"with\",\"enum\",\"while\",\"break\",\"catch\",\"throw\",\"const\",\"yield\",\"class\",\"super\",\"return\",\"typeof\",\"delete\",\"switch\",\"export\",\"import\",\"default\",\"finally\",\"extends\",\"function\",\"continue\",\"debugger\",\"instanceof\"];return result&&keywords.indexOf(result[0])>=0?{type:Token.Keyword,value:result[0]}:null},scanIdentifier:function(){function isNonAsciiIdentifierStart(code){return code>256}function isNonAsciiIdentifierPart(code){return code>256}function isHexDigit(str){return/^[0-9a-fA-F]$/.test(str)}function removeEscapeSequences(id){return id.replace(/\\\\u([0-9a-fA-F]{4})/g,function(m0,codepoint){return String.fromCharCode(parseInt(codepoint,16))})}var type,char,id=\"\",index=0,readUnicodeEscapeSequence=function(){if(index+=1,\"u\"!==this.peek(index))return null;var code,ch1=this.peek(index+1),ch2=this.peek(index+2),ch3=this.peek(index+3),ch4=this.peek(index+4);return isHexDigit(ch1)&&isHexDigit(ch2)&&isHexDigit(ch3)&&isHexDigit(ch4)?(code=parseInt(ch1+ch2+ch3+ch4,16),asciiIdentifierPartTable[code]||isNonAsciiIdentifierPart(code)?(index+=5,\"\\\\u\"+ch1+ch2+ch3+ch4):null):null}.bind(this),getIdentifierStart=function(){var chr=this.peek(index),code=chr.charCodeAt(0);return 92===code?readUnicodeEscapeSequence():128>code?asciiIdentifierStartTable[code]?(index+=1,chr):null:isNonAsciiIdentifierStart(code)?(index+=1,chr):null}.bind(this),getIdentifierPart=function(){var chr=this.peek(index),code=chr.charCodeAt(0);return 92===code?readUnicodeEscapeSequence():128>code?asciiIdentifierPartTable[code]?(index+=1,chr):null:isNonAsciiIdentifierPart(code)?(index+=1,chr):null}.bind(this);if(char=getIdentifierStart(),null===char)return null;for(id=char;char=getIdentifierPart(),null!==char;)id+=char;switch(id){case\"true\":case\"false\":type=Token.BooleanLiteral;break;case\"null\":type=Token.NullLiteral;break;default:type=Token.Identifier}return{type:type,value:removeEscapeSequences(id),text:id,tokenLength:id.length}},scanNumericLiteral:function(){function isDecimalDigit(str){return/^[0-9]$/.test(str)}function isOctalDigit(str){return/^[0-7]$/.test(str)}function isBinaryDigit(str){return/^[01]$/.test(str)}function isHexDigit(str){return/^[0-9a-fA-F]$/.test(str)}function isIdentifierStart(ch){return\"$\"===ch||\"_\"===ch||\"\\\\\"===ch||ch>=\"a\"&&\"z\">=ch||ch>=\"A\"&&\"Z\">=ch}var bad,index=0,value=\"\",length=this.input.length,char=this.peek(index),isAllowedDigit=isDecimalDigit,base=10,isLegacy=!1;if(\".\"!==char&&!isDecimalDigit(char))return null;if(\".\"!==char){for(value=this.peek(index),index+=1,char=this.peek(index),\"0\"===value&&((\"x\"===char||\"X\"===char)&&(isAllowedDigit=isHexDigit,base=16,index+=1,value+=char),(\"o\"===char||\"O\"===char)&&(isAllowedDigit=isOctalDigit,base=8,state.inES6(!0)||this.trigger(\"warning\",{code:\"W119\",line:this.line,character:this.char,data:[\"Octal integer literal\",\"6\"]}),index+=1,value+=char),(\"b\"===char||\"B\"===char)&&(isAllowedDigit=isBinaryDigit,base=2,state.inES6(!0)||this.trigger(\"warning\",{code:\"W119\",line:this.line,character:this.char,data:[\"Binary integer literal\",\"6\"]}),index+=1,value+=char),isOctalDigit(char)&&(isAllowedDigit=isOctalDigit,base=8,isLegacy=!0,bad=!1,index+=1,value+=char),!isOctalDigit(char)&&isDecimalDigit(char)&&(index+=1,value+=char));length>index;){if(char=this.peek(index),isLegacy&&isDecimalDigit(char))bad=!0;else if(!isAllowedDigit(char))break;value+=char,index+=1}if(isAllowedDigit!==isDecimalDigit)return!isLegacy&&2>=value.length?{type:Token.NumericLiteral,value:value,isMalformed:!0}:length>index&&(char=this.peek(index),isIdentifierStart(char))?null:{type:Token.NumericLiteral,value:value,base:base,isLegacy:isLegacy,isMalformed:!1}}if(\".\"===char)for(value+=char,index+=1;length>index&&(char=this.peek(index),isDecimalDigit(char));)value+=char,index+=1;if(\"e\"===char||\"E\"===char){if(value+=char,index+=1,char=this.peek(index),(\"+\"===char||\"-\"===char)&&(value+=this.peek(index),index+=1),char=this.peek(index),!isDecimalDigit(char))return null;for(value+=char,index+=1;length>index&&(char=this.peek(index),isDecimalDigit(char));)value+=char,index+=1}return length>index&&(char=this.peek(index),isIdentifierStart(char))?null:{type:Token.NumericLiteral,value:value,base:base,isMalformed:!isFinite(value)}},scanEscapeSequence:function(checks){var allowNewLine=!1,jump=1;this.skip();var char=this.peek();switch(char){case\"'\":this.triggerAsync(\"warning\",{code:\"W114\",line:this.line,character:this.char,data:[\"\\\\'\"]},checks,function(){return state.jsonMode});break;case\"b\":char=\"\\\\b\";break;case\"f\":char=\"\\\\f\";break;case\"n\":char=\"\\\\n\";break;case\"r\":char=\"\\\\r\";break;case\"t\":char=\"\\\\t\";break;case\"0\":char=\"\\\\0\";var n=parseInt(this.peek(1),10);this.triggerAsync(\"warning\",{code:\"W115\",line:this.line,character:this.char},checks,function(){return n>=0&&7>=n&&state.isStrict()});break;case\"u\":var hexCode=this.input.substr(1,4),code=parseInt(hexCode,16);isNaN(code)&&this.trigger(\"warning\",{code:\"W052\",line:this.line,character:this.char,data:[\"u\"+hexCode]}),char=String.fromCharCode(code),jump=5;break;case\"v\":this.triggerAsync(\"warning\",{code:\"W114\",line:this.line,character:this.char,data:[\"\\\\v\"]},checks,function(){return state.jsonMode}),char=\"\u000b\";break;case\"x\":var x=parseInt(this.input.substr(1,2),16);this.triggerAsync(\"warning\",{code:\"W114\",line:this.line,character:this.char,data:[\"\\\\x-\"]},checks,function(){return state.jsonMode}),char=String.fromCharCode(x),jump=3;break;case\"\\\\\":char=\"\\\\\\\\\";break;case'\"':char='\\\\\"';break;case\"/\":break;case\"\":allowNewLine=!0,char=\"\"}return{\"char\":char,jump:jump,allowNewLine:allowNewLine}},scanTemplateLiteral:function(checks){var tokenType,ch,value=\"\",startLine=this.line,startChar=this.char,depth=this.templateStarts.length;if(!state.inES6(!0))return null;if(\"`\"===this.peek())tokenType=Token.TemplateHead,this.templateStarts.push({line:this.line,\"char\":this.char}),depth=this.templateStarts.length,this.skip(1),this.pushContext(Context.Template);else{if(!this.inContext(Context.Template)||\"}\"!==this.peek())return null;tokenType=Token.TemplateMiddle}for(;\"`\"!==this.peek();){for(;\"\"===(ch=this.peek());)if(value+=\"\\n\",!this.nextLine()){var startPos=this.templateStarts.pop();return this.trigger(\"error\",{code:\"E052\",line:startPos.line,character:startPos.char}),{type:tokenType,value:value,startLine:startLine,startChar:startChar,isUnclosed:!0,depth:depth,context:this.popContext()}}if(\"$\"===ch&&\"{\"===this.peek(1))return value+=\"${\",this.skip(2),{type:tokenType,value:value,startLine:startLine,startChar:startChar,isUnclosed:!1,depth:depth,context:this.currentContext()};\nif(\"\\\\\"===ch){var escape=this.scanEscapeSequence(checks);value+=escape.char,this.skip(escape.jump)}else\"`\"!==ch&&(value+=ch,this.skip(1))}return tokenType=tokenType===Token.TemplateHead?Token.NoSubstTemplate:Token.TemplateTail,this.skip(1),this.templateStarts.pop(),{type:tokenType,value:value,startLine:startLine,startChar:startChar,isUnclosed:!1,depth:depth,context:this.popContext()}},scanStringLiteral:function(checks){var quote=this.peek();if('\"'!==quote&&\"'\"!==quote)return null;this.triggerAsync(\"warning\",{code:\"W108\",line:this.line,character:this.char},checks,function(){return state.jsonMode&&'\"'!==quote});var value=\"\",startLine=this.line,startChar=this.char,allowNewLine=!1;for(this.skip();this.peek()!==quote;)if(\"\"===this.peek()){if(allowNewLine?(allowNewLine=!1,this.triggerAsync(\"warning\",{code:\"W043\",line:this.line,character:this.char},checks,function(){return!state.option.multistr}),this.triggerAsync(\"warning\",{code:\"W042\",line:this.line,character:this.char},checks,function(){return state.jsonMode&&state.option.multistr})):this.trigger(\"warning\",{code:\"W112\",line:this.line,character:this.char}),!this.nextLine())return this.trigger(\"error\",{code:\"E029\",line:startLine,character:startChar}),{type:Token.StringLiteral,value:value,startLine:startLine,startChar:startChar,isUnclosed:!0,quote:quote}}else{allowNewLine=!1;var char=this.peek(),jump=1;if(\" \">char&&this.trigger(\"warning\",{code:\"W113\",line:this.line,character:this.char,data:[\"\"]}),\"\\\\\"===char){var parsed=this.scanEscapeSequence(checks);char=parsed.char,jump=parsed.jump,allowNewLine=parsed.allowNewLine}value+=char,this.skip(jump)}return this.skip(),{type:Token.StringLiteral,value:value,startLine:startLine,startChar:startChar,isUnclosed:!1,quote:quote}},scanRegExp:function(){var terminated,index=0,length=this.input.length,char=this.peek(),value=char,body=\"\",flags=[],malformed=!1,isCharSet=!1,scanUnexpectedChars=function(){\" \">char&&(malformed=!0,this.trigger(\"warning\",{code:\"W048\",line:this.line,character:this.char})),\"<\"===char&&(malformed=!0,this.trigger(\"warning\",{code:\"W049\",line:this.line,character:this.char,data:[char]}))}.bind(this);if(!this.prereg||\"/\"!==char)return null;for(index+=1,terminated=!1;length>index;)if(char=this.peek(index),value+=char,body+=char,isCharSet)\"]\"===char&&(\"\\\\\"!==this.peek(index-1)||\"\\\\\"===this.peek(index-2))&&(isCharSet=!1),\"\\\\\"===char&&(index+=1,char=this.peek(index),body+=char,value+=char,scanUnexpectedChars()),index+=1;else{if(\"\\\\\"===char){if(index+=1,char=this.peek(index),body+=char,value+=char,scanUnexpectedChars(),\"/\"===char){index+=1;continue}if(\"[\"===char){index+=1;continue}}if(\"[\"!==char){if(\"/\"===char){body=body.substr(0,body.length-1),terminated=!0,index+=1;break}index+=1}else isCharSet=!0,index+=1}if(!terminated)return this.trigger(\"error\",{code:\"E015\",line:this.line,character:this.from}),void this.trigger(\"fatal\",{line:this.line,from:this.from});for(;length>index&&(char=this.peek(index),/[gim]/.test(char));)flags.push(char),value+=char,index+=1;try{RegExp(body,flags.join(\"\"))}catch(err){malformed=!0,this.trigger(\"error\",{code:\"E016\",line:this.line,character:this.char,data:[err.message]})}return{type:Token.RegExp,value:value,flags:flags,isMalformed:malformed}},scanNonBreakingSpaces:function(){return state.option.nonbsp?this.input.search(/(\\u00A0)/):-1},scanUnsafeChars:function(){return this.input.search(reg.unsafeChars)},next:function(checks){this.from=this.char;var start;if(/\\s/.test(this.peek()))for(start=this.char;/\\s/.test(this.peek());)this.from+=1,this.skip();var match=this.scanComments()||this.scanStringLiteral(checks)||this.scanTemplateLiteral(checks);return match?match:(match=this.scanRegExp()||this.scanPunctuator()||this.scanKeyword()||this.scanIdentifier()||this.scanNumericLiteral(),match?(this.skip(match.tokenLength||match.value.length),match):null)},nextLine:function(){var char;if(this.line>=this.getLines().length)return!1;this.input=this.getLines()[this.line],this.line+=1,this.char=1,this.from=1;var inputTrimmed=this.input.trim(),startsWith=function(){return _.some(arguments,function(prefix){return 0===inputTrimmed.indexOf(prefix)})},endsWith=function(){return _.some(arguments,function(suffix){return-1!==inputTrimmed.indexOf(suffix,inputTrimmed.length-suffix.length)})};if(this.ignoringLinterErrors===!0&&(startsWith(\"/*\",\"//\")||this.inComment&&endsWith(\"*/\")||(this.input=\"\")),char=this.scanNonBreakingSpaces(),char>=0&&this.trigger(\"warning\",{code:\"W125\",line:this.line,character:char+1}),this.input=this.input.replace(/\\t/g,state.tab),char=this.scanUnsafeChars(),char>=0&&this.trigger(\"warning\",{code:\"W100\",line:this.line,character:char}),!this.ignoringLinterErrors&&state.option.maxlen&&state.option.maxlen=0;--i){var scopeLabels=_scopeStack[i][\"(labels)\"];if(scopeLabels[labelName])return scopeLabels}}function usedSoFarInCurrentFunction(labelName){for(var i=_scopeStack.length-1;i>=0;i--){var current=_scopeStack[i];if(current[\"(usages)\"][labelName])return current[\"(usages)\"][labelName];if(current===_currentFunctBody)break}return!1}function _checkOuterShadow(labelName,token){if(\"outer\"===state.option.shadow)for(var isGlobal=\"global\"===_currentFunctBody[\"(type)\"],isNewFunction=\"functionparams\"===_current[\"(type)\"],outsideCurrentFunction=!isGlobal,i=0;_scopeStack.length>i;i++){var stackItem=_scopeStack[i];isNewFunction||_scopeStack[i+1]!==_currentFunctBody||(outsideCurrentFunction=!1),outsideCurrentFunction&&stackItem[\"(labels)\"][labelName]&&warning(\"W123\",token,labelName),stackItem[\"(breakLabels)\"][labelName]&&warning(\"W123\",token,labelName)}}function _latedefWarning(type,labelName,token){state.option.latedef&&(state.option.latedef===!0&&\"function\"===type||\"function\"!==type)&&warning(\"W003\",token,labelName)}var _current,_scopeStack=[];_newScope(\"global\"),_current[\"(predefined)\"]=predefined;var _currentFunctBody=_current,usedPredefinedAndGlobals=Object.create(null),impliedGlobals=Object.create(null),unuseds=[],emitter=new events.EventEmitter,_getUnusedOption=function(unused_opt){return void 0===unused_opt&&(unused_opt=state.option.unused),unused_opt===!0&&(unused_opt=\"last-param\"),unused_opt},_warnUnused=function(name,tkn,type,unused_opt){var line=tkn.line,chr=tkn.from,raw_name=tkn.raw_text||name;unused_opt=_getUnusedOption(unused_opt);var warnable_types={vars:[\"var\"],\"last-param\":[\"var\",\"param\"],strict:[\"var\",\"param\",\"last-param\"]};unused_opt&&warnable_types[unused_opt]&&-1!==warnable_types[unused_opt].indexOf(type)&&warning(\"W098\",{line:line,from:chr},raw_name),(unused_opt||\"var\"===type)&&unuseds.push({name:name,line:line,character:chr})},scopeManagerInst={on:function(names,listener){names.split(\" \").forEach(function(name){emitter.on(name,listener)})},isPredefined:function(labelName){return!this.has(labelName)&&_.has(_scopeStack[0][\"(predefined)\"],labelName)},stack:function(type){var previousScope=_current;_newScope(type),type||\"functionparams\"!==previousScope[\"(type)\"]||(_current[\"(isFuncBody)\"]=!0,_current[\"(context)\"]=_currentFunctBody,_currentFunctBody=_current)},unstack:function(){var i,j,subScope=_scopeStack.length>1?_scopeStack[_scopeStack.length-2]:null,isUnstackingFunctionBody=_current===_currentFunctBody,isUnstackingFunctionParams=\"functionparams\"===_current[\"(type)\"],isUnstackingFunctionOuter=\"functionouter\"===_current[\"(type)\"],currentUsages=_current[\"(usages)\"],currentLabels=_current[\"(labels)\"],usedLabelNameList=Object.keys(currentUsages);for(currentUsages.__proto__&&-1===usedLabelNameList.indexOf(\"__proto__\")&&usedLabelNameList.push(\"__proto__\"),i=0;usedLabelNameList.length>i;i++){var usedLabelName=usedLabelNameList[i],usage=currentUsages[usedLabelName],usedLabel=currentLabels[usedLabelName];if(usedLabel){var usedLabelType=usedLabel[\"(type)\"];if(usedLabel[\"(useOutsideOfScope)\"]&&!state.option.funcscope){var usedTokens=usage[\"(tokens)\"];if(usedTokens)for(j=0;usedTokens.length>j;j++)usedLabel[\"(function)\"]===usedTokens[j][\"(function)\"]&&error(\"W038\",usedTokens[j],usedLabelName)}if(_current[\"(labels)\"][usedLabelName][\"(unused)\"]=!1,\"const\"===usedLabelType&&usage[\"(modified)\"])for(j=0;usage[\"(modified)\"].length>j;j++)error(\"E013\",usage[\"(modified)\"][j],usedLabelName);if((\"function\"===usedLabelType||\"class\"===usedLabelType)&&usage[\"(reassigned)\"])for(j=0;usage[\"(reassigned)\"].length>j;j++)error(\"W021\",usage[\"(reassigned)\"][j],usedLabelName,usedLabelType)}else if(isUnstackingFunctionOuter&&(state.funct[\"(isCapturing)\"]=!0),subScope)if(subScope[\"(usages)\"][usedLabelName]){var subScopeUsage=subScope[\"(usages)\"][usedLabelName];subScopeUsage[\"(modified)\"]=subScopeUsage[\"(modified)\"].concat(usage[\"(modified)\"]),subScopeUsage[\"(tokens)\"]=subScopeUsage[\"(tokens)\"].concat(usage[\"(tokens)\"]),subScopeUsage[\"(reassigned)\"]=subScopeUsage[\"(reassigned)\"].concat(usage[\"(reassigned)\"]),subScopeUsage[\"(onlyUsedSubFunction)\"]=!1}else subScope[\"(usages)\"][usedLabelName]=usage,isUnstackingFunctionBody&&(subScope[\"(usages)\"][usedLabelName][\"(onlyUsedSubFunction)\"]=!0);else if(\"boolean\"==typeof _current[\"(predefined)\"][usedLabelName]){if(delete declared[usedLabelName],usedPredefinedAndGlobals[usedLabelName]=marker,_current[\"(predefined)\"][usedLabelName]===!1&&usage[\"(reassigned)\"])for(j=0;usage[\"(reassigned)\"].length>j;j++)warning(\"W020\",usage[\"(reassigned)\"][j])}else if(usage[\"(tokens)\"])for(j=0;usage[\"(tokens)\"].length>j;j++){var undefinedToken=usage[\"(tokens)\"][j];undefinedToken.forgiveUndef||(state.option.undef&&!undefinedToken.ignoreUndef&&warning(\"W117\",undefinedToken,usedLabelName),impliedGlobals[usedLabelName]?impliedGlobals[usedLabelName].line.push(undefinedToken.line):impliedGlobals[usedLabelName]={name:usedLabelName,line:[undefinedToken.line]})}}if(subScope||Object.keys(declared).forEach(function(labelNotUsed){_warnUnused(labelNotUsed,declared[labelNotUsed],\"var\")}),subScope&&!isUnstackingFunctionBody&&!isUnstackingFunctionParams&&!isUnstackingFunctionOuter){var labelNames=Object.keys(currentLabels);for(i=0;labelNames.length>i;i++){var defLabelName=labelNames[i];currentLabels[defLabelName][\"(blockscoped)\"]||\"exception\"===currentLabels[defLabelName][\"(type)\"]||this.funct.has(defLabelName,{excludeCurrent:!0})||(subScope[\"(labels)\"][defLabelName]=currentLabels[defLabelName],\"global\"!==_currentFunctBody[\"(type)\"]&&(subScope[\"(labels)\"][defLabelName][\"(useOutsideOfScope)\"]=!0),delete currentLabels[defLabelName])}}_checkForUnused(),_scopeStack.pop(),isUnstackingFunctionBody&&(_currentFunctBody=_scopeStack[_.findLastIndex(_scopeStack,function(scope){return scope[\"(isFuncBody)\"]||\"global\"===scope[\"(type)\"]})]),_current=subScope},addParam:function(labelName,token,type){if(type=type||\"param\",\"exception\"===type){var previouslyDefinedLabelType=this.funct.labeltype(labelName);previouslyDefinedLabelType&&\"exception\"!==previouslyDefinedLabelType&&(state.option.node||warning(\"W002\",state.tokens.next,labelName))}if(_.has(_current[\"(labels)\"],labelName)?_current[\"(labels)\"][labelName].duplicated=!0:(_checkOuterShadow(labelName,token,type),_current[\"(labels)\"][labelName]={\"(type)\":type,\"(token)\":token,\"(unused)\":!0},_current[\"(params)\"].push(labelName)),_.has(_current[\"(usages)\"],labelName)){var usage=_current[\"(usages)\"][labelName];usage[\"(onlyUsedSubFunction)\"]?_latedefWarning(type,labelName,token):warning(\"E056\",token,labelName,type)}},validateParams:function(){if(\"global\"!==_currentFunctBody[\"(type)\"]){var isStrict=state.isStrict(),currentFunctParamScope=_currentFunctBody[\"(parent)\"];currentFunctParamScope[\"(params)\"]&¤tFunctParamScope[\"(params)\"].forEach(function(labelName){var label=currentFunctParamScope[\"(labels)\"][labelName];label&&label.duplicated&&(isStrict?warning(\"E011\",label[\"(token)\"],labelName):state.option.shadow!==!0&&warning(\"W004\",label[\"(token)\"],labelName))})}},getUsedOrDefinedGlobals:function(){var list=Object.keys(usedPredefinedAndGlobals);return usedPredefinedAndGlobals.__proto__===marker&&-1===list.indexOf(\"__proto__\")&&list.push(\"__proto__\"),list},getImpliedGlobals:function(){var values=_.values(impliedGlobals),hasProto=!1;return impliedGlobals.__proto__&&(hasProto=values.some(function(value){return\"__proto__\"===value.name}),hasProto||values.push(impliedGlobals.__proto__)),values},getUnuseds:function(){return unuseds},has:function(labelName){return Boolean(_getLabel(labelName))},labeltype:function(labelName){var scopeLabels=_getLabel(labelName);return scopeLabels?scopeLabels[labelName][\"(type)\"]:null},addExported:function(labelName){var globalLabels=_scopeStack[0][\"(labels)\"];if(_.has(declared,labelName))delete declared[labelName];else if(_.has(globalLabels,labelName))globalLabels[labelName][\"(unused)\"]=!1;else{for(var i=1;_scopeStack.length>i;i++){var scope=_scopeStack[i];if(scope[\"(type)\"])break;if(_.has(scope[\"(labels)\"],labelName)&&!scope[\"(labels)\"][labelName][\"(blockscoped)\"])return scope[\"(labels)\"][labelName][\"(unused)\"]=!1,void 0}exported[labelName]=!0}},setExported:function(labelName,token){this.block.use(labelName,token)\n},addlabel:function(labelName,opts){var type=opts.type,token=opts.token,isblockscoped=\"let\"===type||\"const\"===type||\"class\"===type,isexported=\"global\"===(isblockscoped?_current:_currentFunctBody)[\"(type)\"]&&_.has(exported,labelName);if(_checkOuterShadow(labelName,token,type),isblockscoped){var declaredInCurrentScope=_current[\"(labels)\"][labelName];if(declaredInCurrentScope||_current!==_currentFunctBody||\"global\"===_current[\"(type)\"]||(declaredInCurrentScope=!!_currentFunctBody[\"(parent)\"][\"(labels)\"][labelName]),!declaredInCurrentScope&&_current[\"(usages)\"][labelName]){var usage=_current[\"(usages)\"][labelName];usage[\"(onlyUsedSubFunction)\"]?_latedefWarning(type,labelName,token):warning(\"E056\",token,labelName,type)}declaredInCurrentScope?warning(\"E011\",token,labelName):\"outer\"===state.option.shadow&&scopeManagerInst.funct.has(labelName)&&warning(\"W004\",token,labelName),scopeManagerInst.block.add(labelName,type,token,!isexported)}else{var declaredInCurrentFunctionScope=scopeManagerInst.funct.has(labelName);!declaredInCurrentFunctionScope&&usedSoFarInCurrentFunction(labelName)&&_latedefWarning(type,labelName,token),scopeManagerInst.funct.has(labelName,{onlyBlockscoped:!0})?warning(\"E011\",token,labelName):state.option.shadow!==!0&&declaredInCurrentFunctionScope&&\"__proto__\"!==labelName&&\"global\"!==_currentFunctBody[\"(type)\"]&&warning(\"W004\",token,labelName),scopeManagerInst.funct.add(labelName,type,token,!isexported),\"global\"===_currentFunctBody[\"(type)\"]&&(usedPredefinedAndGlobals[labelName]=marker)}},funct:{labeltype:function(labelName,options){for(var onlyBlockscoped=options&&options.onlyBlockscoped,excludeParams=options&&options.excludeParams,currentScopeIndex=_scopeStack.length-(options&&options.excludeCurrent?2:1),i=currentScopeIndex;i>=0;i--){var current=_scopeStack[i];if(current[\"(labels)\"][labelName]&&(!onlyBlockscoped||current[\"(labels)\"][labelName][\"(blockscoped)\"]))return current[\"(labels)\"][labelName][\"(type)\"];var scopeCheck=excludeParams?_scopeStack[i-1]:current;if(scopeCheck&&\"functionparams\"===scopeCheck[\"(type)\"])return null}return null},hasBreakLabel:function(labelName){for(var i=_scopeStack.length-1;i>=0;i--){var current=_scopeStack[i];if(current[\"(breakLabels)\"][labelName])return!0;if(\"functionparams\"===current[\"(type)\"])return!1}return!1},has:function(labelName,options){return Boolean(this.labeltype(labelName,options))},add:function(labelName,type,tok,unused){_current[\"(labels)\"][labelName]={\"(type)\":type,\"(token)\":tok,\"(blockscoped)\":!1,\"(function)\":_currentFunctBody,\"(unused)\":unused}}},block:{isGlobal:function(){return\"global\"===_current[\"(type)\"]},use:function(labelName,token){var paramScope=_currentFunctBody[\"(parent)\"];paramScope&¶mScope[\"(labels)\"][labelName]&&\"param\"===paramScope[\"(labels)\"][labelName][\"(type)\"]&&(scopeManagerInst.funct.has(labelName,{excludeParams:!0,onlyBlockscoped:!0})||(paramScope[\"(labels)\"][labelName][\"(unused)\"]=!1)),token&&(state.ignored.W117||state.option.undef===!1)&&(token.ignoreUndef=!0),_setupUsages(labelName),token&&(token[\"(function)\"]=_currentFunctBody,_current[\"(usages)\"][labelName][\"(tokens)\"].push(token))},reassign:function(labelName,token){this.modify(labelName,token),_current[\"(usages)\"][labelName][\"(reassigned)\"].push(token)},modify:function(labelName,token){_setupUsages(labelName),_current[\"(usages)\"][labelName][\"(modified)\"].push(token)},add:function(labelName,type,tok,unused){_current[\"(labels)\"][labelName]={\"(type)\":type,\"(token)\":tok,\"(blockscoped)\":!0,\"(unused)\":unused}},addBreakLabel:function(labelName,opts){var token=opts.token;scopeManagerInst.funct.hasBreakLabel(labelName)?warning(\"E011\",token,labelName):\"outer\"===state.option.shadow&&(scopeManagerInst.funct.has(labelName)?warning(\"W004\",token,labelName):_checkOuterShadow(labelName,token)),_current[\"(breakLabels)\"][labelName]=token}}};return scopeManagerInst};module.exports=scopeManager},{\"../lodash\":\"/node_modules/jshint/lodash.js\",events:\"/node_modules/browserify/node_modules/events/events.js\"}],\"/node_modules/jshint/src/state.js\":[function(_dereq_,module,exports){\"use strict\";var NameStack=_dereq_(\"./name-stack.js\"),state={syntax:{},isStrict:function(){return this.directive[\"use strict\"]||this.inClassBody||this.option.module||\"implied\"===this.option.strict},inMoz:function(){return this.option.moz},inES6:function(){return this.option.moz||this.option.esversion>=6},inES5:function(strict){return strict?!(this.option.esversion&&5!==this.option.esversion||this.option.moz):!this.option.esversion||this.option.esversion>=5||this.option.moz},reset:function(){this.tokens={prev:null,next:null,curr:null},this.option={},this.funct=null,this.ignored={},this.directive={},this.jsonMode=!1,this.jsonWarnings=[],this.lines=[],this.tab=\"\",this.cache={},this.ignoredLines={},this.forinifcheckneeded=!1,this.nameStack=new NameStack,this.inClassBody=!1}};exports.state=state},{\"./name-stack.js\":\"/node_modules/jshint/src/name-stack.js\"}],\"/node_modules/jshint/src/style.js\":[function(_dereq_,module,exports){\"use strict\";exports.register=function(linter){linter.on(\"Identifier\",function(data){linter.getOption(\"proto\")||\"__proto__\"===data.name&&linter.warn(\"W103\",{line:data.line,\"char\":data.char,data:[data.name,\"6\"]})}),linter.on(\"Identifier\",function(data){linter.getOption(\"iterator\")||\"__iterator__\"===data.name&&linter.warn(\"W103\",{line:data.line,\"char\":data.char,data:[data.name]})}),linter.on(\"Identifier\",function(data){linter.getOption(\"camelcase\")&&data.name.replace(/^_+|_+$/g,\"\").indexOf(\"_\")>-1&&!data.name.match(/^[A-Z0-9_]*$/)&&linter.warn(\"W106\",{line:data.line,\"char\":data.from,data:[data.name]})}),linter.on(\"String\",function(data){var code,quotmark=linter.getOption(\"quotmark\");quotmark&&(\"single\"===quotmark&&\"'\"!==data.quote&&(code=\"W109\"),\"double\"===quotmark&&'\"'!==data.quote&&(code=\"W108\"),quotmark===!0&&(linter.getCache(\"quotmark\")||linter.setCache(\"quotmark\",data.quote),linter.getCache(\"quotmark\")!==data.quote&&(code=\"W110\")),code&&linter.warn(code,{line:data.line,\"char\":data.char}))}),linter.on(\"Number\",function(data){\".\"===data.value.charAt(0)&&linter.warn(\"W008\",{line:data.line,\"char\":data.char,data:[data.value]}),\".\"===data.value.substr(data.value.length-1)&&linter.warn(\"W047\",{line:data.line,\"char\":data.char,data:[data.value]}),/^00+/.test(data.value)&&linter.warn(\"W046\",{line:data.line,\"char\":data.char,data:[data.value]})}),linter.on(\"String\",function(data){var re=/^(?:javascript|jscript|ecmascript|vbscript|livescript)\\s*:/i;linter.getOption(\"scripturl\")||re.test(data.value)&&linter.warn(\"W107\",{line:data.line,\"char\":data.char})})}},{}],\"/node_modules/jshint/src/vars.js\":[function(_dereq_,module,exports){\"use strict\";exports.reservedVars={arguments:!1,NaN:!1},exports.ecmaIdentifiers={3:{Array:!1,Boolean:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,isFinite:!1,isNaN:!1,Math:!1,Number:!1,Object:!1,parseInt:!1,parseFloat:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,TypeError:!1,URIError:!1},5:{JSON:!1},6:{Map:!1,Promise:!1,Proxy:!1,Reflect:!1,Set:!1,Symbol:!1,WeakMap:!1,WeakSet:!1}},exports.browser={Audio:!1,Blob:!1,addEventListener:!1,applicationCache:!1,atob:!1,blur:!1,btoa:!1,cancelAnimationFrame:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,CSS:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,Comment:!1,CustomEvent:!1,DOMParser:!1,defaultStatus:!1,Document:!1,document:!1,DocumentFragment:!1,Element:!1,ElementTimeControl:!1,Event:!1,event:!1,fetch:!1,FileReader:!1,FormData:!1,focus:!1,frames:!1,getComputedStyle:!1,HTMLElement:!1,HTMLAnchorElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPreElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLUListElement:!1,HTMLVideoElement:!1,history:!1,Image:!1,Intl:!1,length:!1,localStorage:!1,location:!1,matchMedia:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationObserver:!1,name:!1,Node:!1,NodeFilter:!1,NodeList:!1,Notification:!1,navigator:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,Option:!1,parent:!1,performance:!1,print:!1,Range:!1,requestAnimationFrame:!1,removeEventListener:!1,resizeBy:!1,resizeTo:!1,screen:!1,scroll:!1,scrollBy:!1,scrollTo:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,SharedWorker:!1,status:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimationElement:!1,SVGCSSRule:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLineElement:!1,SVGLinearGradientElement:!1,SVGLocatable:!1,SVGMPathElement:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGSVGElement:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformList:!1,SVGTransformable:!1,SVGURIReference:!1,SVGUnitTypes:!1,SVGUseElement:!1,SVGVKernElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGZoomAndPan:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TimeEvent:!1,top:!1,URL:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLHttpRequest:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},exports.devel={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},exports.worker={importScripts:!0,postMessage:!0,self:!0,FileReaderSync:!0},exports.nonstandard={escape:!1,unescape:!1},exports.couch={require:!1,respond:!1,getRow:!1,emit:!1,send:!1,start:!1,sum:!1,log:!1,exports:!1,module:!1,provides:!1},exports.node={__filename:!1,__dirname:!1,GLOBAL:!1,global:!1,module:!1,acequire:!1,Buffer:!0,console:!0,exports:!0,process:!0,setTimeout:!0,clearTimeout:!0,setInterval:!0,clearInterval:!0,setImmediate:!0,clearImmediate:!0},exports.browserify={__filename:!1,__dirname:!1,global:!1,module:!1,acequire:!1,Buffer:!0,exports:!0,process:!0},exports.phantom={phantom:!0,acequire:!0,WebPage:!0,console:!0,exports:!0},exports.qunit={asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,\"throws\":!1},exports.rhino={defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},exports.shelljs={target:!1,echo:!1,exit:!1,cd:!1,pwd:!1,ls:!1,find:!1,cp:!1,rm:!1,mv:!1,mkdir:!1,test:!1,cat:!1,sed:!1,grep:!1,which:!1,dirs:!1,pushd:!1,popd:!1,env:!1,exec:!1,chmod:!1,config:!1,error:!1,tempdir:!1},exports.typed={ArrayBuffer:!1,ArrayBufferView:!1,DataView:!1,Float32Array:!1,Float64Array:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1},exports.wsh={ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WSH:!0,WScript:!0,XDomainRequest:!0},exports.dojo={dojo:!1,dijit:!1,dojox:!1,define:!1,require:!1},exports.jquery={$:!1,jQuery:!1},exports.mootools={$:!1,$$:!1,Asset:!1,Browser:!1,Chain:!1,Class:!1,Color:!1,Cookie:!1,Core:!1,Document:!1,DomReady:!1,DOMEvent:!1,DOMReady:!1,Drag:!1,Element:!1,Elements:!1,Event:!1,Events:!1,Fx:!1,Group:!1,Hash:!1,HtmlTable:!1,IFrame:!1,IframeShim:!1,InputValidator:!1,instanceOf:!1,Keyboard:!1,Locale:!1,Mask:!1,MooTools:!1,Native:!1,Options:!1,OverText:!1,Request:!1,Scroller:!1,Slick:!1,Slider:!1,Sortables:!1,Spinner:!1,Swiff:!1,Tips:!1,Type:!1,typeOf:!1,URI:!1,Window:!1},exports.prototypejs={$:!1,$$:!1,$A:!1,$F:!1,$H:!1,$R:!1,$break:!1,$continue:!1,$w:!1,Abstract:!1,Ajax:!1,Class:!1,Enumerable:!1,Element:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Selector:!1,Template:!1,Toggle:!1,Try:!1,Autocompleter:!1,Builder:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Scriptaculous:!1},exports.yui={YUI:!1,Y:!1,YUI_config:!1},exports.mocha={mocha:!1,describe:!1,xdescribe:!1,it:!1,xit:!1,context:!1,xcontext:!1,before:!1,after:!1,beforeEach:!1,afterEach:!1,suite:!1,test:!1,setup:!1,teardown:!1,suiteSetup:!1,suiteTeardown:!1},exports.jasmine={jasmine:!1,describe:!1,xdescribe:!1,it:!1,xit:!1,beforeEach:!1,afterEach:!1,setFixtures:!1,loadFixtures:!1,spyOn:!1,expect:!1,runs:!1,waitsFor:!1,waits:!1,beforeAll:!1,afterAll:!1,fail:!1,fdescribe:!1,fit:!1,pending:!1}},{}]},{},[\"/node_modules/jshint/src/jshint.js\"])}),ace.define(\"ace/mode/javascript_worker\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/worker/mirror\",\"ace/mode/javascript/jshint\"],function(acequire,exports,module){\"use strict\";function startRegex(arr){return RegExp(\"^(\"+arr.join(\"|\")+\")\")}var oop=acequire(\"../lib/oop\"),Mirror=acequire(\"../worker/mirror\").Mirror,lint=acequire(\"./javascript/jshint\").JSHINT,disabledWarningsRe=startRegex([\"Bad for in variable '(.+)'.\",'Missing \"use strict\"']),errorsRe=startRegex([\"Unexpected\",\"Expected \",\"Confusing (plus|minus)\",\"\\\\{a\\\\} unterminated regular expression\",\"Unclosed \",\"Unmatched \",\"Unbegun comment\",\"Bad invocation\",\"Missing space after\",\"Missing operator at\"]),infoRe=startRegex([\"Expected an assignment\",\"Bad escapement of EOL\",\"Unexpected comma\",\"Unexpected space\",\"Missing radix parameter.\",\"A leading decimal point can\",\"\\\\['{a}'\\\\] is better written in dot notation.\",\"'{a}' used out of scope\"]),JavaScriptWorker=exports.JavaScriptWorker=function(sender){Mirror.call(this,sender),this.setTimeout(500),this.setOptions()};oop.inherits(JavaScriptWorker,Mirror),function(){this.setOptions=function(options){this.options=options||{esnext:!0,moz:!0,devel:!0,browser:!0,node:!0,laxcomma:!0,laxbreak:!0,lastsemic:!0,onevar:!1,passfail:!1,maxerr:100,expr:!0,multistr:!0,globalstrict:!0},this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.changeOptions=function(newOptions){oop.mixin(this.options,newOptions),this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.isValidJS=function(str){try{eval(\"throw 0;\"+str)}catch(e){if(0===e)return!0}return!1},this.onUpdate=function(){var value=this.doc.getValue();if(value=value.replace(/^#!.*\\n/,\"\\n\"),!value)return this.sender.emit(\"annotate\",[]);var errors=[],maxErrorLevel=this.isValidJS(value)?\"warning\":\"error\";lint(value,this.options,this.options.globals);for(var results=lint.errors,errorAdded=!1,i=0;results.length>i;i++){var error=results[i];if(error){var raw=error.raw,type=\"warning\";if(\"Missing semicolon.\"==raw){var str=error.evidence.substr(error.character);str=str.charAt(str.search(/\\S/)),\"error\"==maxErrorLevel&&str&&/[\\w\\d{(['\"]/.test(str)?(error.reason='Missing \";\" before statement',type=\"error\"):type=\"info\"}else{if(disabledWarningsRe.test(raw))continue;infoRe.test(raw)?type=\"info\":errorsRe.test(raw)?(errorAdded=!0,type=maxErrorLevel):\"'{a}' is not defined.\"==raw?type=\"warning\":\"'{a}' is defined but never used.\"==raw&&(type=\"info\")}errors.push({row:error.line-1,column:error.character-1,text:error.reason,type:type,raw:raw})}}this.sender.emit(\"annotate\",errors)}}.call(JavaScriptWorker.prototype)}),ace.define(\"ace/lib/es5-shim\",[\"require\",\"exports\",\"module\"],function(){function Empty(){}function doesDefinePropertyWork(object){try{return Object.defineProperty(object,\"sentinel\",{}),\"sentinel\"in object}catch(exception){}}function toInteger(n){return n=+n,n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if(\"function\"!=typeof target)throw new TypeError(\"Function.prototype.bind called on incompatible \"+target);var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))};return target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound});var defineGetter,defineSetter,lookupGetter,lookupSetter,supportsAccessors,call=Function.prototype.call,prototypeOfArray=Array.prototype,prototypeOfObject=Object.prototype,slice=prototypeOfArray.slice,_toString=call.bind(prototypeOfObject.toString),owns=call.bind(prototypeOfObject.hasOwnProperty);if((supportsAccessors=owns(prototypeOfObject,\"__defineGetter__\"))&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function makeArray(l){var a=Array(l+2);return a[0]=a[1]=0,a}var lengthBefore,array=[];return array.splice.apply(array,makeArray(20)),array.splice.apply(array,makeArray(26)),lengthBefore=array.length,array.splice(5,0,\"XXX\"),lengthBefore+1==array.length,lengthBefore+1==array.length?!0:void 0}()){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){return arguments.length?array_splice.apply(this,[void 0===start?0:start,void 0===deleteCount?this.length-start:deleteCount].concat(slice.call(arguments,2))):[]}}else Array.prototype.splice=function(pos,removeCount){var length=this.length;pos>0?pos>length&&(pos=length):void 0==pos?pos=0:0>pos&&(pos=Math.max(length+pos,0)),length>pos+removeCount||(removeCount=length-pos);var removed=this.slice(pos,pos+removeCount),insert=slice.call(arguments,2),add=insert.length;if(pos===length)add&&this.push.apply(this,insert);else{var remove=Math.min(removeCount,length-pos),tailOldPos=pos+remove,tailNewPos=tailOldPos+add-remove,tailCount=length-tailOldPos,lengthAfterRemove=length-remove;if(tailOldPos>tailNewPos)for(var i=0;tailCount>i;++i)this[tailNewPos+i]=this[tailOldPos+i];else if(tailNewPos>tailOldPos)for(i=tailCount;i--;)this[tailNewPos+i]=this[tailOldPos+i];if(add&&pos===lengthAfterRemove)this.length=lengthAfterRemove,this.push.apply(this,insert);else for(this.length=lengthAfterRemove+add,i=0;add>i;++i)this[pos+i]=insert[i]}return removed};Array.isArray||(Array.isArray=function(obj){return\"[object Array]\"==_toString(obj)});var boxedString=Object(\"a\"),splitString=\"a\"!=boxedString[0]||!(0 in boxedString);if(Array.prototype.forEach||(Array.prototype.forEach=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,thisp=arguments[1],i=-1,length=self.length>>>0;if(\"[object Function]\"!=_toString(fun))throw new TypeError;for(;length>++i;)i in self&&fun.call(thisp,self[i],i,object)}),Array.prototype.map||(Array.prototype.map=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)i in self&&(result[i]=fun.call(thisp,self[i],i,object));return result}),Array.prototype.filter||(Array.prototype.filter=function(fun){var value,object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,result=[],thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)i in self&&(value=self[i],fun.call(thisp,value,i,object)&&result.push(value));return result}),Array.prototype.every||(Array.prototype.every=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)if(i in self&&fun.call(thisp,self[i],i,object))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0;if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");if(!length&&1==arguments.length)throw new TypeError(\"reduce of empty array with no initial value\");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError(\"reduce of empty array with no initial value\")}for(;length>i;i++)i in self&&(result=fun.call(void 0,result,self[i],i,object));return result}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0;if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");if(!length&&1==arguments.length)throw new TypeError(\"reduceRight of empty array with no initial value\");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(0>--i)throw new TypeError(\"reduceRight of empty array with no initial value\")}do i in this&&(result=fun.call(void 0,result,self[i],i,object));while(i--);return result}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(sought){var self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;for(arguments.length>1&&(i=toInteger(arguments[1])),i=i>=0?i:Math.max(0,length+i);length>i;i++)if(i in self&&self[i]===sought)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(sought){var self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;for(arguments.length>1&&(i=Math.min(i,toInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&sought===self[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}),!Object.getOwnPropertyDescriptor){var ERR_NON_OBJECT=\"Object.getOwnPropertyDescriptor called on a non-object: \";Object.getOwnPropertyDescriptor=function(object,property){if(\"object\"!=typeof object&&\"function\"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT+object);if(owns(object,property)){var descriptor,getter,setter;if(descriptor={enumerable:!0,configurable:!0},supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(object.__proto__=prototype,getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(object){return Object.keys(object)}),!Object.create){var createEmpty;createEmpty=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var empty={};for(var i in empty)empty[i]=null;return empty.constructor=empty.hasOwnProperty=empty.propertyIsEnumerable=empty.isPrototypeOf=empty.toLocaleString=empty.toString=empty.valueOf=empty.__proto__=null,empty},Object.create=function(prototype,properties){var object;if(null===prototype)object=createEmpty();else{if(\"object\"!=typeof prototype)throw new TypeError(\"typeof prototype[\"+typeof prototype+\"] != 'object'\");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom=\"undefined\"==typeof document||doesDefinePropertyWork(document.createElement(\"div\"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR=\"Property description must be an object: \",ERR_NON_OBJECT_TARGET=\"Object.defineProperty called on non-object: \",ERR_ACCESSORS_NOT_SUPPORTED=\"getters & setters can not be defined on this javascript engine\";Object.defineProperty=function(object,property,descriptor){if(\"object\"!=typeof object&&\"function\"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT_TARGET+object);if(\"object\"!=typeof descriptor&&\"function\"!=typeof descriptor||null===descriptor)throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if(owns(descriptor,\"value\"))if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{if(!supportsAccessors)throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);owns(descriptor,\"get\")&&defineGetter(object,property,descriptor.get),owns(descriptor,\"set\")&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties||(Object.defineProperties=function(object,properties){for(var property in properties)owns(properties,property)&&Object.defineProperty(object,property,properties[property]);return object}),Object.seal||(Object.seal=function(object){return object}),Object.freeze||(Object.freeze=function(object){return object});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(freezeObject){return function(object){return\"function\"==typeof object?object:freezeObject(object)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(object){return object}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(object){if(Object(object)===object)throw new TypeError;for(var name=\"\";owns(object,name);)name+=\"?\";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue}),!Object.keys){var hasDontEnumBug=!0,dontEnums=[\"toString\",\"toLocaleString\",\"valueOf\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"constructor\"],dontEnumsLength=dontEnums.length;for(var key in{toString:null})hasDontEnumBug=!1;Object.keys=function(object){if(\"object\"!=typeof object&&\"function\"!=typeof object||null===object)throw new TypeError(\"Object.keys called on a non-object\");var keys=[];for(var name in object)owns(object,name)&&keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;ii>i;i++){var dontEnum=dontEnums[i];owns(object,dontEnum)&&keys.push(dontEnum)}return keys}}Date.now||(Date.now=function(){return(new Date).getTime()});var ws=\"\t\\n\u000b\\f\\r   ᠎              \\u2028\\u2029\";if(!String.prototype.trim||ws.trim()){ws=\"[\"+ws+\"]\";var trimBeginRegexp=RegExp(\"^\"+ws+ws+\"*\"),trimEndRegexp=RegExp(ws+ws+\"*$\");String.prototype.trim=function(){return(this+\"\").replace(trimBeginRegexp,\"\").replace(trimEndRegexp,\"\")}}var toObject=function(o){if(null==o)throw new TypeError(\"can't convert \"+o+\" to object\");return Object(o)}});"; + +/***/ }), +/* 46 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */ @@ -52641,7 +53133,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */ /***/ }), -/* 46 */ +/* 47 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -52856,7 +53348,7 @@ let DarkWebItems = { /***/ }), -/* 47 */ +/* 48 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -52985,7 +53477,7 @@ function substituteAliases(origCommand) { /***/ }), -/* 48 */ +/* 49 */ /***/ (function(module, exports) { // shim for using process in browser @@ -53175,7 +53667,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 49 */ +/* 50 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53191,6 +53683,7 @@ process.umask = function() { return 0; }; function TextFile(fn="", txt="") { this.fn = fn.endsWith(".txt") ? fn : fn + ".txt"; + this.fn = this.fn.replace(/\s+/g, ''); this.text = String(txt); } @@ -53276,7 +53769,7 @@ function deleteTextFile(fn, server) { /***/ }), -/* 50 */ +/* 51 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53416,7 +53909,7 @@ let FactionInfo = { /***/ }), -/* 51 */ +/* 52 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53427,7 +53920,7 @@ let FactionInfo = { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Player_js__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_InfiltrationBox_js__ = __webpack_require__(52); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_InfiltrationBox_js__ = __webpack_require__(53); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__ = __webpack_require__(4); @@ -54255,7 +54748,7 @@ function getInfiltrationEscapeChance(inst) { /***/ }), -/* 52 */ +/* 53 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54381,7 +54874,7 @@ function infiltrationBoxCreate(inst) { /***/ }), -/* 53 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { /* ***** BEGIN LICENSE BLOCK ***** @@ -74658,7 +75151,7 @@ exports.version = "1.2.9"; module.exports = window.ace.acequire("ace/ace"); /***/ }), -/* 54 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) { @@ -75431,7 +75924,7 @@ oop.inherits(Mode, TextMode); }; this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], __webpack_require__(55), "JavaScriptWorker"); + var worker = new WorkerClient(["ace"], __webpack_require__(45), "JavaScriptWorker"); worker.attachToDocument(session.getDocument()); worker.on("annotate", function(results) { @@ -75453,14 +75946,824 @@ exports.Mode = Mode; /***/ }), -/* 55 */ -/***/ (function(module, exports) { +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) { +"use strict"; + +var oop = acequire("../lib/oop"); +var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules; + +var DocCommentHighlightRules = function() { + this.$rules = { + "start" : [ { + token : "comment.doc.tag", + regex : "@[\\w\\d_]+" // TODO: fix email addresses + }, + DocCommentHighlightRules.getTagRule(), + { + defaultToken : "comment.doc", + caseInsensitive: true + }] + }; +}; + +oop.inherits(DocCommentHighlightRules, TextHighlightRules); + +DocCommentHighlightRules.getTagRule = function(start) { + return { + token : "comment.doc.tag.storage.type", + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + }; +} + +DocCommentHighlightRules.getStartRule = function(start) { + return { + token : "comment.doc", // doc comment + regex : "\\/\\*(?=\\*)", + next : start + }; +}; + +DocCommentHighlightRules.getEndRule = function (start) { + return { + token : "comment.doc", // closing comment + regex : "\\*\\/", + next : start + }; +}; + + +exports.DocCommentHighlightRules = DocCommentHighlightRules; + +}); + +ace.define("ace/mode/netscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(acequire, exports, module) { +"use strict"; + +var oop = acequire("../lib/oop"); +var DocCommentHighlightRules = acequire("./doc_comment_highlight_rules").DocCommentHighlightRules; +var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules; +var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; + +var NetscriptHighlightRules = function(options) { + var keywordMapper = this.createKeywordMapper({ + "variable.language": + "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors + "Namespace|QName|XML|XMLList|" + // E4X + "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + + "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + + "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors + "SyntaxError|TypeError|URIError|" + + "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions + "isNaN|parseFloat|parseInt|" + + "hack|sleep|grow|weaken|print|tprint|scan|nuke|brutessh|ftpcrack|" + //Netscript functions + "clearLog|disableLog|enableLog|" + + "relaysmtp|httpworm|sqlinject|run|exec|spawn|kill|killall|exit|" + + "scp|ls|hasRootAccess|" + + "getIp|getHackingMultipliers|getBitNodeMultipliers|getStats|" + + "getCharacterInformation|isBusy|" + + "getHostname|getHackingLevel|getServerMoneyAvailable|getServerMaxMoney|" + + "getServerGrowth|getServerSecurityLevel|getServerBaseSecurityLevel|" + + "getServerMinSecurityLevel|" + + "getServerRequiredHackingLevel|getServerNumPortsRequired|getServerRam|" + + "serverExists|fileExists|isRunning|getNextHacknetNodeCost|" + + "purchaseHacknetNode|deleteServer|getPurchasedServers|" + + "purchaseServer|round|write|read|peek|clear|getPortHandle|" + + "scriptRunning|scriptKill|getScriptRam|" + + "getHackTime|getGrowTime|getWeakenTime|getScriptIncome|getScriptExpGain|" + + "getTimeSinceLastAug|" + + "universityCourse|" + + "gymWorkout|travelToCity|purchaseTor|purchaseProgram|upgradeHomeRam|" + + "getUpgradeHomeRamCost|workForCompany|applyToCompany|getCompanyRep|" + + "getCompanyFavor|stopAction|" + + "checkFactionInvitations|joinFaction|workForFaction|getFactionRep|" + + "getFactionFavor|" + + "createProgram|commitCrime|getCrimeChance|getOwnedAugmentations|" + + "getAugmentationsFromFaction|" + + "getAugmentationCost|purchaseAugmentation|" + + "installAugmentations|hacknetnodes|upgradeLevel|upgradeRam|upgradeCore|" + + "getLevelUpgradeCost|getRamUpgradeCost|getCoreUpgradeCost|" + + "getStockPrice|getStockPosition|buyStock|sellStock|shortStock|sellShort|" + + "placeOrder|cancelOrder|" + + "JSON|Math|" + // Other + "this|arguments|prototype|window|document" , // Pseudo + "keyword": + "const|yield|import|get|set|async|await|" + + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "__parent__|__count__|escape|unescape|with|__proto__|" + + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", + "storage.type": + "const|let|var|function", + "constant.language": + "null|Infinity|NaN|undefined", + "support.function": + "alert", + "constant.language.boolean": "true|false" + }, "identifier"); + var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; + + var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex + "u[0-9a-fA-F]{4}|" + // unicode + "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode + "[0-2][0-7]{0,2}|" + // oct + "3[0-7][0-7]?|" + // oct + "[4-7][0-7]?|" + //oct + ".)"; + + this.$rules = { + "no_regex" : [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("no_regex"), + { + token : "string", + regex : "'(?=.)", + next : "qstring" + }, { + token : "string", + regex : '"(?=.)', + next : "qqstring" + }, { + token : "constant.numeric", // hex + regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/ + }, { + token : "constant.numeric", // float + regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ + }, { + token : [ + "storage.type", "punctuation.operator", "support.function", + "punctuation.operator", "entity.name.function", "text","keyword.operator" + ], + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type", + "text", "paren.lparen" + ], + regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "entity.name.function", "text", "punctuation.operator", + "text", "storage.type", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : [ + "text", "text", "storage.type", "text", "paren.lparen" + ], + regex : "(:)(\\s*)(function)(\\s*)(\\()", + next: "function_arguments" + }, { + token : "keyword", + regex : "(?:" + kwBeforeRe + ")\\b", + next : "start" + }, { + token : ["support.constant"], + regex : /that\b/ + }, { + token : ["storage.type", "punctuation.operator", "support.function.firebug"], + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + }, { + token : keywordMapper, + regex : identifierRe + }, { + token : "punctuation.operator", + regex : /[.](?![.])/, + next : "property" + }, { + token : "keyword.operator", + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, + next : "start" + }, { + token : "punctuation.operator", + regex : /[?:,;.]/, + next : "start" + }, { + token : "paren.lparen", + regex : /[\[({]/, + next : "start" + }, { + token : "paren.rparen", + regex : /[\])}]/ + }, { + token: "comment", + regex: /^#!.*$/ + } + ], + property: [{ + token : "text", + regex : "\\s+" + }, { + token : [ + "storage.type", "punctuation.operator", "entity.name.function", "text", + "keyword.operator", "text", + "storage.type", "text", "entity.name.function", "text", "paren.lparen" + ], + regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", + next: "function_arguments" + }, { + token : "punctuation.operator", + regex : /[.](?![.])/ + }, { + token : "support.function", + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + }, { + token : "support.function.dom", + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + }, { + token : "support.constant", + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + }, { + token : "identifier", + regex : identifierRe + }, { + regex: "", + token: "empty", + next: "no_regex" + } + ], + "start": [ + DocCommentHighlightRules.getStartRule("doc-start"), + comments("start"), + { + token: "string.regexp", + regex: "\\/", + next: "regex" + }, { + token : "text", + regex : "\\s+|^$", + next : "start" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "regex": [ + { + token: "regexp.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "string.regexp", + regex: "/[sxngimy]*", + next: "no_regex" + }, { + token : "invalid", + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + }, { + token : "constant.language.escape", + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + }, { + token : "constant.language.delimiter", + regex: /\|/ + }, { + token: "constant.language.escape", + regex: /\[\^?/, + next: "regex_character_class" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp" + } + ], + "regex_character_class": [ + { + token: "regexp.charclass.keyword.operator", + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + }, { + token: "constant.language.escape", + regex: "]", + next: "regex" + }, { + token: "constant.language.escape", + regex: "-" + }, { + token: "empty", + regex: "$", + next: "no_regex" + }, { + defaultToken: "string.regexp.charachterclass" + } + ], + "function_arguments": [ + { + token: "variable.parameter", + regex: identifierRe + }, { + token: "punctuation.operator", + regex: "[, ]+" + }, { + token: "punctuation.operator", + regex: "$" + }, { + token: "empty", + regex: "", + next: "no_regex" + } + ], + "qqstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + next : "qqstring" + }, { + token : "string", + regex : '"|$', + next : "no_regex" + }, { + defaultToken: "string" + } + ], + "qstring" : [ + { + token : "constant.language.escape", + regex : escapedRe + }, { + token : "string", + regex : "\\\\$", + next : "qstring" + }, { + token : "string", + regex : "'|$", + next : "no_regex" + }, { + defaultToken: "string" + } + ] + }; + + + if (!options || !options.noES6) { + this.$rules.no_regex.unshift({ + regex: "[{}]", onMatch: function(val, state, stack) { + this.next = val == "{" ? this.nextState : ""; + if (val == "{" && stack.length) { + stack.unshift("start", state); + } + else if (val == "}" && stack.length) { + stack.shift(); + this.next = stack.shift(); + if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) + return "paren.quasi.end"; + } + return val == "{" ? "paren.lparen" : "paren.rparen"; + }, + nextState: "start" + }, { + token : "string.quasi.start", + regex : /`/, + push : [{ + token : "constant.language.escape", + regex : escapedRe + }, { + token : "paren.quasi.start", + regex : /\${/, + push : "start" + }, { + token : "string.quasi.end", + regex : /`/, + next : "pop" + }, { + defaultToken: "string.quasi" + }] + }); + + if (!options || options.jsx != false) + JSX.call(this); + } + + this.embedRules(DocCommentHighlightRules, "doc-", + [ DocCommentHighlightRules.getEndRule("no_regex") ]); + + this.normalizeRules(); +}; + +oop.inherits(NetscriptHighlightRules, TextHighlightRules); + +function JSX() { + var tagRegex = identifierRe.replace("\\d", "\\d\\-"); + var jsxTag = { + onMatch : function(val, state, stack) { + var offset = val.charAt(1) == "/" ? 2 : 1; + if (offset == 1) { + if (state != this.nextState) + stack.unshift(this.next, this.nextState, 0); + else + stack.unshift(this.next); + stack[2]++; + } else if (offset == 2) { + if (state == this.nextState) { + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.shift(); + stack.shift(); + } + } + } + return [{ + type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", + value: val.slice(0, offset) + }, { + type: "meta.tag.tag-name.xml", + value: val.substr(offset) + }]; + }, + regex : "", + onMatch : function(value, currentState, stack) { + if (currentState == stack[0]) + stack.shift(); + if (value.length == 2) { + if (stack[0] == this.nextState) + stack[1]--; + if (!stack[1] || stack[1] < 0) { + stack.splice(0, 2); + } + } + this.next = stack[0] || "start"; + return [{type: this.token, value: value}]; + }, + nextState: "jsx" + }, + jsxJsRule, + comments("jsxAttributes"), + { + token : "entity.other.attribute-name.xml", + regex : tagRegex + }, { + token : "keyword.operator.attribute-equals.xml", + regex : "=" + }, { + token : "text.tag-whitespace.xml", + regex : "\\s+" + }, { + token : "string.attribute-value.xml", + regex : "'", + stateName : "jsx_attr_q", + push : [ + {token : "string.attribute-value.xml", regex: "'", next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, { + token : "string.attribute-value.xml", + regex : '"', + stateName : "jsx_attr_qq", + push : [ + {token : "string.attribute-value.xml", regex: '"', next: "pop"}, + {include : "reference"}, + {defaultToken : "string.attribute-value.xml"} + ] + }, + jsxTag + ]; + this.$rules.reference = [{ + token : "constant.language.escape.reference.xml", + regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" + }]; +} + +function comments(next) { + return [ + { + token : "comment", // multi line comment + regex : /\/\*/, + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "\\*\\/", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + }, { + token : "comment", + regex : "\\/\\/", + next: [ + DocCommentHighlightRules.getTagRule(), + {token : "comment", regex : "$|^", next : next || "pop"}, + {defaultToken : "comment", caseInsensitive: true} + ] + } + ]; +} +exports.NetscriptHighlightRules = NetscriptHighlightRules; +}); + +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(acequire, exports, module) { +"use strict"; + +var Range = acequire("../range").Range; + +var MatchingBraceOutdent = function() {}; + +(function() { + + this.checkOutdent = function(line, input) { + if (! /^\s+$/.test(line)) + return false; + + return /^\s*\}/.test(input); + }; + + this.autoOutdent = function(doc, row) { + var line = doc.getLine(row); + var match = line.match(/^(\s*\})/); + + if (!match) return 0; + + var column = match[1].length; + var openBracePos = doc.findMatchingBracket({row: row, column: column}); + + if (!openBracePos || openBracePos.row == row) return 0; + + var indent = this.$getIndent(doc.getLine(openBracePos.row)); + doc.replace(new Range(row, 0, row, column-1), indent); + }; + + this.$getIndent = function(line) { + return line.match(/^\s*/)[0]; + }; + +}).call(MatchingBraceOutdent.prototype); + +exports.MatchingBraceOutdent = MatchingBraceOutdent; +}); + +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(acequire, exports, module) { +"use strict"; + +var oop = acequire("../../lib/oop"); +var Range = acequire("../../range").Range; +var BaseFoldMode = acequire("./fold_mode").FoldMode; + +var FoldMode = exports.FoldMode = function(commentRegex) { + if (commentRegex) { + this.foldingStartMarker = new RegExp( + this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) + ); + this.foldingStopMarker = new RegExp( + this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) + ); + } +}; +oop.inherits(FoldMode, BaseFoldMode); + +(function() { + + this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; + this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; + this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; + this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; + this._getFoldWidgetBase = this.getFoldWidget; + this.getFoldWidget = function(session, foldStyle, row) { + var line = session.getLine(row); + + if (this.singleLineBlockCommentRe.test(line)) { + if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) + return ""; + } + + var fw = this._getFoldWidgetBase(session, foldStyle, row); + + if (!fw && this.startRegionRe.test(line)) + return "start"; // lineCommentRegionStart + + return fw; + }; + + this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + var line = session.getLine(row); + + if (this.startRegionRe.test(line)) + return this.getCommentRegionBlock(session, line, row); + + var match = line.match(this.foldingStartMarker); + if (match) { + var i = match.index; + + if (match[1]) + return this.openingBracketBlock(session, match[1], row, i); + + var range = session.getCommentFoldRange(row, i + match[0].length, 1); + + if (range && !range.isMultiLine()) { + if (forceMultiline) { + range = this.getSectionRange(session, row); + } else if (foldStyle != "all") + range = null; + } + + return range; + } + + if (foldStyle === "markbegin") + return; + + var match = line.match(this.foldingStopMarker); + if (match) { + var i = match.index + match[0].length; + + if (match[1]) + return this.closingBracketBlock(session, match[1], row, i); + + return session.getCommentFoldRange(row, i, -1); + } + }; + + this.getSectionRange = function(session, row) { + var line = session.getLine(row); + var startIndent = line.search(/\S/); + var startRow = row; + var startColumn = line.length; + row = row + 1; + var endRow = row; + var maxRow = session.getLength(); + while (++row < maxRow) { + line = session.getLine(row); + var indent = line.search(/\S/); + if (indent === -1) + continue; + if (startIndent > indent) + break; + var subRange = this.getFoldWidgetRange(session, "all", row); + + if (subRange) { + if (subRange.start.row <= startRow) { + break; + } else if (subRange.isMultiLine()) { + row = subRange.end.row; + } else if (startIndent == indent) { + break; + } + } + endRow = row; + } + + return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); + }; + this.getCommentRegionBlock = function(session, line, row) { + var startColumn = line.search(/\s*$/); + var maxRow = session.getLength(); + var startRow = row; + + var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; + var depth = 1; + while (++row < maxRow) { + line = session.getLine(row); + var m = re.exec(line); + if (!m) continue; + if (m[1]) depth--; + else depth++; + + if (!depth) break; + } + + var endRow = row; + if (endRow > startRow) { + return new Range(startRow, startColumn, endRow, line.length); + } + }; + +}).call(FoldMode.prototype); + +}); + +ace.define("ace/mode/netscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/netscript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(acequire, exports, module) { +"use strict"; + +var oop = acequire("../lib/oop"); +var TextMode = acequire("./text").Mode; +var NetscriptHighlightRules = acequire("./netscript_highlight_rules").NetscriptHighlightRules; +var MatchingBraceOutdent = acequire("./matching_brace_outdent").MatchingBraceOutdent; +var WorkerClient = acequire("../worker/worker_client").WorkerClient; +var CstyleBehaviour = acequire("./behaviour/cstyle").CstyleBehaviour; +var CStyleFoldMode = acequire("./folding/cstyle").FoldMode; + +var Mode = function() { + this.HighlightRules = NetscriptHighlightRules; + + this.$outdent = new MatchingBraceOutdent(); + this.$behaviour = new CstyleBehaviour(); + this.foldingRules = new CStyleFoldMode(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + this.lineCommentStart = "//"; + this.blockComment = {start: "/*", end: "*/"}; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + var endState = tokenizedLine.state; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start" || state == "no_regex") { + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); + if (match) { + indent += tab; + } + } else if (state == "doc-start") { + if (endState == "start" || endState == "no_regex") { + return ""; + } + var match = line.match(/^\s*(\/?)\*/); + if (match) { + if (match[1]) { + indent += " "; + } + indent += "* "; + } + } + + return indent; + }; + + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; + + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; + + this.createWorker = function(session) { + var worker = new WorkerClient(["ace"], __webpack_require__(45), "JavaScriptWorker"); + worker.attachToDocument(session.getDocument()); + + worker.on("annotate", function(results) { + session.setAnnotations(results.data); + }); + + worker.on("terminate", function() { + session.clearAnnotations(); + }); + + return worker; + }; + + this.$id = "ace/mode/netscript"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); -module.exports.id = 'ace/mode/javascript_worker'; -module.exports.src = "\"no use strict\";!function(window){function resolveModuleId(id,paths){for(var testPath=id,tail=\"\";testPath;){var alias=paths[testPath];if(\"string\"==typeof alias)return alias+tail;if(alias)return alias.location.replace(/\\/*$/,\"/\")+(tail||alias.main||alias.name);if(alias===!1)return\"\";var i=testPath.lastIndexOf(\"/\");if(-1===i)break;tail=testPath.substr(i)+tail,testPath=testPath.slice(0,i)}return id}if(!(void 0!==window.window&&window.document||window.acequire&&window.define)){window.console||(window.console=function(){var msgs=Array.prototype.slice.call(arguments,0);postMessage({type:\"log\",data:msgs})},window.console.error=window.console.warn=window.console.log=window.console.trace=window.console),window.window=window,window.ace=window,window.onerror=function(message,file,line,col,err){postMessage({type:\"error\",data:{message:message,data:err.data,file:file,line:line,col:col,stack:err.stack}})},window.normalizeModule=function(parentId,moduleName){if(-1!==moduleName.indexOf(\"!\")){var chunks=moduleName.split(\"!\");return window.normalizeModule(parentId,chunks[0])+\"!\"+window.normalizeModule(parentId,chunks[1])}if(\".\"==moduleName.charAt(0)){var base=parentId.split(\"/\").slice(0,-1).join(\"/\");for(moduleName=(base?base+\"/\":\"\")+moduleName;-1!==moduleName.indexOf(\".\")&&previous!=moduleName;){var previous=moduleName;moduleName=moduleName.replace(/^\\.\\//,\"\").replace(/\\/\\.\\//,\"/\").replace(/[^\\/]+\\/\\.\\.\\//,\"\")}}return moduleName},window.acequire=function acequire(parentId,id){if(id||(id=parentId,parentId=null),!id.charAt)throw Error(\"worker.js acequire() accepts only (parentId, id) as arguments\");id=window.normalizeModule(parentId,id);var module=window.acequire.modules[id];if(module)return module.initialized||(module.initialized=!0,module.exports=module.factory().exports),module.exports;if(!window.acequire.tlns)return console.log(\"unable to load \"+id);var path=resolveModuleId(id,window.acequire.tlns);return\".js\"!=path.slice(-3)&&(path+=\".js\"),window.acequire.id=id,window.acequire.modules[id]={},importScripts(path),window.acequire(parentId,id)},window.acequire.modules={},window.acequire.tlns={},window.define=function(id,deps,factory){if(2==arguments.length?(factory=deps,\"string\"!=typeof id&&(deps=id,id=window.acequire.id)):1==arguments.length&&(factory=id,deps=[],id=window.acequire.id),\"function\"!=typeof factory)return window.acequire.modules[id]={exports:factory,initialized:!0},void 0;deps.length||(deps=[\"require\",\"exports\",\"module\"]);var req=function(childId){return window.acequire(id,childId)};window.acequire.modules[id]={exports:{},factory:function(){var module=this,returnExports=factory.apply(this,deps.map(function(dep){switch(dep){case\"require\":return req;case\"exports\":return module.exports;case\"module\":return module;default:return req(dep)}}));return returnExports&&(module.exports=returnExports),module}}},window.define.amd={},acequire.tlns={},window.initBaseUrls=function(topLevelNamespaces){for(var i in topLevelNamespaces)acequire.tlns[i]=topLevelNamespaces[i]},window.initSender=function(){var EventEmitter=window.acequire(\"ace/lib/event_emitter\").EventEmitter,oop=window.acequire(\"ace/lib/oop\"),Sender=function(){};return function(){oop.implement(this,EventEmitter),this.callback=function(data,callbackId){postMessage({type:\"call\",id:callbackId,data:data})},this.emit=function(name,data){postMessage({type:\"event\",name:name,data:data})}}.call(Sender.prototype),new Sender};var main=window.main=null,sender=window.sender=null;window.onmessage=function(e){var msg=e.data;if(msg.event&&sender)sender._signal(msg.event,msg.data);else if(msg.command)if(main[msg.command])main[msg.command].apply(main,msg.args);else{if(!window[msg.command])throw Error(\"Unknown command:\"+msg.command);window[msg.command].apply(window,msg.args)}else if(msg.init){window.initBaseUrls(msg.tlns),acequire(\"ace/lib/es5-shim\"),sender=window.sender=window.initSender();var clazz=acequire(msg.module)[msg.classname];main=window.main=new clazz(sender)}}}}(this),ace.define(\"ace/lib/oop\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";exports.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports.mixin=function(obj,mixin){for(var key in mixin)obj[key]=mixin[key];return obj},exports.implement=function(proto,mixin){exports.mixin(proto,mixin)}}),ace.define(\"ace/range\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn},this.end={row:endRow,column:endColumn}};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column},this.toString=function(){return\"Range: [\"+this.start.row+\"/\"+this.start.column+\"] -> [\"+this.end.row+\"/\"+this.end.column+\"]\"},this.contains=function(row,column){return 0==this.compare(row,column)},this.compareRange=function(range){var cmp,end=range.end,start=range.start;return cmp=this.compare(end.row,end.column),1==cmp?(cmp=this.compare(start.row,start.column),1==cmp?2:0==cmp?1:0):-1==cmp?-2:(cmp=this.compare(start.row,start.column),-1==cmp?-1:1==cmp?42:0)},this.comparePoint=function(p){return this.compare(p.row,p.column)},this.containsRange=function(range){return 0==this.comparePoint(range.start)&&0==this.comparePoint(range.end)},this.intersects=function(range){var cmp=this.compareRange(range);return-1==cmp||0==cmp||1==cmp},this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column},this.isStart=function(row,column){return this.start.row==row&&this.start.column==column},this.setStart=function(row,column){\"object\"==typeof row?(this.start.column=row.column,this.start.row=row.row):(this.start.row=row,this.start.column=column)},this.setEnd=function(row,column){\"object\"==typeof row?(this.end.column=row.column,this.end.row=row.row):(this.end.row=row,this.end.column=column)},this.inside=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)||this.isStart(row,column)?!1:!0:!1},this.insideStart=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)?!1:!0:!1},this.insideEnd=function(row,column){return 0==this.compare(row,column)?this.isStart(row,column)?!1:!0:!1},this.compare=function(row,column){return this.isMultiLine()||row!==this.start.row?this.start.row>row?-1:row>this.end.row?1:this.start.row===row?column>=this.start.column?0:-1:this.end.row===row?this.end.column>=column?0:1:0:this.start.column>column?-1:column>this.end.column?1:0},this.compareStart=function(row,column){return this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.compareEnd=function(row,column){return this.end.row==row&&this.end.column==column?1:this.compare(row,column)},this.compareInside=function(row,column){return this.end.row==row&&this.end.column==column?1:this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.clipRows=function(firstRow,lastRow){if(this.end.row>lastRow)var end={row:lastRow+1,column:0};else if(firstRow>this.end.row)var end={row:firstRow,column:0};if(this.start.row>lastRow)var start={row:lastRow+1,column:0};else if(firstRow>this.start.row)var start={row:firstRow,column:0};return Range.fromPoints(start||this.start,end||this.end)},this.extend=function(row,column){var cmp=this.compare(row,column);if(0==cmp)return this;if(-1==cmp)var start={row:row,column:column};else var end={row:row,column:column};return Range.fromPoints(start||this.start,end||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return Range.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new Range(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new Range(this.start.row,0,this.end.row,0)},this.toScreenRange=function(session){var screenPosStart=session.documentToScreenPosition(this.start),screenPosEnd=session.documentToScreenPosition(this.end);return new Range(screenPosStart.row,screenPosStart.column,screenPosEnd.row,screenPosEnd.column)},this.moveBy=function(row,column){this.start.row+=row,this.start.column+=column,this.end.row+=row,this.end.column+=column}}).call(Range.prototype),Range.fromPoints=function(start,end){return new Range(start.row,start.column,end.row,end.column)},Range.comparePoints=comparePoints,Range.comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},exports.Range=Range}),ace.define(\"ace/apply_delta\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";exports.applyDelta=function(docLines,delta){var row=delta.start.row,startColumn=delta.start.column,line=docLines[row]||\"\";switch(delta.action){case\"insert\":var lines=delta.lines;if(1===lines.length)docLines[row]=line.substring(0,startColumn)+delta.lines[0]+line.substring(startColumn);else{var args=[row,1].concat(delta.lines);docLines.splice.apply(docLines,args),docLines[row]=line.substring(0,startColumn)+docLines[row],docLines[row+delta.lines.length-1]+=line.substring(startColumn)}break;case\"remove\":var endColumn=delta.end.column,endRow=delta.end.row;row===endRow?docLines[row]=line.substring(0,startColumn)+line.substring(endColumn):docLines.splice(row,endRow-row+1,line.substring(0,startColumn)+docLines[endRow].substring(endColumn))}}}),ace.define(\"ace/lib/event_emitter\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";var EventEmitter={},stopPropagation=function(){this.propagationStopped=!0},preventDefault=function(){this.defaultPrevented=!0};EventEmitter._emit=EventEmitter._dispatchEvent=function(eventName,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var listeners=this._eventRegistry[eventName]||[],defaultHandler=this._defaultHandlers[eventName];if(listeners.length||defaultHandler){\"object\"==typeof e&&e||(e={}),e.type||(e.type=eventName),e.stopPropagation||(e.stopPropagation=stopPropagation),e.preventDefault||(e.preventDefault=preventDefault),listeners=listeners.slice();for(var i=0;listeners.length>i&&(listeners[i](e,this),!e.propagationStopped);i++);return defaultHandler&&!e.defaultPrevented?defaultHandler(e,this):void 0}},EventEmitter._signal=function(eventName,e){var listeners=(this._eventRegistry||{})[eventName];if(listeners){listeners=listeners.slice();for(var i=0;listeners.length>i;i++)listeners[i](e,this)}},EventEmitter.once=function(eventName,callback){var _self=this;callback&&this.addEventListener(eventName,function newCallback(){_self.removeEventListener(eventName,newCallback),callback.apply(null,arguments)})},EventEmitter.setDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers||(handlers=this._defaultHandlers={_disabled_:{}}),handlers[eventName]){var old=handlers[eventName],disabled=handlers._disabled_[eventName];disabled||(handlers._disabled_[eventName]=disabled=[]),disabled.push(old);var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}handlers[eventName]=callback},EventEmitter.removeDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers){var disabled=handlers._disabled_[eventName];if(handlers[eventName]==callback)handlers[eventName],disabled&&this.setDefaultHandler(eventName,disabled.pop());else if(disabled){var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}}},EventEmitter.on=EventEmitter.addEventListener=function(eventName,callback,capturing){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];return listeners||(listeners=this._eventRegistry[eventName]=[]),-1==listeners.indexOf(callback)&&listeners[capturing?\"unshift\":\"push\"](callback),callback},EventEmitter.off=EventEmitter.removeListener=EventEmitter.removeEventListener=function(eventName,callback){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];if(listeners){var index=listeners.indexOf(callback);-1!==index&&listeners.splice(index,1)}},EventEmitter.removeAllListeners=function(eventName){this._eventRegistry&&(this._eventRegistry[eventName]=[])},exports.EventEmitter=EventEmitter}),ace.define(\"ace/anchor\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/lib/event_emitter\"],function(acequire,exports){\"use strict\";var oop=acequire(\"./lib/oop\"),EventEmitter=acequire(\"./lib/event_emitter\").EventEmitter,Anchor=exports.Anchor=function(doc,row,column){this.$onChange=this.onChange.bind(this),this.attach(doc),column===void 0?this.setPosition(row.row,row.column):this.setPosition(row,column)};(function(){function $pointsInOrder(point1,point2,equalPointsInOrder){var bColIsAfter=equalPointsInOrder?point1.column<=point2.column:point1.columnthis.row)){var point=$getTransformedPoint(delta,{row:this.row,column:this.column},this.$insertRight);this.setPosition(point.row,point.column,!0)}},this.setPosition=function(row,column,noClip){var pos;if(pos=noClip?{row:row,column:column}:this.$clipPositionToDocument(row,column),this.row!=pos.row||this.column!=pos.column){var old={row:this.row,column:this.column};this.row=pos.row,this.column=pos.column,this._signal(\"change\",{old:old,value:pos})}},this.detach=function(){this.document.removeEventListener(\"change\",this.$onChange)},this.attach=function(doc){this.document=doc||this.document,this.document.on(\"change\",this.$onChange)},this.$clipPositionToDocument=function(row,column){var pos={};return row>=this.document.getLength()?(pos.row=Math.max(0,this.document.getLength()-1),pos.column=this.document.getLine(pos.row).length):0>row?(pos.row=0,pos.column=0):(pos.row=row,pos.column=Math.min(this.document.getLine(pos.row).length,Math.max(0,column))),0>column&&(pos.column=0),pos}}).call(Anchor.prototype)}),ace.define(\"ace/document\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/apply_delta\",\"ace/lib/event_emitter\",\"ace/range\",\"ace/anchor\"],function(acequire,exports){\"use strict\";var oop=acequire(\"./lib/oop\"),applyDelta=acequire(\"./apply_delta\").applyDelta,EventEmitter=acequire(\"./lib/event_emitter\").EventEmitter,Range=acequire(\"./range\").Range,Anchor=acequire(\"./anchor\").Anchor,Document=function(textOrLines){this.$lines=[\"\"],0===textOrLines.length?this.$lines=[\"\"]:Array.isArray(textOrLines)?this.insertMergedLines({row:0,column:0},textOrLines):this.insert({row:0,column:0},textOrLines)};(function(){oop.implement(this,EventEmitter),this.setValue=function(text){var len=this.getLength()-1;this.remove(new Range(0,0,len,this.getLine(len).length)),this.insert({row:0,column:0},text)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(row,column){return new Anchor(this,row,column)},this.$split=0===\"aaa\".split(/a/).length?function(text){return text.replace(/\\r\\n|\\r/g,\"\\n\").split(\"\\n\")}:function(text){return text.split(/\\r\\n|\\r|\\n/)},this.$detectNewLine=function(text){var match=text.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=match?match[1]:\"\\n\",this._signal(\"changeNewLineMode\")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case\"windows\":return\"\\r\\n\";case\"unix\":return\"\\n\";default:return this.$autoNewLine||\"\\n\"}},this.$autoNewLine=\"\",this.$newLineMode=\"auto\",this.setNewLineMode=function(newLineMode){this.$newLineMode!==newLineMode&&(this.$newLineMode=newLineMode,this._signal(\"changeNewLineMode\"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(text){return\"\\r\\n\"==text||\"\\r\"==text||\"\\n\"==text},this.getLine=function(row){return this.$lines[row]||\"\"},this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(range){return this.getLinesForRange(range).join(this.getNewLineCharacter())},this.getLinesForRange=function(range){var lines;if(range.start.row===range.end.row)lines=[this.getLine(range.start.row).substring(range.start.column,range.end.column)];else{lines=this.getLines(range.start.row,range.end.row),lines[0]=(lines[0]||\"\").substring(range.start.column);var l=lines.length-1;range.end.row-range.start.row==l&&(lines[l]=lines[l].substring(0,range.end.column))}return lines},this.insertLines=function(row,lines){return console.warn(\"Use of document.insertLines is deprecated. Use the insertFullLines method instead.\"),this.insertFullLines(row,lines)},this.removeLines=function(firstRow,lastRow){return console.warn(\"Use of document.removeLines is deprecated. Use the removeFullLines method instead.\"),this.removeFullLines(firstRow,lastRow)},this.insertNewLine=function(position){return console.warn(\"Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.\"),this.insertMergedLines(position,[\"\",\"\"])},this.insert=function(position,text){return 1>=this.getLength()&&this.$detectNewLine(text),this.insertMergedLines(position,this.$split(text))},this.insertInLine=function(position,text){var start=this.clippedPos(position.row,position.column),end=this.pos(position.row,position.column+text.length);return this.applyDelta({start:start,end:end,action:\"insert\",lines:[text]},!0),this.clonePos(end)},this.clippedPos=function(row,column){var length=this.getLength();void 0===row?row=length:0>row?row=0:row>=length&&(row=length-1,column=void 0);var line=this.getLine(row);return void 0==column&&(column=line.length),column=Math.min(Math.max(column,0),line.length),{row:row,column:column}},this.clonePos=function(pos){return{row:pos.row,column:pos.column}},this.pos=function(row,column){return{row:row,column:column}},this.$clipPosition=function(position){var length=this.getLength();return position.row>=length?(position.row=Math.max(0,length-1),position.column=this.getLine(length-1).length):(position.row=Math.max(0,position.row),position.column=Math.min(Math.max(position.column,0),this.getLine(position.row).length)),position},this.insertFullLines=function(row,lines){row=Math.min(Math.max(row,0),this.getLength());var column=0;this.getLength()>row?(lines=lines.concat([\"\"]),column=0):(lines=[\"\"].concat(lines),row--,column=this.$lines[row].length),this.insertMergedLines({row:row,column:column},lines)},this.insertMergedLines=function(position,lines){var start=this.clippedPos(position.row,position.column),end={row:start.row+lines.length-1,column:(1==lines.length?start.column:0)+lines[lines.length-1].length};return this.applyDelta({start:start,end:end,action:\"insert\",lines:lines}),this.clonePos(end)},this.remove=function(range){var start=this.clippedPos(range.start.row,range.start.column),end=this.clippedPos(range.end.row,range.end.column);return this.applyDelta({start:start,end:end,action:\"remove\",lines:this.getLinesForRange({start:start,end:end})}),this.clonePos(start)},this.removeInLine=function(row,startColumn,endColumn){var start=this.clippedPos(row,startColumn),end=this.clippedPos(row,endColumn);return this.applyDelta({start:start,end:end,action:\"remove\",lines:this.getLinesForRange({start:start,end:end})},!0),this.clonePos(start)},this.removeFullLines=function(firstRow,lastRow){firstRow=Math.min(Math.max(0,firstRow),this.getLength()-1),lastRow=Math.min(Math.max(0,lastRow),this.getLength()-1);var deleteFirstNewLine=lastRow==this.getLength()-1&&firstRow>0,deleteLastNewLine=this.getLength()-1>lastRow,startRow=deleteFirstNewLine?firstRow-1:firstRow,startCol=deleteFirstNewLine?this.getLine(startRow).length:0,endRow=deleteLastNewLine?lastRow+1:lastRow,endCol=deleteLastNewLine?0:this.getLine(endRow).length,range=new Range(startRow,startCol,endRow,endCol),deletedLines=this.$lines.slice(firstRow,lastRow+1);return this.applyDelta({start:range.start,end:range.end,action:\"remove\",lines:this.getLinesForRange(range)}),deletedLines},this.removeNewLine=function(row){this.getLength()-1>row&&row>=0&&this.applyDelta({start:this.pos(row,this.getLine(row).length),end:this.pos(row+1,0),action:\"remove\",lines:[\"\",\"\"]})},this.replace=function(range,text){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),0===text.length&&range.isEmpty())return range.start;if(text==this.getTextRange(range))return range.end;this.remove(range);var end;return end=text?this.insert(range.start,text):range.start},this.applyDeltas=function(deltas){for(var i=0;deltas.length>i;i++)this.applyDelta(deltas[i])},this.revertDeltas=function(deltas){for(var i=deltas.length-1;i>=0;i--)this.revertDelta(deltas[i])},this.applyDelta=function(delta,doNotValidate){var isInsert=\"insert\"==delta.action;(isInsert?1>=delta.lines.length&&!delta.lines[0]:!Range.comparePoints(delta.start,delta.end))||(isInsert&&delta.lines.length>2e4&&this.$splitAndapplyLargeDelta(delta,2e4),applyDelta(this.$lines,delta,doNotValidate),this._signal(\"change\",delta))},this.$splitAndapplyLargeDelta=function(delta,MAX){for(var lines=delta.lines,l=lines.length,row=delta.start.row,column=delta.start.column,from=0,to=0;;){from=to,to+=MAX-1;var chunk=lines.slice(from,to);if(to>l){delta.lines=chunk,delta.start.row=row+from,delta.start.column=column;break}chunk.push(\"\"),this.applyDelta({start:this.pos(row+from,column),end:this.pos(row+to,column=0),action:delta.action,lines:chunk},!0)}},this.revertDelta=function(delta){this.applyDelta({start:this.clonePos(delta.start),end:this.clonePos(delta.end),action:\"insert\"==delta.action?\"remove\":\"insert\",lines:delta.lines.slice()})},this.indexToPosition=function(index,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,i=startRow||0,l=lines.length;l>i;i++)if(index-=lines[i].length+newlineLength,0>index)return{row:i,column:index+lines[i].length+newlineLength};return{row:l-1,column:lines[l-1].length}},this.positionToIndex=function(pos,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,index=0,row=Math.min(pos.row,lines.length),i=startRow||0;row>i;++i)index+=lines[i].length+newlineLength;return index+pos.column}}).call(Document.prototype),exports.Document=Document}),ace.define(\"ace/lib/lang\",[\"require\",\"exports\",\"module\"],function(acequire,exports){\"use strict\";exports.last=function(a){return a[a.length-1]},exports.stringReverse=function(string){return string.split(\"\").reverse().join(\"\")},exports.stringRepeat=function(string,count){for(var result=\"\";count>0;)1&count&&(result+=string),(count>>=1)&&(string+=string);return result};var trimBeginRegexp=/^\\s\\s*/,trimEndRegexp=/\\s\\s*$/;exports.stringTrimLeft=function(string){return string.replace(trimBeginRegexp,\"\")},exports.stringTrimRight=function(string){return string.replace(trimEndRegexp,\"\")},exports.copyObject=function(obj){var copy={};for(var key in obj)copy[key]=obj[key];return copy},exports.copyArray=function(array){for(var copy=[],i=0,l=array.length;l>i;i++)copy[i]=array[i]&&\"object\"==typeof array[i]?this.copyObject(array[i]):array[i];return copy},exports.deepCopy=function deepCopy(obj){if(\"object\"!=typeof obj||!obj)return obj;var copy;if(Array.isArray(obj)){copy=[];for(var key=0;obj.length>key;key++)copy[key]=deepCopy(obj[key]);return copy}if(\"[object Object]\"!==Object.prototype.toString.call(obj))return obj;copy={};for(var key in obj)copy[key]=deepCopy(obj[key]);return copy},exports.arrayToMap=function(arr){for(var map={},i=0;arr.length>i;i++)map[arr[i]]=1;return map},exports.createMap=function(props){var map=Object.create(null);for(var i in props)map[i]=props[i];return map},exports.arrayRemove=function(array,value){for(var i=0;array.length>=i;i++)value===array[i]&&array.splice(i,1)},exports.escapeRegExp=function(str){return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g,\"\\\\$1\")},exports.escapeHTML=function(str){return str.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/'/g,\"'\").replace(/i;i+=2){if(Array.isArray(data[i+1]))var d={action:\"insert\",start:data[i],lines:data[i+1]};else var d={action:\"remove\",start:data[i],end:data[i+1]};doc.applyDelta(d,!0)}return _self.$timeout?deferredUpdate.schedule(_self.$timeout):(_self.onUpdate(),void 0)})};(function(){this.$timeout=500,this.setTimeout=function(timeout){this.$timeout=timeout},this.setValue=function(value){this.doc.setValue(value),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(callbackId){this.sender.callback(this.doc.getValue(),callbackId)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(Mirror.prototype)}),ace.define(\"ace/mode/javascript/jshint\",[\"require\",\"exports\",\"module\"],function(acequire,exports,module){module.exports=function outer(modules,cache,entry){function newRequire(name,jumped){if(!cache[name]){if(!modules[name]){var currentRequire=\"function\"==typeof acequire&&acequire;if(!jumped&¤tRequire)return currentRequire(name,!0);if(previousRequire)return previousRequire(name,!0);var err=Error(\"Cannot find module '\"+name+\"'\");throw err.code=\"MODULE_NOT_FOUND\",err}var m=cache[name]={exports:{}};modules[name][0].call(m.exports,function(x){var id=modules[name][1][x];return newRequire(id?id:x)},m,m.exports,outer,modules,cache,entry)}return cache[name].exports}for(var previousRequire=\"function\"==typeof acequire&&acequire,i=0;entry.length>i;i++)newRequire(entry[i]);return newRequire(entry[0])}({\"/node_modules/browserify/node_modules/events/events.js\":[function(_dereq_,module){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return\"function\"==typeof arg}function isNumber(arg){return\"number\"==typeof arg}function isObject(arg){return\"object\"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||0>n||isNaN(n))throw TypeError(\"n must be a positive number\");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),\"error\"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(er=arguments[1],er instanceof Error)throw er;throw TypeError('Uncaught, unspecified \"error\" event.')}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:for(len=arguments.length,args=Array(len-1),i=1;len>i;i++)args[i-1]=arguments[i];handler.apply(this,args)}else if(isObject(handler)){for(len=arguments.length,args=Array(len-1),i=1;len>i;i++)args[i-1]=arguments[i];for(listeners=handler.slice(),len=listeners.length,i=0;len>i;i++)listeners[i].apply(this,args)}return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError(\"listener must be a function\");if(this._events||(this._events={}),this._events.newListener&&this.emit(\"newListener\",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned){var m;m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,m&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error(\"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.\",this._events[type].length),\"function\"==typeof console.trace&&console.trace())}return this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError(\"listener must be a function\");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError(\"listener must be a function\");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit(\"removeListener\",type,listener);else if(isObject(list)){for(i=length;i-->0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(0>position)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit(\"removeListener\",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)\"removeListener\"!==key&&this.removeAllListeners(key);return this.removeAllListeners(\"removeListener\"),this._events={},this\n}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.listenerCount=function(emitter,type){var ret;return ret=emitter._events&&emitter._events[type]?isFunction(emitter._events[type])?1:emitter._events[type].length:0}},{}],\"/node_modules/jshint/data/ascii-identifier-data.js\":[function(_dereq_,module){for(var identifierStartTable=[],i=0;128>i;i++)identifierStartTable[i]=36===i||i>=65&&90>=i||95===i||i>=97&&122>=i;for(var identifierPartTable=[],i=0;128>i;i++)identifierPartTable[i]=identifierStartTable[i]||i>=48&&57>=i;module.exports={asciiIdentifierStartTable:identifierStartTable,asciiIdentifierPartTable:identifierPartTable}},{}],\"/node_modules/jshint/lodash.js\":[function(_dereq_,module,exports){(function(global){(function(){function baseFindIndex(array,predicate,fromRight){for(var length=array.length,index=fromRight?length:-1;fromRight?index--:length>++index;)if(predicate(array[index],index,array))return index;return-1}function baseIndexOf(array,value,fromIndex){if(value!==value)return indexOfNaN(array,fromIndex);for(var index=fromIndex-1,length=array.length;length>++index;)if(array[index]===value)return index;return-1}function baseIsFunction(value){return\"function\"==typeof value||!1}function baseToString(value){return\"string\"==typeof value?value:null==value?\"\":value+\"\"}function indexOfNaN(array,fromIndex,fromRight){for(var length=array.length,index=fromIndex+(fromRight?0:-1);fromRight?index--:length>++index;){var other=array[index];if(other!==other)return index}return-1}function isObjectLike(value){return!!value&&\"object\"==typeof value}function lodash(){}function arrayCopy(source,array){var index=-1,length=source.length;for(array||(array=Array(length));length>++index;)array[index]=source[index];return array}function arrayEach(array,iteratee){for(var index=-1,length=array.length;length>++index&&iteratee(array[index],index,array)!==!1;);return array}function arrayFilter(array,predicate){for(var index=-1,length=array.length,resIndex=-1,result=[];length>++index;){var value=array[index];predicate(value,index,array)&&(result[++resIndex]=value)}return result}function arrayMap(array,iteratee){for(var index=-1,length=array.length,result=Array(length);length>++index;)result[index]=iteratee(array[index],index,array);return result}function arrayMax(array){for(var index=-1,length=array.length,result=NEGATIVE_INFINITY;length>++index;){var value=array[index];value>result&&(result=value)}return result}function arraySome(array,predicate){for(var index=-1,length=array.length;length>++index;)if(predicate(array[index],index,array))return!0;return!1}function assignWith(object,source,customizer){var props=keys(source);push.apply(props,getSymbols(source));for(var index=-1,length=props.length;length>++index;){var key=props[index],value=object[key],result=customizer(value,source[key],key,object,source);(result===result?result===value:value!==value)&&(value!==undefined||key in object)||(object[key]=result)}return object}function baseCopy(source,props,object){object||(object={});for(var index=-1,length=props.length;length>++index;){var key=props[index];object[key]=source[key]}return object}function baseCallback(func,thisArg,argCount){var type=typeof func;return\"function\"==type?thisArg===undefined?func:bindCallback(func,thisArg,argCount):null==func?identity:\"object\"==type?baseMatches(func):thisArg===undefined?property(func):baseMatchesProperty(func,thisArg)}function baseClone(value,isDeep,customizer,key,object,stackA,stackB){var result;if(customizer&&(result=object?customizer(value,key,object):customizer(value)),result!==undefined)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=initCloneArray(value),!isDeep)return arrayCopy(value,result)}else{var tag=objToString.call(value),isFunc=tag==funcTag;if(tag!=objectTag&&tag!=argsTag&&(!isFunc||object))return cloneableTags[tag]?initCloneByTag(value,tag,isDeep):object?value:{};if(result=initCloneObject(isFunc?{}:value),!isDeep)return baseAssign(result,value)}stackA||(stackA=[]),stackB||(stackB=[]);for(var length=stackA.length;length--;)if(stackA[length]==value)return stackB[length];return stackA.push(value),stackB.push(result),(isArr?arrayEach:baseForOwn)(value,function(subValue,key){result[key]=baseClone(subValue,isDeep,customizer,key,value,stackA,stackB)}),result}function baseFilter(collection,predicate){var result=[];return baseEach(collection,function(value,index,collection){predicate(value,index,collection)&&result.push(value)}),result}function baseForIn(object,iteratee){return baseFor(object,iteratee,keysIn)}function baseForOwn(object,iteratee){return baseFor(object,iteratee,keys)}function baseGet(object,path,pathKey){if(null!=object){pathKey!==undefined&&pathKey in toObject(object)&&(path=[pathKey]);for(var index=-1,length=path.length;null!=object&&length>++index;)var result=object=object[path[index]];return result}}function baseIsEqual(value,other,customizer,isLoose,stackA,stackB){if(value===other)return 0!==value||1/value==1/other;var valType=typeof value,othType=typeof other;return\"function\"!=valType&&\"object\"!=valType&&\"function\"!=othType&&\"object\"!=othType||null==value||null==other?value!==value&&other!==other:baseIsEqualDeep(value,other,baseIsEqual,customizer,isLoose,stackA,stackB)}function baseIsEqualDeep(object,other,equalFunc,customizer,isLoose,stackA,stackB){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=arrayTag,othTag=arrayTag;objIsArr||(objTag=objToString.call(object),objTag==argsTag?objTag=objectTag:objTag!=objectTag&&(objIsArr=isTypedArray(object))),othIsArr||(othTag=objToString.call(other),othTag==argsTag?othTag=objectTag:othTag!=objectTag&&(othIsArr=isTypedArray(other)));var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&!objIsArr&&!objIsObj)return equalByTag(object,other,objTag);if(!isLoose){var valWrapped=objIsObj&&hasOwnProperty.call(object,\"__wrapped__\"),othWrapped=othIsObj&&hasOwnProperty.call(other,\"__wrapped__\");if(valWrapped||othWrapped)return equalFunc(valWrapped?object.value():object,othWrapped?other.value():other,customizer,isLoose,stackA,stackB)}if(!isSameTag)return!1;stackA||(stackA=[]),stackB||(stackB=[]);for(var length=stackA.length;length--;)if(stackA[length]==object)return stackB[length]==other;stackA.push(object),stackB.push(other);var result=(objIsArr?equalArrays:equalObjects)(object,other,equalFunc,customizer,isLoose,stackA,stackB);return stackA.pop(),stackB.pop(),result}function baseIsMatch(object,props,values,strictCompareFlags,customizer){for(var index=-1,length=props.length,noCustomizer=!customizer;length>++index;)if(noCustomizer&&strictCompareFlags[index]?values[index]!==object[props[index]]:!(props[index]in object))return!1;for(index=-1;length>++index;){var key=props[index],objValue=object[key],srcValue=values[index];if(noCustomizer&&strictCompareFlags[index])var result=objValue!==undefined||key in object;else result=customizer?customizer(objValue,srcValue,key):undefined,result===undefined&&(result=baseIsEqual(srcValue,objValue,customizer,!0));if(!result)return!1}return!0}function baseMatches(source){var props=keys(source),length=props.length;if(!length)return constant(!0);if(1==length){var key=props[0],value=source[key];if(isStrictComparable(value))return function(object){return null==object?!1:object[key]===value&&(value!==undefined||key in toObject(object))}}for(var values=Array(length),strictCompareFlags=Array(length);length--;)value=source[props[length]],values[length]=value,strictCompareFlags[length]=isStrictComparable(value);return function(object){return null!=object&&baseIsMatch(toObject(object),props,values,strictCompareFlags)}}function baseMatchesProperty(path,value){var isArr=isArray(path),isCommon=isKey(path)&&isStrictComparable(value),pathKey=path+\"\";return path=toPath(path),function(object){if(null==object)return!1;var key=pathKey;if(object=toObject(object),!(!isArr&&isCommon||key in object)){if(object=1==path.length?object:baseGet(object,baseSlice(path,0,-1)),null==object)return!1;key=last(path),object=toObject(object)}return object[key]===value?value!==undefined||key in object:baseIsEqual(value,object[key],null,!0)}}function baseMerge(object,source,customizer,stackA,stackB){if(!isObject(object))return object;var isSrcArr=isLength(source.length)&&(isArray(source)||isTypedArray(source));if(!isSrcArr){var props=keys(source);push.apply(props,getSymbols(source))}return arrayEach(props||source,function(srcValue,key){if(props&&(key=srcValue,srcValue=source[key]),isObjectLike(srcValue))stackA||(stackA=[]),stackB||(stackB=[]),baseMergeDeep(object,source,key,baseMerge,customizer,stackA,stackB);else{var value=object[key],result=customizer?customizer(value,srcValue,key,object,source):undefined,isCommon=result===undefined;isCommon&&(result=srcValue),!isSrcArr&&result===undefined||!isCommon&&(result===result?result===value:value!==value)||(object[key]=result)}}),object}function baseMergeDeep(object,source,key,mergeFunc,customizer,stackA,stackB){for(var length=stackA.length,srcValue=source[key];length--;)if(stackA[length]==srcValue)return object[key]=stackB[length],undefined;var value=object[key],result=customizer?customizer(value,srcValue,key,object,source):undefined,isCommon=result===undefined;isCommon&&(result=srcValue,isLength(srcValue.length)&&(isArray(srcValue)||isTypedArray(srcValue))?result=isArray(value)?value:getLength(value)?arrayCopy(value):[]:isPlainObject(srcValue)||isArguments(srcValue)?result=isArguments(value)?toPlainObject(value):isPlainObject(value)?value:{}:isCommon=!1),stackA.push(srcValue),stackB.push(result),isCommon?object[key]=mergeFunc(result,srcValue,customizer,stackA,stackB):(result===result?result!==value:value===value)&&(object[key]=result)}function baseProperty(key){return function(object){return null==object?undefined:object[key]}}function basePropertyDeep(path){var pathKey=path+\"\";return path=toPath(path),function(object){return baseGet(object,path,pathKey)}}function baseSlice(array,start,end){var index=-1,length=array.length;start=null==start?0:+start||0,0>start&&(start=-start>length?0:length+start),end=end===undefined||end>length?length:+end||0,0>end&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);length>++index;)result[index]=array[index+start];return result}function baseSome(collection,predicate){var result;return baseEach(collection,function(value,index,collection){return result=predicate(value,index,collection),!result}),!!result}function baseValues(object,props){for(var index=-1,length=props.length,result=Array(length);length>++index;)result[index]=object[props[index]];return result}function binaryIndex(array,value,retHighest){var low=0,high=array?array.length:low;if(\"number\"==typeof value&&value===value&&HALF_MAX_ARRAY_LENGTH>=high){for(;high>low;){var mid=low+high>>>1,computed=array[mid];(retHighest?value>=computed:value>computed)?low=mid+1:high=mid}return high}return binaryIndexBy(array,value,identity,retHighest)}function binaryIndexBy(array,value,iteratee,retHighest){value=iteratee(value);for(var low=0,high=array?array.length:0,valIsNaN=value!==value,valIsUndef=value===undefined;high>low;){var mid=floor((low+high)/2),computed=iteratee(array[mid]),isReflexive=computed===computed;if(valIsNaN)var setLow=isReflexive||retHighest;else setLow=valIsUndef?isReflexive&&(retHighest||computed!==undefined):retHighest?value>=computed:value>computed;setLow?low=mid+1:high=mid}return nativeMin(high,MAX_ARRAY_INDEX)}function bindCallback(func,thisArg,argCount){if(\"function\"!=typeof func)return identity;if(thisArg===undefined)return func;switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)};case 5:return function(value,other,key,object,source){return func.call(thisArg,value,other,key,object,source)}}return function(){return func.apply(thisArg,arguments)}}function bufferClone(buffer){return bufferSlice.call(buffer,0)}function createAssigner(assigner){return restParam(function(object,sources){var index=-1,length=null==object?0:sources.length,customizer=length>2&&sources[length-2],guard=length>2&&sources[2],thisArg=length>1&&sources[length-1];for(\"function\"==typeof customizer?(customizer=bindCallback(customizer,thisArg,5),length-=2):(customizer=\"function\"==typeof thisArg?thisArg:null,length-=customizer?1:0),guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=3>length?null:customizer,length=1);length>++index;){var source=sources[index];source&&assigner(object,source,customizer)}return object})}function createBaseEach(eachFunc,fromRight){return function(collection,iteratee){var length=collection?getLength(collection):0;if(!isLength(length))return eachFunc(collection,iteratee);for(var index=fromRight?length:-1,iterable=toObject(collection);(fromRight?index--:length>++index)&&iteratee(iterable[index],index,iterable)!==!1;);return collection}}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){for(var iterable=toObject(object),props=keysFunc(object),length=props.length,index=fromRight?length:-1;fromRight?index--:length>++index;){var key=props[index];if(iteratee(iterable[key],key,iterable)===!1)break}return object}}function createFindIndex(fromRight){return function(array,predicate,thisArg){return array&&array.length?(predicate=getCallback(predicate,thisArg,3),baseFindIndex(array,predicate,fromRight)):-1}}function createForEach(arrayFunc,eachFunc){return function(collection,iteratee,thisArg){return\"function\"==typeof iteratee&&thisArg===undefined&&isArray(collection)?arrayFunc(collection,iteratee):eachFunc(collection,bindCallback(iteratee,thisArg,3))}}function equalArrays(array,other,equalFunc,customizer,isLoose,stackA,stackB){var index=-1,arrLength=array.length,othLength=other.length,result=!0;if(arrLength!=othLength&&!(isLoose&&othLength>arrLength))return!1;for(;result&&arrLength>++index;){var arrValue=array[index],othValue=other[index];if(result=undefined,customizer&&(result=isLoose?customizer(othValue,arrValue,index):customizer(arrValue,othValue,index)),result===undefined)if(isLoose)for(var othIndex=othLength;othIndex--&&(othValue=other[othIndex],!(result=arrValue&&arrValue===othValue||equalFunc(arrValue,othValue,customizer,isLoose,stackA,stackB))););else result=arrValue&&arrValue===othValue||equalFunc(arrValue,othValue,customizer,isLoose,stackA,stackB)}return!!result}function equalByTag(object,other,tag){switch(tag){case boolTag:case dateTag:return+object==+other;case errorTag:return object.name==other.name&&object.message==other.message;case numberTag:return object!=+object?other!=+other:0==object?1/object==1/other:object==+other;case regexpTag:case stringTag:return object==other+\"\"}return!1}function equalObjects(object,other,equalFunc,customizer,isLoose,stackA,stackB){var objProps=keys(object),objLength=objProps.length,othProps=keys(other),othLength=othProps.length;if(objLength!=othLength&&!isLoose)return!1;for(var skipCtor=isLoose,index=-1;objLength>++index;){var key=objProps[index],result=isLoose?key in other:hasOwnProperty.call(other,key);if(result){var objValue=object[key],othValue=other[key];result=undefined,customizer&&(result=isLoose?customizer(othValue,objValue,key):customizer(objValue,othValue,key)),result===undefined&&(result=objValue&&objValue===othValue||equalFunc(objValue,othValue,customizer,isLoose,stackA,stackB))}if(!result)return!1;skipCtor||(skipCtor=\"constructor\"==key)}if(!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;if(objCtor!=othCtor&&\"constructor\"in object&&\"constructor\"in other&&!(\"function\"==typeof objCtor&&objCtor instanceof objCtor&&\"function\"==typeof othCtor&&othCtor instanceof othCtor))return!1}return!0}function getCallback(func,thisArg,argCount){var result=lodash.callback||callback;return result=result===callback?baseCallback:result,argCount?result(func,thisArg,argCount):result}function getIndexOf(collection,target,fromIndex){var result=lodash.indexOf||indexOf;return result=result===indexOf?baseIndexOf:result,collection?result(collection,target,fromIndex):result}function initCloneArray(array){var length=array.length,result=new array.constructor(length);return length&&\"string\"==typeof array[0]&&hasOwnProperty.call(array,\"index\")&&(result.index=array.index,result.input=array.input),result}function initCloneObject(object){var Ctor=object.constructor;return\"function\"==typeof Ctor&&Ctor instanceof Ctor||(Ctor=Object),new Ctor}function initCloneByTag(object,tag,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return bufferClone(object);case boolTag:case dateTag:return new Ctor(+object);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:var buffer=object.buffer;return new Ctor(isDeep?bufferClone(buffer):buffer,object.byteOffset,object.length);case numberTag:case stringTag:return new Ctor(object);case regexpTag:var result=new Ctor(object.source,reFlags.exec(object));result.lastIndex=object.lastIndex}return result}function isIndex(value,length){return value=+value,length=null==length?MAX_SAFE_INTEGER:length,value>-1&&0==value%1&&length>value}function isIterateeCall(value,index,object){if(!isObject(object))return!1;var type=typeof index;if(\"number\"==type)var length=getLength(object),prereq=isLength(length)&&isIndex(index,length);else prereq=\"string\"==type&&index in object;if(prereq){var other=object[index];return value===value?value===other:other!==other}return!1}function isKey(value,object){var type=typeof value;if(\"string\"==type&&reIsPlainProp.test(value)||\"number\"==type)return!0;if(isArray(value))return!1;var result=!reIsDeepProp.test(value);return result||null!=object&&value in toObject(object)}function isLength(value){return\"number\"==typeof value&&value>-1&&0==value%1&&MAX_SAFE_INTEGER>=value}function isStrictComparable(value){return value===value&&(0===value?1/value>0:!isObject(value))}function shimIsPlainObject(value){var Ctor;if(lodash.support,!isObjectLike(value)||objToString.call(value)!=objectTag||!hasOwnProperty.call(value,\"constructor\")&&(Ctor=value.constructor,\"function\"==typeof Ctor&&!(Ctor instanceof Ctor)))return!1;var result;return baseForIn(value,function(subValue,key){result=key}),result===undefined||hasOwnProperty.call(value,result)}function shimKeys(object){for(var props=keysIn(object),propsLength=props.length,length=propsLength&&object.length,support=lodash.support,allowIndexes=length&&isLength(length)&&(isArray(object)||support.nonEnumArgs&&isArguments(object)),index=-1,result=[];propsLength>++index;){var key=props[index];(allowIndexes&&isIndex(key,length)||hasOwnProperty.call(object,key))&&result.push(key)}return result}function toObject(value){return isObject(value)?value:Object(value)}function toPath(value){if(isArray(value))return value;var result=[];return baseToString(value).replace(rePropName,function(match,number,quote,string){result.push(quote?string.replace(reEscapeChar,\"$1\"):number||match)}),result}function indexOf(array,value,fromIndex){var length=array?array.length:0;if(!length)return-1;if(\"number\"==typeof fromIndex)fromIndex=0>fromIndex?nativeMax(length+fromIndex,0):fromIndex;else if(fromIndex){var index=binaryIndex(array,value),other=array[index];return(value===value?value===other:other!==other)?index:-1}return baseIndexOf(array,value,fromIndex||0)}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function slice(array,start,end){var length=array?array.length:0;return length?(end&&\"number\"!=typeof end&&isIterateeCall(array,start,end)&&(start=0,end=length),baseSlice(array,start,end)):[]}function unzip(array){for(var index=-1,length=(array&&array.length&&arrayMax(arrayMap(array,getLength)))>>>0,result=Array(length);length>++index;)result[index]=arrayMap(array,baseProperty(index));return result}function includes(collection,target,fromIndex,guard){var length=collection?getLength(collection):0;return isLength(length)||(collection=values(collection),length=collection.length),length?(fromIndex=\"number\"!=typeof fromIndex||guard&&isIterateeCall(target,fromIndex,guard)?0:0>fromIndex?nativeMax(length+fromIndex,0):fromIndex||0,\"string\"==typeof collection||!isArray(collection)&&isString(collection)?length>fromIndex&&collection.indexOf(target,fromIndex)>-1:getIndexOf(collection,target,fromIndex)>-1):!1}function reject(collection,predicate,thisArg){var func=isArray(collection)?arrayFilter:baseFilter;return predicate=getCallback(predicate,thisArg,3),func(collection,function(value,index,collection){return!predicate(value,index,collection)})}function some(collection,predicate,thisArg){var func=isArray(collection)?arraySome:baseSome;return thisArg&&isIterateeCall(collection,predicate,thisArg)&&(predicate=null),(\"function\"!=typeof predicate||thisArg!==undefined)&&(predicate=getCallback(predicate,thisArg,3)),func(collection,predicate)}function restParam(func,start){if(\"function\"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=nativeMax(start===undefined?func.length-1:+start||0,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),rest=Array(length);length>++index;)rest[index]=args[start+index];switch(start){case 0:return func.call(this,rest);case 1:return func.call(this,args[0],rest);case 2:return func.call(this,args[0],args[1],rest)}var otherArgs=Array(start+1);for(index=-1;start>++index;)otherArgs[index]=args[index];return otherArgs[start]=rest,func.apply(this,otherArgs)}}function clone(value,isDeep,customizer,thisArg){return isDeep&&\"boolean\"!=typeof isDeep&&isIterateeCall(value,isDeep,customizer)?isDeep=!1:\"function\"==typeof isDeep&&(thisArg=customizer,customizer=isDeep,isDeep=!1),customizer=\"function\"==typeof customizer&&bindCallback(customizer,thisArg,1),baseClone(value,isDeep,customizer)}function isArguments(value){var length=isObjectLike(value)?value.length:undefined;return isLength(length)&&objToString.call(value)==argsTag}function isEmpty(value){if(null==value)return!0;var length=getLength(value);return isLength(length)&&(isArray(value)||isString(value)||isArguments(value)||isObjectLike(value)&&isFunction(value.splice))?!length:!keys(value).length}function isObject(value){var type=typeof value;return\"function\"==type||!!value&&\"object\"==type}function isNative(value){return null==value?!1:objToString.call(value)==funcTag?reIsNative.test(fnToString.call(value)):isObjectLike(value)&&reIsHostCtor.test(value)}function isNumber(value){return\"number\"==typeof value||isObjectLike(value)&&objToString.call(value)==numberTag}function isString(value){return\"string\"==typeof value||isObjectLike(value)&&objToString.call(value)==stringTag}function isTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[objToString.call(value)]}function toPlainObject(value){return baseCopy(value,keysIn(value))}function has(object,path){if(null==object)return!1;var result=hasOwnProperty.call(object,path);return result||isKey(path)||(path=toPath(path),object=1==path.length?object:baseGet(object,baseSlice(path,0,-1)),path=last(path),result=null!=object&&hasOwnProperty.call(object,path)),result}function keysIn(object){if(null==object)return[];isObject(object)||(object=Object(object));var length=object.length;length=length&&isLength(length)&&(isArray(object)||support.nonEnumArgs&&isArguments(object))&&length||0;for(var Ctor=object.constructor,index=-1,isProto=\"function\"==typeof Ctor&&Ctor.prototype===object,result=Array(length),skipIndexes=length>0;length>++index;)result[index]=index+\"\";for(var key in object)skipIndexes&&isIndex(key,length)||\"constructor\"==key&&(isProto||!hasOwnProperty.call(object,key))||result.push(key);return result}function values(object){return baseValues(object,keys(object))}function escapeRegExp(string){return string=baseToString(string),string&&reHasRegExpChars.test(string)?string.replace(reRegExpChars,\"\\\\$&\"):string}function callback(func,thisArg,guard){return guard&&isIterateeCall(func,thisArg,guard)&&(thisArg=null),baseCallback(func,thisArg)}function constant(value){return function(){return value}}function identity(value){return value}function property(path){return isKey(path)?baseProperty(path):basePropertyDeep(path)}var undefined,VERSION=\"3.7.0\",FUNC_ERROR_TEXT=\"Expected a function\",argsTag=\"[object Arguments]\",arrayTag=\"[object Array]\",boolTag=\"[object Boolean]\",dateTag=\"[object Date]\",errorTag=\"[object Error]\",funcTag=\"[object Function]\",mapTag=\"[object Map]\",numberTag=\"[object Number]\",objectTag=\"[object Object]\",regexpTag=\"[object RegExp]\",setTag=\"[object Set]\",stringTag=\"[object String]\",weakMapTag=\"[object WeakMap]\",arrayBufferTag=\"[object ArrayBuffer]\",float32Tag=\"[object Float32Array]\",float64Tag=\"[object Float64Array]\",int8Tag=\"[object Int8Array]\",int16Tag=\"[object Int16Array]\",int32Tag=\"[object Int32Array]\",uint8Tag=\"[object Uint8Array]\",uint8ClampedTag=\"[object Uint8ClampedArray]\",uint16Tag=\"[object Uint16Array]\",uint32Tag=\"[object Uint32Array]\",reIsDeepProp=/\\.|\\[(?:[^[\\]]+|([\"'])(?:(?!\\1)[^\\n\\\\]|\\\\.)*?)\\1\\]/,reIsPlainProp=/^\\w*$/,rePropName=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\n\\\\]|\\\\.)*?)\\2)\\]/g,reRegExpChars=/[.*+?^${}()|[\\]\\/\\\\]/g,reHasRegExpChars=RegExp(reRegExpChars.source),reEscapeChar=/\\\\(\\\\)?/g,reFlags=/\\w*$/,reIsHostCtor=/^\\[object .+?Constructor\\]$/,typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[stringTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[mapTag]=cloneableTags[setTag]=cloneableTags[weakMapTag]=!1;var objectTypes={\"function\":!0,object:!0},freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports,freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module,freeGlobal=freeExports&&freeModule&&\"object\"==typeof global&&global&&global.Object&&global,freeSelf=objectTypes[typeof self]&&self&&self.Object&&self,freeWindow=objectTypes[typeof window]&&window&&window.Object&&window,moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports,root=freeGlobal||freeWindow!==(this&&this.window)&&freeWindow||freeSelf||this,arrayProto=Array.prototype,objectProto=Object.prototype,fnToString=Function.prototype.toString,hasOwnProperty=objectProto.hasOwnProperty,objToString=objectProto.toString,reIsNative=RegExp(\"^\"+escapeRegExp(objToString).replace(/toString|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,\"$1.*?\")+\"$\"),ArrayBuffer=isNative(ArrayBuffer=root.ArrayBuffer)&&ArrayBuffer,bufferSlice=isNative(bufferSlice=ArrayBuffer&&new ArrayBuffer(0).slice)&&bufferSlice,floor=Math.floor,getOwnPropertySymbols=isNative(getOwnPropertySymbols=Object.getOwnPropertySymbols)&&getOwnPropertySymbols,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,push=arrayProto.push,preventExtensions=isNative(Object.preventExtensions=Object.preventExtensions)&&preventExtensions,propertyIsEnumerable=objectProto.propertyIsEnumerable,Uint8Array=isNative(Uint8Array=root.Uint8Array)&&Uint8Array,Float64Array=function(){try{var func=isNative(func=root.Float64Array)&&func,result=new func(new ArrayBuffer(10),0,1)&&func}catch(e){}return result}(),nativeAssign=function(){var object={1:0},func=preventExtensions&&isNative(func=Object.assign)&&func;try{func(preventExtensions(object),\"xo\")}catch(e){}return!object[1]&&func}(),nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,MAX_ARRAY_LENGTH=Math.pow(2,32)-1,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1,FLOAT64_BYTES_PER_ELEMENT=Float64Array?Float64Array.BYTES_PER_ELEMENT:0,MAX_SAFE_INTEGER=Math.pow(2,53)-1,support=lodash.support={};(function(x){var Ctor=function(){this.x=x},props=[];Ctor.prototype={valueOf:x,y:x};for(var key in new Ctor)props.push(key);support.funcDecomp=/\\bthis\\b/.test(function(){return this}),support.funcNames=\"string\"==typeof Function.name;try{support.nonEnumArgs=!propertyIsEnumerable.call(arguments,1)}catch(e){support.nonEnumArgs=!0}})(1,0);var baseAssign=nativeAssign||function(object,source){return null==source?object:baseCopy(source,getSymbols(source),baseCopy(source,keys(source),object))},baseEach=createBaseEach(baseForOwn),baseFor=createBaseFor();bufferSlice||(bufferClone=ArrayBuffer&&Uint8Array?function(buffer){var byteLength=buffer.byteLength,floatLength=Float64Array?floor(byteLength/FLOAT64_BYTES_PER_ELEMENT):0,offset=floatLength*FLOAT64_BYTES_PER_ELEMENT,result=new ArrayBuffer(byteLength);if(floatLength){var view=new Float64Array(result,0,floatLength);view.set(new Float64Array(buffer,0,floatLength))}return byteLength!=offset&&(view=new Uint8Array(result,offset),view.set(new Uint8Array(buffer,offset))),result}:constant(null));var getLength=baseProperty(\"length\"),getSymbols=getOwnPropertySymbols?function(object){return getOwnPropertySymbols(toObject(object))}:constant([]),findLastIndex=createFindIndex(!0),zip=restParam(unzip),forEach=createForEach(arrayEach,baseEach),isArray=nativeIsArray||function(value){return isObjectLike(value)&&isLength(value.length)&&objToString.call(value)==arrayTag},isFunction=baseIsFunction(/x/)||Uint8Array&&!baseIsFunction(Uint8Array)?function(value){return objToString.call(value)==funcTag}:baseIsFunction,isPlainObject=getPrototypeOf?function(value){if(!value||objToString.call(value)!=objectTag)return!1;var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)}:shimIsPlainObject,assign=createAssigner(function(object,source,customizer){return customizer?assignWith(object,source,customizer):baseAssign(object,source)}),keys=nativeKeys?function(object){if(object)var Ctor=object.constructor,length=object.length;return\"function\"==typeof Ctor&&Ctor.prototype===object||\"function\"!=typeof object&&isLength(length)?shimKeys(object):isObject(object)?nativeKeys(object):[]}:shimKeys,merge=createAssigner(baseMerge);lodash.assign=assign,lodash.callback=callback,lodash.constant=constant,lodash.forEach=forEach,lodash.keys=keys,lodash.keysIn=keysIn,lodash.merge=merge,lodash.property=property,lodash.reject=reject,lodash.restParam=restParam,lodash.slice=slice,lodash.toPlainObject=toPlainObject,lodash.unzip=unzip,lodash.values=values,lodash.zip=zip,lodash.each=forEach,lodash.extend=assign,lodash.iteratee=callback,lodash.clone=clone,lodash.escapeRegExp=escapeRegExp,lodash.findLastIndex=findLastIndex,lodash.has=has,lodash.identity=identity,lodash.includes=includes,lodash.indexOf=indexOf,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isEmpty=isEmpty,lodash.isFunction=isFunction,lodash.isNative=isNative,lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isPlainObject=isPlainObject,lodash.isString=isString,lodash.isTypedArray=isTypedArray,lodash.last=last,lodash.some=some,lodash.any=some,lodash.contains=includes,lodash.include=includes,lodash.VERSION=VERSION,freeExports&&freeModule?moduleExports?(freeModule.exports=lodash)._=lodash:freeExports._=lodash:root._=lodash\n}).call(this)}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}],\"/node_modules/jshint/src/jshint.js\":[function(_dereq_,module,exports){var _=_dereq_(\"../lodash\"),events=_dereq_(\"events\"),vars=_dereq_(\"./vars.js\"),messages=_dereq_(\"./messages.js\"),Lexer=_dereq_(\"./lex.js\").Lexer,reg=_dereq_(\"./reg.js\"),state=_dereq_(\"./state.js\").state,style=_dereq_(\"./style.js\"),options=_dereq_(\"./options.js\"),scopeManager=_dereq_(\"./scope-manager.js\"),JSHINT=function(){\"use strict\";function checkOption(name,t){return name=name.trim(),/^[+-]W\\d{3}$/g.test(name)?!0:-1!==options.validNames.indexOf(name)||\"jslint\"===t.type||_.has(options.removed,name)?!0:(error(\"E001\",t,name),!1)}function isString(obj){return\"[object String]\"===Object.prototype.toString.call(obj)}function isIdentifier(tkn,value){return tkn?tkn.identifier&&tkn.value===value?!0:!1:!1}function isReserved(token){if(!token.reserved)return!1;var meta=token.meta;if(meta&&meta.isFutureReservedWord&&state.inES5()){if(!meta.es5)return!1;if(meta.strictOnly&&!state.option.strict&&!state.isStrict())return!1;if(token.isProperty)return!1}return!0}function supplant(str,data){return str.replace(/\\{([^{}]*)\\}/g,function(a,b){var r=data[b];return\"string\"==typeof r||\"number\"==typeof r?r:a})}function combine(dest,src){Object.keys(src).forEach(function(name){_.has(JSHINT.blacklist,name)||(dest[name]=src[name])})}function processenforceall(){if(state.option.enforceall){for(var enforceopt in options.bool.enforcing)void 0!==state.option[enforceopt]||options.noenforceall[enforceopt]||(state.option[enforceopt]=!0);for(var relaxopt in options.bool.relaxing)void 0===state.option[relaxopt]&&(state.option[relaxopt]=!1)}}function assume(){processenforceall(),state.option.esversion||state.option.moz||(state.option.esversion=state.option.es3?3:state.option.esnext?6:5),state.inES5()&&combine(predefined,vars.ecmaIdentifiers[5]),state.inES6()&&combine(predefined,vars.ecmaIdentifiers[6]),state.option.module&&(state.option.strict===!0&&(state.option.strict=\"global\"),state.inES6()||warning(\"W134\",state.tokens.next,\"module\",6)),state.option.couch&&combine(predefined,vars.couch),state.option.qunit&&combine(predefined,vars.qunit),state.option.rhino&&combine(predefined,vars.rhino),state.option.shelljs&&(combine(predefined,vars.shelljs),combine(predefined,vars.node)),state.option.typed&&combine(predefined,vars.typed),state.option.phantom&&(combine(predefined,vars.phantom),state.option.strict===!0&&(state.option.strict=\"global\")),state.option.prototypejs&&combine(predefined,vars.prototypejs),state.option.node&&(combine(predefined,vars.node),combine(predefined,vars.typed),state.option.strict===!0&&(state.option.strict=\"global\")),state.option.devel&&combine(predefined,vars.devel),state.option.dojo&&combine(predefined,vars.dojo),state.option.browser&&(combine(predefined,vars.browser),combine(predefined,vars.typed)),state.option.browserify&&(combine(predefined,vars.browser),combine(predefined,vars.typed),combine(predefined,vars.browserify),state.option.strict===!0&&(state.option.strict=\"global\")),state.option.nonstandard&&combine(predefined,vars.nonstandard),state.option.jasmine&&combine(predefined,vars.jasmine),state.option.jquery&&combine(predefined,vars.jquery),state.option.mootools&&combine(predefined,vars.mootools),state.option.worker&&combine(predefined,vars.worker),state.option.wsh&&combine(predefined,vars.wsh),state.option.globalstrict&&state.option.strict!==!1&&(state.option.strict=\"global\"),state.option.yui&&combine(predefined,vars.yui),state.option.mocha&&combine(predefined,vars.mocha)}function quit(code,line,chr){var percentage=Math.floor(100*(line/state.lines.length)),message=messages.errors[code].desc;throw{name:\"JSHintError\",line:line,character:chr,message:message+\" (\"+percentage+\"% scanned).\",raw:message,code:code}}function removeIgnoredMessages(){var ignored=state.ignoredLines;_.isEmpty(ignored)||(JSHINT.errors=_.reject(JSHINT.errors,function(err){return ignored[err.line]}))}function warning(code,t,a,b,c,d){var ch,l,w,msg;if(/^W\\d{3}$/.test(code)){if(state.ignored[code])return;msg=messages.warnings[code]}else/E\\d{3}/.test(code)?msg=messages.errors[code]:/I\\d{3}/.test(code)&&(msg=messages.info[code]);return t=t||state.tokens.next||{},\"(end)\"===t.id&&(t=state.tokens.curr),l=t.line||0,ch=t.from||0,w={id:\"(error)\",raw:msg.desc,code:msg.code,evidence:state.lines[l-1]||\"\",line:l,character:ch,scope:JSHINT.scope,a:a,b:b,c:c,d:d},w.reason=supplant(msg.desc,w),JSHINT.errors.push(w),removeIgnoredMessages(),JSHINT.errors.length>=state.option.maxerr&&quit(\"E043\",l,ch),w}function warningAt(m,l,ch,a,b,c,d){return warning(m,{line:l,from:ch},a,b,c,d)}function error(m,t,a,b,c,d){warning(m,t,a,b,c,d)}function errorAt(m,l,ch,a,b,c,d){return error(m,{line:l,from:ch},a,b,c,d)}function addInternalSrc(elem,src){var i;return i={id:\"(internal)\",elem:elem,value:src},JSHINT.internals.push(i),i}function doOption(){var nt=state.tokens.next,body=nt.body.match(/(-\\s+)?[^\\s,:]+(?:\\s*:\\s*(-\\s+)?[^\\s,]+)?/g)||[],predef={};if(\"globals\"===nt.type){body.forEach(function(g,idx){g=g.split(\":\");var key=(g[0]||\"\").trim(),val=(g[1]||\"\").trim();if(\"-\"===key||!key.length){if(idx>0&&idx===body.length-1)return;return error(\"E002\",nt),void 0}\"-\"===key.charAt(0)?(key=key.slice(1),val=!1,JSHINT.blacklist[key]=key,delete predefined[key]):predef[key]=\"true\"===val}),combine(predefined,predef);for(var key in predef)_.has(predef,key)&&(declared[key]=nt)}\"exported\"===nt.type&&body.forEach(function(e,idx){if(!e.length){if(idx>0&&idx===body.length-1)return;return error(\"E002\",nt),void 0}state.funct[\"(scope)\"].addExported(e)}),\"members\"===nt.type&&(membersOnly=membersOnly||{},body.forEach(function(m){var ch1=m.charAt(0),ch2=m.charAt(m.length-1);ch1!==ch2||'\"'!==ch1&&\"'\"!==ch1||(m=m.substr(1,m.length-2).replace('\\\\\"','\"')),membersOnly[m]=!1}));var numvals=[\"maxstatements\",\"maxparams\",\"maxdepth\",\"maxcomplexity\",\"maxerr\",\"maxlen\",\"indent\"];(\"jshint\"===nt.type||\"jslint\"===nt.type)&&(body.forEach(function(g){g=g.split(\":\");var key=(g[0]||\"\").trim(),val=(g[1]||\"\").trim();if(checkOption(key,nt))if(numvals.indexOf(key)>=0)if(\"false\"!==val){if(val=+val,\"number\"!=typeof val||!isFinite(val)||0>=val||Math.floor(val)!==val)return error(\"E032\",nt,g[1].trim()),void 0;state.option[key]=val}else state.option[key]=\"indent\"===key?4:!1;else{if(\"validthis\"===key)return state.funct[\"(global)\"]?void error(\"E009\"):\"true\"!==val&&\"false\"!==val?void error(\"E002\",nt):(state.option.validthis=\"true\"===val,void 0);if(\"quotmark\"!==key)if(\"shadow\"!==key)if(\"unused\"!==key)if(\"latedef\"!==key)if(\"ignore\"!==key)if(\"strict\"!==key){\"module\"===key&&(hasParsedCode(state.funct)||error(\"E055\",state.tokens.next,\"module\"));var esversions={es3:3,es5:5,esnext:6};if(!_.has(esversions,key)){if(\"esversion\"===key){switch(val){case\"5\":state.inES5(!0)&&warning(\"I003\");case\"3\":case\"6\":state.option.moz=!1,state.option.esversion=+val;break;case\"2015\":state.option.moz=!1,state.option.esversion=6;break;default:error(\"E002\",nt)}return hasParsedCode(state.funct)||error(\"E055\",state.tokens.next,\"esversion\"),void 0}var match=/^([+-])(W\\d{3})$/g.exec(key);if(match)return state.ignored[match[2]]=\"-\"===match[1],void 0;var tn;return\"true\"===val||\"false\"===val?(\"jslint\"===nt.type?(tn=options.renamed[key]||key,state.option[tn]=\"true\"===val,void 0!==options.inverted[tn]&&(state.option[tn]=!state.option[tn])):state.option[key]=\"true\"===val,\"newcap\"===key&&(state.option[\"(explicitNewcap)\"]=!0),void 0):(error(\"E002\",nt),void 0)}switch(val){case\"true\":state.option.moz=!1,state.option.esversion=esversions[key];break;case\"false\":state.option.moz||(state.option.esversion=5);break;default:error(\"E002\",nt)}}else switch(val){case\"true\":state.option.strict=!0;break;case\"false\":state.option.strict=!1;break;case\"func\":case\"global\":case\"implied\":state.option.strict=val;break;default:error(\"E002\",nt)}else switch(val){case\"line\":state.ignoredLines[nt.line]=!0,removeIgnoredMessages();break;default:error(\"E002\",nt)}else switch(val){case\"true\":state.option.latedef=!0;break;case\"false\":state.option.latedef=!1;break;case\"nofunc\":state.option.latedef=\"nofunc\";break;default:error(\"E002\",nt)}else switch(val){case\"true\":state.option.unused=!0;break;case\"false\":state.option.unused=!1;break;case\"vars\":case\"strict\":state.option.unused=val;break;default:error(\"E002\",nt)}else switch(val){case\"true\":state.option.shadow=!0;break;case\"outer\":state.option.shadow=\"outer\";break;case\"false\":case\"inner\":state.option.shadow=\"inner\";break;default:error(\"E002\",nt)}else switch(val){case\"true\":case\"false\":state.option.quotmark=\"true\"===val;break;case\"double\":case\"single\":state.option.quotmark=val;break;default:error(\"E002\",nt)}}}),assume())}function peek(p){var t,i=p||0,j=lookahead.length;if(j>i)return lookahead[i];for(;i>=j;)t=lookahead[j],t||(t=lookahead[j]=lex.token()),j+=1;return t||\"(end)\"!==state.tokens.next.id?t:state.tokens.next}function peekIgnoreEOL(){var t,i=0;do t=peek(i++);while(\"(endline)\"===t.id);return t}function advance(id,t){switch(state.tokens.curr.id){case\"(number)\":\".\"===state.tokens.next.id&&warning(\"W005\",state.tokens.curr);break;case\"-\":(\"-\"===state.tokens.next.id||\"--\"===state.tokens.next.id)&&warning(\"W006\");break;case\"+\":(\"+\"===state.tokens.next.id||\"++\"===state.tokens.next.id)&&warning(\"W007\")}for(id&&state.tokens.next.id!==id&&(t?\"(end)\"===state.tokens.next.id?error(\"E019\",t,t.id):error(\"E020\",state.tokens.next,id,t.id,t.line,state.tokens.next.value):(\"(identifier)\"!==state.tokens.next.type||state.tokens.next.value!==id)&&warning(\"W116\",state.tokens.next,id,state.tokens.next.value)),state.tokens.prev=state.tokens.curr,state.tokens.curr=state.tokens.next;;){if(state.tokens.next=lookahead.shift()||lex.token(),state.tokens.next||quit(\"E041\",state.tokens.curr.line),\"(end)\"===state.tokens.next.id||\"(error)\"===state.tokens.next.id)return;if(state.tokens.next.check&&state.tokens.next.check(),state.tokens.next.isSpecial)\"falls through\"===state.tokens.next.type?state.tokens.curr.caseFallsThrough=!0:doOption();else if(\"(endline)\"!==state.tokens.next.id)break}}function isInfix(token){return token.infix||!token.identifier&&!token.template&&!!token.led}function isEndOfExpr(){var curr=state.tokens.curr,next=state.tokens.next;return\";\"===next.id||\"}\"===next.id||\":\"===next.id?!0:isInfix(next)===isInfix(curr)||\"yield\"===curr.id&&state.inMoz()?curr.line!==startLine(next):!1}function isBeginOfExpr(prev){return!prev.left&&\"unary\"!==prev.arity}function expression(rbp,initial){var left,isArray=!1,isObject=!1,isLetExpr=!1;state.nameStack.push(),initial||\"let\"!==state.tokens.next.value||\"(\"!==peek(0).value||(state.inMoz()||warning(\"W118\",state.tokens.next,\"let expressions\"),isLetExpr=!0,state.funct[\"(scope)\"].stack(),advance(\"let\"),advance(\"(\"),state.tokens.prev.fud(),advance(\")\")),\"(end)\"===state.tokens.next.id&&error(\"E006\",state.tokens.curr);var isDangerous=state.option.asi&&state.tokens.prev.line!==startLine(state.tokens.curr)&&_.contains([\"]\",\")\"],state.tokens.prev.id)&&_.contains([\"[\",\"(\"],state.tokens.curr.id);if(isDangerous&&warning(\"W014\",state.tokens.curr,state.tokens.curr.id),advance(),initial&&(state.funct[\"(verb)\"]=state.tokens.curr.value,state.tokens.curr.beginsStmt=!0),initial===!0&&state.tokens.curr.fud)left=state.tokens.curr.fud();else for(state.tokens.curr.nud?left=state.tokens.curr.nud():error(\"E030\",state.tokens.curr,state.tokens.curr.id);(state.tokens.next.lbp>rbp||\"(template)\"===state.tokens.next.type)&&!isEndOfExpr();)isArray=\"Array\"===state.tokens.curr.value,isObject=\"Object\"===state.tokens.curr.value,left&&(left.value||left.first&&left.first.value)&&(\"new\"!==left.value||left.first&&left.first.value&&\".\"===left.first.value)&&(isArray=!1,left.value!==state.tokens.curr.value&&(isObject=!1)),advance(),isArray&&\"(\"===state.tokens.curr.id&&\")\"===state.tokens.next.id&&warning(\"W009\",state.tokens.curr),isObject&&\"(\"===state.tokens.curr.id&&\")\"===state.tokens.next.id&&warning(\"W010\",state.tokens.curr),left&&state.tokens.curr.led?left=state.tokens.curr.led(left):error(\"E033\",state.tokens.curr,state.tokens.curr.id);return isLetExpr&&state.funct[\"(scope)\"].unstack(),state.nameStack.pop(),left}function startLine(token){return token.startLine||token.line}function nobreaknonadjacent(left,right){left=left||state.tokens.curr,right=right||state.tokens.next,state.option.laxbreak||left.line===startLine(right)||warning(\"W014\",right,right.value)}function nolinebreak(t){t=t||state.tokens.curr,t.line!==startLine(state.tokens.next)&&warning(\"E022\",t,t.value)}function nobreakcomma(left,right){left.line!==startLine(right)&&(state.option.laxcomma||(comma.first&&(warning(\"I001\"),comma.first=!1),warning(\"W014\",left,right.value)))}function comma(opts){if(opts=opts||{},opts.peek?nobreakcomma(state.tokens.prev,state.tokens.curr):(nobreakcomma(state.tokens.curr,state.tokens.next),advance(\",\")),state.tokens.next.identifier&&(!opts.property||!state.inES5()))switch(state.tokens.next.value){case\"break\":case\"case\":case\"catch\":case\"continue\":case\"default\":case\"do\":case\"else\":case\"finally\":case\"for\":case\"if\":case\"in\":case\"instanceof\":case\"return\":case\"switch\":case\"throw\":case\"try\":case\"var\":case\"let\":case\"while\":case\"with\":return error(\"E024\",state.tokens.next,state.tokens.next.value),!1}if(\"(punctuator)\"===state.tokens.next.type)switch(state.tokens.next.value){case\"}\":case\"]\":case\",\":if(opts.allowTrailing)return!0;case\")\":return error(\"E024\",state.tokens.next,state.tokens.next.value),!1}return!0}function symbol(s,p){var x=state.syntax[s];return x&&\"object\"==typeof x||(state.syntax[s]=x={id:s,lbp:p,value:s}),x}function delim(s){var x=symbol(s,0);return x.delim=!0,x}function stmt(s,f){var x=delim(s);return x.identifier=x.reserved=!0,x.fud=f,x}function blockstmt(s,f){var x=stmt(s,f);return x.block=!0,x}function reserveName(x){var c=x.id.charAt(0);return(c>=\"a\"&&\"z\">=c||c>=\"A\"&&\"Z\">=c)&&(x.identifier=x.reserved=!0),x}function prefix(s,f){var x=symbol(s,150);return reserveName(x),x.nud=\"function\"==typeof f?f:function(){return this.arity=\"unary\",this.right=expression(150),(\"++\"===this.id||\"--\"===this.id)&&(state.option.plusplus?warning(\"W016\",this,this.id):!this.right||this.right.identifier&&!isReserved(this.right)||\".\"===this.right.id||\"[\"===this.right.id||warning(\"W017\",this),this.right&&this.right.isMetaProperty?error(\"E031\",this):this.right&&this.right.identifier&&state.funct[\"(scope)\"].block.modify(this.right.value,this)),this},x}function type(s,f){var x=delim(s);return x.type=s,x.nud=f,x}function reserve(name,func){var x=type(name,func);return x.identifier=!0,x.reserved=!0,x}function FutureReservedWord(name,meta){var x=type(name,meta&&meta.nud||function(){return this});return meta=meta||{},meta.isFutureReservedWord=!0,x.value=name,x.identifier=!0,x.reserved=!0,x.meta=meta,x}function reservevar(s,v){return reserve(s,function(){return\"function\"==typeof v&&v(this),this})}function infix(s,f,p,w){var x=symbol(s,p);return reserveName(x),x.infix=!0,x.led=function(left){return w||nobreaknonadjacent(state.tokens.prev,state.tokens.curr),\"in\"!==s&&\"instanceof\"!==s||\"!\"!==left.id||warning(\"W018\",left,\"!\"),\"function\"==typeof f?f(left,this):(this.left=left,this.right=expression(p),this)},x}function application(s){var x=symbol(s,42);return x.led=function(left){return nobreaknonadjacent(state.tokens.prev,state.tokens.curr),this.left=left,this.right=doFunction({type:\"arrow\",loneArg:left}),this},x}function relation(s,f){var x=symbol(s,100);return x.led=function(left){nobreaknonadjacent(state.tokens.prev,state.tokens.curr),this.left=left;var right=this.right=expression(100);return isIdentifier(left,\"NaN\")||isIdentifier(right,\"NaN\")?warning(\"W019\",this):f&&f.apply(this,[left,right]),left&&right||quit(\"E041\",state.tokens.curr.line),\"!\"===left.id&&warning(\"W018\",left,\"!\"),\"!\"===right.id&&warning(\"W018\",right,\"!\"),this},x}function isPoorRelation(node){return node&&(\"(number)\"===node.type&&0===+node.value||\"(string)\"===node.type&&\"\"===node.value||\"null\"===node.type&&!state.option.eqnull||\"true\"===node.type||\"false\"===node.type||\"undefined\"===node.type)}function isTypoTypeof(left,right,state){var values;return state.option.notypeof?!1:left&&right?(values=state.inES6()?typeofValues.es6:typeofValues.es3,\"(identifier)\"===right.type&&\"typeof\"===right.value&&\"(string)\"===left.type?!_.contains(values,left.value):!1):!1}function isGlobalEval(left,state){var isGlobal=!1;return\"this\"===left.type&&null===state.funct[\"(context)\"]?isGlobal=!0:\"(identifier)\"===left.type&&(state.option.node&&\"global\"===left.value?isGlobal=!0:!state.option.browser||\"window\"!==left.value&&\"document\"!==left.value||(isGlobal=!0)),isGlobal}function findNativePrototype(left){function walkPrototype(obj){return\"object\"==typeof obj?\"prototype\"===obj.right?obj:walkPrototype(obj.left):void 0}function walkNative(obj){for(;!obj.identifier&&\"object\"==typeof obj.left;)obj=obj.left;return obj.identifier&&natives.indexOf(obj.value)>=0?obj.value:void 0}var natives=[\"Array\",\"ArrayBuffer\",\"Boolean\",\"Collator\",\"DataView\",\"Date\",\"DateTimeFormat\",\"Error\",\"EvalError\",\"Float32Array\",\"Float64Array\",\"Function\",\"Infinity\",\"Intl\",\"Int16Array\",\"Int32Array\",\"Int8Array\",\"Iterator\",\"Number\",\"NumberFormat\",\"Object\",\"RangeError\",\"ReferenceError\",\"RegExp\",\"StopIteration\",\"String\",\"SyntaxError\",\"TypeError\",\"Uint16Array\",\"Uint32Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"URIError\"],prototype=walkPrototype(left);return prototype?walkNative(prototype):void 0}function checkLeftSideAssign(left,assignToken,options){var allowDestructuring=options&&options.allowDestructuring;if(assignToken=assignToken||left,state.option.freeze){var nativeObject=findNativePrototype(left);nativeObject&&warning(\"W121\",left,nativeObject)}return left.identifier&&!left.isMetaProperty&&state.funct[\"(scope)\"].block.reassign(left.value,left),\".\"===left.id?((!left.left||\"arguments\"===left.left.value&&!state.isStrict())&&warning(\"E031\",assignToken),state.nameStack.set(state.tokens.prev),!0):\"{\"===left.id||\"[\"===left.id?(allowDestructuring&&state.tokens.curr.left.destructAssign?state.tokens.curr.left.destructAssign.forEach(function(t){t.id&&state.funct[\"(scope)\"].block.modify(t.id,t.token)}):\"{\"!==left.id&&left.left?\"arguments\"!==left.left.value||state.isStrict()||warning(\"E031\",assignToken):warning(\"E031\",assignToken),\"[\"===left.id&&state.nameStack.set(left.right),!0):left.isMetaProperty?(error(\"E031\",assignToken),!0):left.identifier&&!isReserved(left)?(\"exception\"===state.funct[\"(scope)\"].labeltype(left.value)&&warning(\"W022\",left),state.nameStack.set(left),!0):(left===state.syntax[\"function\"]&&warning(\"W023\",state.tokens.curr),!1)}function assignop(s,f,p){var x=infix(s,\"function\"==typeof f?f:function(left,that){return that.left=left,left&&checkLeftSideAssign(left,that,{allowDestructuring:!0})?(that.right=expression(10),that):(error(\"E031\",that),void 0)},p);return x.exps=!0,x.assign=!0,x}function bitwise(s,f,p){var x=symbol(s,p);return reserveName(x),x.led=\"function\"==typeof f?f:function(left){return state.option.bitwise&&warning(\"W016\",this,this.id),this.left=left,this.right=expression(p),this},x}function bitwiseassignop(s){return assignop(s,function(left,that){return state.option.bitwise&&warning(\"W016\",that,that.id),left&&checkLeftSideAssign(left,that)?(that.right=expression(10),that):(error(\"E031\",that),void 0)},20)}function suffix(s){var x=symbol(s,150);return x.led=function(left){return state.option.plusplus?warning(\"W016\",this,this.id):left.identifier&&!isReserved(left)||\".\"===left.id||\"[\"===left.id||warning(\"W017\",this),left.isMetaProperty?error(\"E031\",this):left&&left.identifier&&state.funct[\"(scope)\"].block.modify(left.value,left),this.left=left,this},x}function optionalidentifier(fnparam,prop,preserve){if(state.tokens.next.identifier){preserve||advance();var curr=state.tokens.curr,val=state.tokens.curr.value;return isReserved(curr)?prop&&state.inES5()?val:fnparam&&\"undefined\"===val?val:(warning(\"W024\",state.tokens.curr,state.tokens.curr.id),val):val}}function identifier(fnparam,prop){var i=optionalidentifier(fnparam,prop,!1);if(i)return i;if(\"...\"===state.tokens.next.value){if(state.inES6(!0)||warning(\"W119\",state.tokens.next,\"spread/rest operator\",\"6\"),advance(),checkPunctuator(state.tokens.next,\"...\"))for(warning(\"E024\",state.tokens.next,\"...\");checkPunctuator(state.tokens.next,\"...\");)advance();return state.tokens.next.identifier?identifier(fnparam,prop):(warning(\"E024\",state.tokens.curr,\"...\"),void 0)}error(\"E030\",state.tokens.next,state.tokens.next.value),\";\"!==state.tokens.next.id&&advance()}function reachable(controlToken){var t,i=0;if(\";\"===state.tokens.next.id&&!controlToken.inBracelessBlock)for(;;){do t=peek(i),i+=1;while(\"(end)\"!==t.id&&\"(comment)\"===t.id);if(t.reach)return;if(\"(endline)\"!==t.id){if(\"function\"===t.id){state.option.latedef===!0&&warning(\"W026\",t);break}warning(\"W027\",t,t.value,controlToken.value);break}}}function parseFinalSemicolon(){if(\";\"!==state.tokens.next.id){if(state.tokens.next.isUnclosed)return advance();var sameLine=startLine(state.tokens.next)===state.tokens.curr.line&&\"(end)\"!==state.tokens.next.id,blockEnd=checkPunctuator(state.tokens.next,\"}\");sameLine&&!blockEnd?errorAt(\"E058\",state.tokens.curr.line,state.tokens.curr.character):state.option.asi||(blockEnd&&!state.option.lastsemic||!sameLine)&&warningAt(\"W033\",state.tokens.curr.line,state.tokens.curr.character)}else advance(\";\")}function statement(){var r,i=indent,t=state.tokens.next,hasOwnScope=!1;if(\";\"===t.id)return advance(\";\"),void 0;var res=isReserved(t);if(res&&t.meta&&t.meta.isFutureReservedWord&&\":\"===peek().id&&(warning(\"W024\",t,t.id),res=!1),t.identifier&&!res&&\":\"===peek().id&&(advance(),advance(\":\"),hasOwnScope=!0,state.funct[\"(scope)\"].stack(),state.funct[\"(scope)\"].block.addBreakLabel(t.value,{token:state.tokens.curr}),state.tokens.next.labelled||\"{\"===state.tokens.next.value||warning(\"W028\",state.tokens.next,t.value,state.tokens.next.value),state.tokens.next.label=t.value,t=state.tokens.next),\"{\"===t.id){var iscase=\"case\"===state.funct[\"(verb)\"]&&\":\"===state.tokens.curr.value;return block(!0,!0,!1,!1,iscase),void 0}return r=expression(0,!0),!r||r.identifier&&\"function\"===r.value||\"(punctuator)\"===r.type&&r.left&&r.left.identifier&&\"function\"===r.left.value||state.isStrict()||\"global\"!==state.option.strict||warning(\"E007\"),t.block||(state.option.expr||r&&r.exps?state.option.nonew&&r&&r.left&&\"(\"===r.id&&\"new\"===r.left.id&&warning(\"W031\",t):warning(\"W030\",state.tokens.curr),parseFinalSemicolon()),indent=i,hasOwnScope&&state.funct[\"(scope)\"].unstack(),r}function statements(){for(var p,a=[];!state.tokens.next.reach&&\"(end)\"!==state.tokens.next.id;)\";\"===state.tokens.next.id?(p=peek(),(!p||\"(\"!==p.id&&\"[\"!==p.id)&&warning(\"W032\"),advance(\";\")):a.push(statement());return a}function directives(){for(var i,p,pn;\"(string)\"===state.tokens.next.id;){if(p=peek(0),\"(endline)\"===p.id){i=1;do pn=peek(i++);while(\"(endline)\"===pn.id);if(\";\"===pn.id)p=pn;else{if(\"[\"===pn.value||\".\"===pn.value)break;state.option.asi&&\"(\"!==pn.value||warning(\"W033\",state.tokens.next)}}else{if(\".\"===p.id||\"[\"===p.id)break;\";\"!==p.id&&warning(\"W033\",p)}advance();var directive=state.tokens.curr.value;(state.directive[directive]||\"use strict\"===directive&&\"implied\"===state.option.strict)&&warning(\"W034\",state.tokens.curr,directive),state.directive[directive]=!0,\";\"===p.id&&advance(\";\")}state.isStrict()&&(state.option[\"(explicitNewcap)\"]||(state.option.newcap=!0),state.option.undef=!0)}function block(ordinary,stmt,isfunc,isfatarrow,iscase){var a,m,t,line,d,b=inblock,old_indent=indent;inblock=ordinary,t=state.tokens.next;var metrics=state.funct[\"(metrics)\"];if(metrics.nestedBlockDepth+=1,metrics.verifyMaxNestedBlockDepthPerFunction(),\"{\"===state.tokens.next.id){if(advance(\"{\"),state.funct[\"(scope)\"].stack(),line=state.tokens.curr.line,\"}\"!==state.tokens.next.id){for(indent+=state.option.indent;!ordinary&&state.tokens.next.from>indent;)indent+=state.option.indent;if(isfunc){m={};for(d in state.directive)_.has(state.directive,d)&&(m[d]=state.directive[d]);directives(),state.option.strict&&state.funct[\"(context)\"][\"(global)\"]&&(m[\"use strict\"]||state.isStrict()||warning(\"E007\"))}a=statements(),metrics.statementCount+=a.length,indent-=state.option.indent}advance(\"}\",t),isfunc&&(state.funct[\"(scope)\"].validateParams(),m&&(state.directive=m)),state.funct[\"(scope)\"].unstack(),indent=old_indent}else if(ordinary)state.funct[\"(noblockscopedvar)\"]=\"for\"!==state.tokens.next.id,state.funct[\"(scope)\"].stack(),(!stmt||state.option.curly)&&warning(\"W116\",state.tokens.next,\"{\",state.tokens.next.value),state.tokens.next.inBracelessBlock=!0,indent+=state.option.indent,a=[statement()],indent-=state.option.indent,state.funct[\"(scope)\"].unstack(),delete state.funct[\"(noblockscopedvar)\"];else if(isfunc){if(state.funct[\"(scope)\"].stack(),m={},!stmt||isfatarrow||state.inMoz()||error(\"W118\",state.tokens.curr,\"function closure expressions\"),!stmt)for(d in state.directive)_.has(state.directive,d)&&(m[d]=state.directive[d]);expression(10),state.option.strict&&state.funct[\"(context)\"][\"(global)\"]&&(m[\"use strict\"]||state.isStrict()||warning(\"E007\")),state.funct[\"(scope)\"].unstack()}else error(\"E021\",state.tokens.next,\"{\",state.tokens.next.value);switch(state.funct[\"(verb)\"]){case\"break\":case\"continue\":case\"return\":case\"throw\":if(iscase)break;default:state.funct[\"(verb)\"]=null}return inblock=b,!ordinary||!state.option.noempty||a&&0!==a.length||warning(\"W035\",state.tokens.prev),metrics.nestedBlockDepth-=1,a}function countMember(m){membersOnly&&\"boolean\"!=typeof membersOnly[m]&&warning(\"W036\",state.tokens.curr,m),\"number\"==typeof member[m]?member[m]+=1:member[m]=1}function comprehensiveArrayExpression(){var res={};res.exps=!0,state.funct[\"(comparray)\"].stack();var reversed=!1;return\"for\"!==state.tokens.next.value&&(reversed=!0,state.inMoz()||warning(\"W116\",state.tokens.next,\"for\",state.tokens.next.value),state.funct[\"(comparray)\"].setState(\"use\"),res.right=expression(10)),advance(\"for\"),\"each\"===state.tokens.next.value&&(advance(\"each\"),state.inMoz()||warning(\"W118\",state.tokens.curr,\"for each\")),advance(\"(\"),state.funct[\"(comparray)\"].setState(\"define\"),res.left=expression(130),_.contains([\"in\",\"of\"],state.tokens.next.value)?advance():error(\"E045\",state.tokens.curr),state.funct[\"(comparray)\"].setState(\"generate\"),expression(10),advance(\")\"),\"if\"===state.tokens.next.value&&(advance(\"if\"),advance(\"(\"),state.funct[\"(comparray)\"].setState(\"filter\"),res.filter=expression(10),advance(\")\")),reversed||(state.funct[\"(comparray)\"].setState(\"use\"),res.right=expression(10)),advance(\"]\"),state.funct[\"(comparray)\"].unstack(),res}function isMethod(){return state.funct[\"(statement)\"]&&\"class\"===state.funct[\"(statement)\"].type||state.funct[\"(context)\"]&&\"class\"===state.funct[\"(context)\"][\"(verb)\"]}function isPropertyName(token){return token.identifier||\"(string)\"===token.id||\"(number)\"===token.id}function propertyName(preserveOrToken){var id,preserve=!0;return\"object\"==typeof preserveOrToken?id=preserveOrToken:(preserve=preserveOrToken,id=optionalidentifier(!1,!0,preserve)),id?\"object\"==typeof id&&(\"(string)\"===id.id||\"(identifier)\"===id.id?id=id.value:\"(number)\"===id.id&&(id=\"\"+id.value)):\"(string)\"===state.tokens.next.id?(id=state.tokens.next.value,preserve||advance()):\"(number)\"===state.tokens.next.id&&(id=\"\"+state.tokens.next.value,preserve||advance()),\"hasOwnProperty\"===id&&warning(\"W001\"),id}function functionparams(options){function addParam(addParamArgs){state.funct[\"(scope)\"].addParam.apply(state.funct[\"(scope)\"],addParamArgs)}var next,ident,t,paramsIds=[],tokens=[],pastDefault=!1,pastRest=!1,arity=0,loneArg=options&&options.loneArg;if(loneArg&&loneArg.identifier===!0)return state.funct[\"(scope)\"].addParam(loneArg.value,loneArg),{arity:1,params:[loneArg.value]};if(next=state.tokens.next,options&&options.parsedOpening||advance(\"(\"),\")\"===state.tokens.next.id)return advance(\")\"),void 0;for(;;){arity++;var currentParams=[];if(_.contains([\"{\",\"[\"],state.tokens.next.id)){tokens=destructuringPattern();for(t in tokens)t=tokens[t],t.id&&(paramsIds.push(t.id),currentParams.push([t.id,t.token]))}else if(checkPunctuator(state.tokens.next,\"...\")&&(pastRest=!0),ident=identifier(!0))paramsIds.push(ident),currentParams.push([ident,state.tokens.curr]);else for(;!checkPunctuators(state.tokens.next,[\",\",\")\"]);)advance();if(pastDefault&&\"=\"!==state.tokens.next.id&&error(\"W138\",state.tokens.current),\"=\"===state.tokens.next.id&&(state.inES6()||warning(\"W119\",state.tokens.next,\"default parameters\",\"6\"),advance(\"=\"),pastDefault=!0,expression(10)),currentParams.forEach(addParam),\",\"!==state.tokens.next.id)return advance(\")\",next),{arity:arity,params:paramsIds};pastRest&&warning(\"W131\",state.tokens.next),comma()}}function functor(name,token,overwrites){var funct={\"(name)\":name,\"(breakage)\":0,\"(loopage)\":0,\"(tokens)\":{},\"(properties)\":{},\"(catch)\":!1,\"(global)\":!1,\"(line)\":null,\"(character)\":null,\"(metrics)\":null,\"(statement)\":null,\"(context)\":null,\"(scope)\":null,\"(comparray)\":null,\"(generator)\":null,\"(arrow)\":null,\"(params)\":null};return token&&_.extend(funct,{\"(line)\":token.line,\"(character)\":token.character,\"(metrics)\":createMetrics(token)}),_.extend(funct,overwrites),funct[\"(context)\"]&&(funct[\"(scope)\"]=funct[\"(context)\"][\"(scope)\"],funct[\"(comparray)\"]=funct[\"(context)\"][\"(comparray)\"]),funct}function isFunctor(token){return\"(scope)\"in token}function hasParsedCode(funct){return funct[\"(global)\"]&&!funct[\"(verb)\"]}function doTemplateLiteral(left){function end(){if(state.tokens.curr.template&&state.tokens.curr.tail&&state.tokens.curr.context===ctx)return!0;var complete=state.tokens.next.template&&state.tokens.next.tail&&state.tokens.next.context===ctx;return complete&&advance(),complete||state.tokens.next.isUnclosed}var ctx=this.context,noSubst=this.noSubst,depth=this.depth;if(!noSubst)for(;!end();)!state.tokens.next.template||state.tokens.next.depth>depth?expression(0):advance();return{id:\"(template)\",type:\"(template)\",tag:left}}function doFunction(options){var f,token,name,statement,classExprBinding,isGenerator,isArrow,ignoreLoopFunc,oldOption=state.option,oldIgnored=state.ignored;options&&(name=options.name,statement=options.statement,classExprBinding=options.classExprBinding,isGenerator=\"generator\"===options.type,isArrow=\"arrow\"===options.type,ignoreLoopFunc=options.ignoreLoopFunc),state.option=Object.create(state.option),state.ignored=Object.create(state.ignored),state.funct=functor(name||state.nameStack.infer(),state.tokens.next,{\"(statement)\":statement,\"(context)\":state.funct,\"(arrow)\":isArrow,\"(generator)\":isGenerator}),f=state.funct,token=state.tokens.curr,token.funct=state.funct,functions.push(state.funct),state.funct[\"(scope)\"].stack(\"functionouter\");var internallyAccessibleName=name||classExprBinding;internallyAccessibleName&&state.funct[\"(scope)\"].block.add(internallyAccessibleName,classExprBinding?\"class\":\"function\",state.tokens.curr,!1),state.funct[\"(scope)\"].stack(\"functionparams\");var paramsInfo=functionparams(options);return paramsInfo?(state.funct[\"(params)\"]=paramsInfo.params,state.funct[\"(metrics)\"].arity=paramsInfo.arity,state.funct[\"(metrics)\"].verifyMaxParametersPerFunction()):state.funct[\"(metrics)\"].arity=0,isArrow&&(state.inES6(!0)||warning(\"W119\",state.tokens.curr,\"arrow function syntax (=>)\",\"6\"),options.loneArg||advance(\"=>\")),block(!1,!0,!0,isArrow),!state.option.noyield&&isGenerator&&\"yielded\"!==state.funct[\"(generator)\"]&&warning(\"W124\",state.tokens.curr),state.funct[\"(metrics)\"].verifyMaxStatementsPerFunction(),state.funct[\"(metrics)\"].verifyMaxComplexityPerFunction(),state.funct[\"(unusedOption)\"]=state.option.unused,state.option=oldOption,state.ignored=oldIgnored,state.funct[\"(last)\"]=state.tokens.curr.line,state.funct[\"(lastcharacter)\"]=state.tokens.curr.character,state.funct[\"(scope)\"].unstack(),state.funct[\"(scope)\"].unstack(),state.funct=state.funct[\"(context)\"],ignoreLoopFunc||state.option.loopfunc||!state.funct[\"(loopage)\"]||f[\"(isCapturing)\"]&&warning(\"W083\",token),f}function createMetrics(functionStartToken){return{statementCount:0,nestedBlockDepth:-1,ComplexityCount:1,arity:0,verifyMaxStatementsPerFunction:function(){state.option.maxstatements&&this.statementCount>state.option.maxstatements&&warning(\"W071\",functionStartToken,this.statementCount)\n},verifyMaxParametersPerFunction:function(){_.isNumber(state.option.maxparams)&&this.arity>state.option.maxparams&&warning(\"W072\",functionStartToken,this.arity)},verifyMaxNestedBlockDepthPerFunction:function(){state.option.maxdepth&&this.nestedBlockDepth>0&&this.nestedBlockDepth===state.option.maxdepth+1&&warning(\"W073\",null,this.nestedBlockDepth)},verifyMaxComplexityPerFunction:function(){var max=state.option.maxcomplexity,cc=this.ComplexityCount;max&&cc>max&&warning(\"W074\",functionStartToken,cc)}}}function increaseComplexityCount(){state.funct[\"(metrics)\"].ComplexityCount+=1}function checkCondAssignment(expr){var id,paren;switch(expr&&(id=expr.id,paren=expr.paren,\",\"===id&&(expr=expr.exprs[expr.exprs.length-1])&&(id=expr.id,paren=paren||expr.paren)),id){case\"=\":case\"+=\":case\"-=\":case\"*=\":case\"%=\":case\"&=\":case\"|=\":case\"^=\":case\"/=\":paren||state.option.boss||warning(\"W084\")}}function checkProperties(props){if(state.inES5())for(var name in props)props[name]&&props[name].setterToken&&!props[name].getterToken&&warning(\"W078\",props[name].setterToken)}function metaProperty(name,c){if(checkPunctuator(state.tokens.next,\".\")){var left=state.tokens.curr.id;advance(\".\");var id=identifier();return state.tokens.curr.isMetaProperty=!0,name!==id?error(\"E057\",state.tokens.prev,left,id):c(),state.tokens.curr}}function destructuringPattern(options){var isAssignment=options&&options.assignment;return state.inES6()||warning(\"W104\",state.tokens.curr,isAssignment?\"destructuring assignment\":\"destructuring binding\",\"6\"),destructuringPatternRecursive(options)}function destructuringPatternRecursive(options){var ids,identifiers=[],openingParsed=options&&options.openingParsed,isAssignment=options&&options.assignment,recursiveOptions=isAssignment?{assignment:isAssignment}:null,firstToken=openingParsed?state.tokens.curr:state.tokens.next,nextInnerDE=function(){var ident;if(checkPunctuators(state.tokens.next,[\"[\",\"{\"])){ids=destructuringPatternRecursive(recursiveOptions);for(var id in ids)id=ids[id],identifiers.push({id:id.id,token:id.token})}else if(checkPunctuator(state.tokens.next,\",\"))identifiers.push({id:null,token:state.tokens.curr});else{if(!checkPunctuator(state.tokens.next,\"(\")){var is_rest=checkPunctuator(state.tokens.next,\"...\");if(isAssignment){var identifierToken=is_rest?peek(0):state.tokens.next;identifierToken.identifier||warning(\"E030\",identifierToken,identifierToken.value);var assignTarget=expression(155);assignTarget&&(checkLeftSideAssign(assignTarget),assignTarget.identifier&&(ident=assignTarget.value))}else ident=identifier();return ident&&identifiers.push({id:ident,token:state.tokens.curr}),is_rest}advance(\"(\"),nextInnerDE(),advance(\")\")}return!1},assignmentProperty=function(){var id;checkPunctuator(state.tokens.next,\"[\")?(advance(\"[\"),expression(10),advance(\"]\"),advance(\":\"),nextInnerDE()):\"(string)\"===state.tokens.next.id||\"(number)\"===state.tokens.next.id?(advance(),advance(\":\"),nextInnerDE()):(id=identifier(),checkPunctuator(state.tokens.next,\":\")?(advance(\":\"),nextInnerDE()):id&&(isAssignment&&checkLeftSideAssign(state.tokens.curr),identifiers.push({id:id,token:state.tokens.curr})))};if(checkPunctuator(firstToken,\"[\")){openingParsed||advance(\"[\"),checkPunctuator(state.tokens.next,\"]\")&&warning(\"W137\",state.tokens.curr);for(var element_after_rest=!1;!checkPunctuator(state.tokens.next,\"]\");)nextInnerDE()&&!element_after_rest&&checkPunctuator(state.tokens.next,\",\")&&(warning(\"W130\",state.tokens.next),element_after_rest=!0),checkPunctuator(state.tokens.next,\"=\")&&(checkPunctuator(state.tokens.prev,\"...\")?advance(\"]\"):advance(\"=\"),\"undefined\"===state.tokens.next.id&&warning(\"W080\",state.tokens.prev,state.tokens.prev.value),expression(10)),checkPunctuator(state.tokens.next,\"]\")||advance(\",\");advance(\"]\")}else if(checkPunctuator(firstToken,\"{\")){for(openingParsed||advance(\"{\"),checkPunctuator(state.tokens.next,\"}\")&&warning(\"W137\",state.tokens.curr);!checkPunctuator(state.tokens.next,\"}\")&&(assignmentProperty(),checkPunctuator(state.tokens.next,\"=\")&&(advance(\"=\"),\"undefined\"===state.tokens.next.id&&warning(\"W080\",state.tokens.prev,state.tokens.prev.value),expression(10)),checkPunctuator(state.tokens.next,\"}\")||(advance(\",\"),!checkPunctuator(state.tokens.next,\"}\"))););advance(\"}\")}return identifiers}function destructuringPatternMatch(tokens,value){var first=value.first;first&&_.zip(tokens,Array.isArray(first)?first:[first]).forEach(function(val){var token=val[0],value=val[1];token&&value?token.first=value:token&&token.first&&!value&&warning(\"W080\",token.first,token.first.value)})}function blockVariableStatement(type,statement,context){var tokens,lone,value,letblock,prefix=context&&context.prefix,inexport=context&&context.inexport,isLet=\"let\"===type,isConst=\"const\"===type;for(state.inES6()||warning(\"W104\",state.tokens.curr,type,\"6\"),isLet&&\"(\"===state.tokens.next.value?(state.inMoz()||warning(\"W118\",state.tokens.next,\"let block\"),advance(\"(\"),state.funct[\"(scope)\"].stack(),letblock=!0):state.funct[\"(noblockscopedvar)\"]&&error(\"E048\",state.tokens.curr,isConst?\"Const\":\"Let\"),statement.first=[];;){var names=[];_.contains([\"{\",\"[\"],state.tokens.next.value)?(tokens=destructuringPattern(),lone=!1):(tokens=[{id:identifier(),token:state.tokens.curr}],lone=!0),!prefix&&isConst&&\"=\"!==state.tokens.next.id&&warning(\"E012\",state.tokens.curr,state.tokens.curr.value);for(var t in tokens)tokens.hasOwnProperty(t)&&(t=tokens[t],state.funct[\"(scope)\"].block.isGlobal()&&predefined[t.id]===!1&&warning(\"W079\",t.token,t.id),t.id&&!state.funct[\"(noblockscopedvar)\"]&&(state.funct[\"(scope)\"].addlabel(t.id,{type:type,token:t.token}),names.push(t.token),lone&&inexport&&state.funct[\"(scope)\"].setExported(t.token.value,t.token)));if(\"=\"===state.tokens.next.id&&(advance(\"=\"),prefix||\"undefined\"!==state.tokens.next.id||warning(\"W080\",state.tokens.prev,state.tokens.prev.value),!prefix&&\"=\"===peek(0).id&&state.tokens.next.identifier&&warning(\"W120\",state.tokens.next,state.tokens.next.value),value=expression(prefix?120:10),lone?tokens[0].first=value:destructuringPatternMatch(names,value)),statement.first=statement.first.concat(names),\",\"!==state.tokens.next.id)break;comma()}return letblock&&(advance(\")\"),block(!0,!0),statement.block=!0,state.funct[\"(scope)\"].unstack()),statement}function classdef(isStatement){return state.inES6()||warning(\"W104\",state.tokens.curr,\"class\",\"6\"),isStatement?(this.name=identifier(),state.funct[\"(scope)\"].addlabel(this.name,{type:\"class\",token:state.tokens.curr})):state.tokens.next.identifier&&\"extends\"!==state.tokens.next.value?(this.name=identifier(),this.namedExpr=!0):this.name=state.nameStack.infer(),classtail(this),this}function classtail(c){var wasInClassBody=state.inClassBody;\"extends\"===state.tokens.next.value&&(advance(\"extends\"),c.heritage=expression(10)),state.inClassBody=!0,advance(\"{\"),c.body=classbody(c),advance(\"}\"),state.inClassBody=wasInClassBody}function classbody(c){for(var name,isStatic,isGenerator,getset,computed,props=Object.create(null),staticProps=Object.create(null),i=0;\"}\"!==state.tokens.next.id;++i)if(name=state.tokens.next,isStatic=!1,isGenerator=!1,getset=null,\";\"!==name.id){if(\"*\"===name.id&&(isGenerator=!0,advance(\"*\"),name=state.tokens.next),\"[\"===name.id)name=computedPropertyName(),computed=!0;else{if(!isPropertyName(name)){warning(\"W052\",state.tokens.next,state.tokens.next.value||state.tokens.next.type),advance();continue}advance(),computed=!1,name.identifier&&\"static\"===name.value&&(checkPunctuator(state.tokens.next,\"*\")&&(isGenerator=!0,advance(\"*\")),(isPropertyName(state.tokens.next)||\"[\"===state.tokens.next.id)&&(computed=\"[\"===state.tokens.next.id,isStatic=!0,name=state.tokens.next,\"[\"===state.tokens.next.id?name=computedPropertyName():advance())),!name.identifier||\"get\"!==name.value&&\"set\"!==name.value||(isPropertyName(state.tokens.next)||\"[\"===state.tokens.next.id)&&(computed=\"[\"===state.tokens.next.id,getset=name,name=state.tokens.next,\"[\"===state.tokens.next.id?name=computedPropertyName():advance())}if(!checkPunctuator(state.tokens.next,\"(\")){for(error(\"E054\",state.tokens.next,state.tokens.next.value);\"}\"!==state.tokens.next.id&&!checkPunctuator(state.tokens.next,\"(\");)advance();\"(\"!==state.tokens.next.value&&doFunction({statement:c})}if(computed||(getset?saveAccessor(getset.value,isStatic?staticProps:props,name.value,name,!0,isStatic):(\"constructor\"===name.value?state.nameStack.set(c):state.nameStack.set(name),saveProperty(isStatic?staticProps:props,name.value,name,!0,isStatic))),getset&&\"constructor\"===name.value){var propDesc=\"get\"===getset.value?\"class getter method\":\"class setter method\";error(\"E049\",name,propDesc,\"constructor\")}else\"prototype\"===name.value&&error(\"E049\",name,\"class method\",\"prototype\");propertyName(name),doFunction({statement:c,type:isGenerator?\"generator\":null,classExprBinding:c.namedExpr?c.name:null})}else warning(\"W032\"),advance(\";\");checkProperties(props)}function saveProperty(props,name,tkn,isClass,isStatic){var msg=[\"key\",\"class method\",\"static class method\"];msg=msg[(isClass||!1)+(isStatic||!1)],tkn.identifier&&(name=tkn.value),props[name]&&\"__proto__\"!==name?warning(\"W075\",state.tokens.next,msg,name):props[name]=Object.create(null),props[name].basic=!0,props[name].basictkn=tkn}function saveAccessor(accessorType,props,name,tkn,isClass,isStatic){var flagName=\"get\"===accessorType?\"getterToken\":\"setterToken\",msg=\"\";isClass?(isStatic&&(msg+=\"static \"),msg+=accessorType+\"ter method\"):msg=\"key\",state.tokens.curr.accessorType=accessorType,state.nameStack.set(tkn),props[name]?(props[name].basic||props[name][flagName])&&\"__proto__\"!==name&&warning(\"W075\",state.tokens.next,msg,name):props[name]=Object.create(null),props[name][flagName]=tkn}function computedPropertyName(){advance(\"[\"),state.inES6()||warning(\"W119\",state.tokens.curr,\"computed property names\",\"6\");var value=expression(10);return advance(\"]\"),value}function checkPunctuators(token,values){return\"(punctuator)\"===token.type?_.contains(values,token.value):!1}function checkPunctuator(token,value){return\"(punctuator)\"===token.type&&token.value===value}function destructuringAssignOrJsonValue(){var block=lookupBlockType();block.notJson?(!state.inES6()&&block.isDestAssign&&warning(\"W104\",state.tokens.curr,\"destructuring assignment\",\"6\"),statements()):(state.option.laxbreak=!0,state.jsonMode=!0,jsonValue())}function jsonValue(){function jsonObject(){var o={},t=state.tokens.next;if(advance(\"{\"),\"}\"!==state.tokens.next.id)for(;;){if(\"(end)\"===state.tokens.next.id)error(\"E026\",state.tokens.next,t.line);else{if(\"}\"===state.tokens.next.id){warning(\"W094\",state.tokens.curr);break}\",\"===state.tokens.next.id?error(\"E028\",state.tokens.next):\"(string)\"!==state.tokens.next.id&&warning(\"W095\",state.tokens.next,state.tokens.next.value)}if(o[state.tokens.next.value]===!0?warning(\"W075\",state.tokens.next,\"key\",state.tokens.next.value):\"__proto__\"===state.tokens.next.value&&!state.option.proto||\"__iterator__\"===state.tokens.next.value&&!state.option.iterator?warning(\"W096\",state.tokens.next,state.tokens.next.value):o[state.tokens.next.value]=!0,advance(),advance(\":\"),jsonValue(),\",\"!==state.tokens.next.id)break;advance(\",\")}advance(\"}\")}function jsonArray(){var t=state.tokens.next;if(advance(\"[\"),\"]\"!==state.tokens.next.id)for(;;){if(\"(end)\"===state.tokens.next.id)error(\"E027\",state.tokens.next,t.line);else{if(\"]\"===state.tokens.next.id){warning(\"W094\",state.tokens.curr);break}\",\"===state.tokens.next.id&&error(\"E028\",state.tokens.next)}if(jsonValue(),\",\"!==state.tokens.next.id)break;advance(\",\")}advance(\"]\")}switch(state.tokens.next.id){case\"{\":jsonObject();break;case\"[\":jsonArray();break;case\"true\":case\"false\":case\"null\":case\"(number)\":case\"(string)\":advance();break;case\"-\":advance(\"-\"),advance(\"(number)\");break;default:error(\"E003\",state.tokens.next)}}var api,declared,functions,inblock,indent,lookahead,lex,member,membersOnly,predefined,stack,urls,bang={\"<\":!0,\"<=\":!0,\"==\":!0,\"===\":!0,\"!==\":!0,\"!=\":!0,\">\":!0,\">=\":!0,\"+\":!0,\"-\":!0,\"*\":!0,\"/\":!0,\"%\":!0},functionicity=[\"closure\",\"exception\",\"global\",\"label\",\"outer\",\"unused\",\"var\"],extraModules=[],emitter=new events.EventEmitter,typeofValues={};typeofValues.legacy=[\"xml\",\"unknown\"],typeofValues.es3=[\"undefined\",\"boolean\",\"number\",\"string\",\"function\",\"object\"],typeofValues.es3=typeofValues.es3.concat(typeofValues.legacy),typeofValues.es6=typeofValues.es3.concat(\"symbol\"),type(\"(number)\",function(){return this}),type(\"(string)\",function(){return this}),state.syntax[\"(identifier)\"]={type:\"(identifier)\",lbp:0,identifier:!0,nud:function(){var v=this.value;return\"=>\"===state.tokens.next.id?this:(state.funct[\"(comparray)\"].check(v)||state.funct[\"(scope)\"].block.use(v,state.tokens.curr),this)},led:function(){error(\"E033\",state.tokens.next,state.tokens.next.value)}};var baseTemplateSyntax={lbp:0,identifier:!1,template:!0};state.syntax[\"(template)\"]=_.extend({type:\"(template)\",nud:doTemplateLiteral,led:doTemplateLiteral,noSubst:!1},baseTemplateSyntax),state.syntax[\"(template middle)\"]=_.extend({type:\"(template middle)\",middle:!0,noSubst:!1},baseTemplateSyntax),state.syntax[\"(template tail)\"]=_.extend({type:\"(template tail)\",tail:!0,noSubst:!1},baseTemplateSyntax),state.syntax[\"(no subst template)\"]=_.extend({type:\"(template)\",nud:doTemplateLiteral,led:doTemplateLiteral,noSubst:!0,tail:!0},baseTemplateSyntax),type(\"(regexp)\",function(){return this}),delim(\"(endline)\"),delim(\"(begin)\"),delim(\"(end)\").reach=!0,delim(\"(error)\").reach=!0,delim(\"}\").reach=!0,delim(\")\"),delim(\"]\"),delim('\"').reach=!0,delim(\"'\").reach=!0,delim(\";\"),delim(\":\").reach=!0,delim(\"#\"),reserve(\"else\"),reserve(\"case\").reach=!0,reserve(\"catch\"),reserve(\"default\").reach=!0,reserve(\"finally\"),reservevar(\"arguments\",function(x){state.isStrict()&&state.funct[\"(global)\"]&&warning(\"E008\",x)}),reservevar(\"eval\"),reservevar(\"false\"),reservevar(\"Infinity\"),reservevar(\"null\"),reservevar(\"this\",function(x){state.isStrict()&&!isMethod()&&!state.option.validthis&&(state.funct[\"(statement)\"]&&state.funct[\"(name)\"].charAt(0)>\"Z\"||state.funct[\"(global)\"])&&warning(\"W040\",x)}),reservevar(\"true\"),reservevar(\"undefined\"),assignop(\"=\",\"assign\",20),assignop(\"+=\",\"assignadd\",20),assignop(\"-=\",\"assignsub\",20),assignop(\"*=\",\"assignmult\",20),assignop(\"/=\",\"assigndiv\",20).nud=function(){error(\"E014\")},assignop(\"%=\",\"assignmod\",20),bitwiseassignop(\"&=\"),bitwiseassignop(\"|=\"),bitwiseassignop(\"^=\"),bitwiseassignop(\"<<=\"),bitwiseassignop(\">>=\"),bitwiseassignop(\">>>=\"),infix(\",\",function(left,that){var expr;if(that.exprs=[left],state.option.nocomma&&warning(\"W127\"),!comma({peek:!0}))return that;for(;;){if(!(expr=expression(10)))break;if(that.exprs.push(expr),\",\"!==state.tokens.next.value||!comma())break}return that},10,!0),infix(\"?\",function(left,that){return increaseComplexityCount(),that.left=left,that.right=expression(10),advance(\":\"),that[\"else\"]=expression(10),that},30);var orPrecendence=40;infix(\"||\",function(left,that){return increaseComplexityCount(),that.left=left,that.right=expression(orPrecendence),that},orPrecendence),infix(\"&&\",\"and\",50),bitwise(\"|\",\"bitor\",70),bitwise(\"^\",\"bitxor\",80),bitwise(\"&\",\"bitand\",90),relation(\"==\",function(left,right){var eqnull=state.option.eqnull&&(\"null\"===(left&&left.value)||\"null\"===(right&&right.value));switch(!0){case!eqnull&&state.option.eqeqeq:this.from=this.character,warning(\"W116\",this,\"===\",\"==\");break;case isPoorRelation(left):warning(\"W041\",this,\"===\",left.value);break;case isPoorRelation(right):warning(\"W041\",this,\"===\",right.value);break;case isTypoTypeof(right,left,state):warning(\"W122\",this,right.value);break;case isTypoTypeof(left,right,state):warning(\"W122\",this,left.value)}return this}),relation(\"===\",function(left,right){return isTypoTypeof(right,left,state)?warning(\"W122\",this,right.value):isTypoTypeof(left,right,state)&&warning(\"W122\",this,left.value),this}),relation(\"!=\",function(left,right){var eqnull=state.option.eqnull&&(\"null\"===(left&&left.value)||\"null\"===(right&&right.value));return!eqnull&&state.option.eqeqeq?(this.from=this.character,warning(\"W116\",this,\"!==\",\"!=\")):isPoorRelation(left)?warning(\"W041\",this,\"!==\",left.value):isPoorRelation(right)?warning(\"W041\",this,\"!==\",right.value):isTypoTypeof(right,left,state)?warning(\"W122\",this,right.value):isTypoTypeof(left,right,state)&&warning(\"W122\",this,left.value),this}),relation(\"!==\",function(left,right){return isTypoTypeof(right,left,state)?warning(\"W122\",this,right.value):isTypoTypeof(left,right,state)&&warning(\"W122\",this,left.value),this}),relation(\"<\"),relation(\">\"),relation(\"<=\"),relation(\">=\"),bitwise(\"<<\",\"shiftleft\",120),bitwise(\">>\",\"shiftright\",120),bitwise(\">>>\",\"shiftrightunsigned\",120),infix(\"in\",\"in\",120),infix(\"instanceof\",\"instanceof\",120),infix(\"+\",function(left,that){var right;return that.left=left,that.right=right=expression(130),left&&right&&\"(string)\"===left.id&&\"(string)\"===right.id?(left.value+=right.value,left.character=right.character,!state.option.scripturl&®.javascriptURL.test(left.value)&&warning(\"W050\",left),left):that},130),prefix(\"+\",\"num\"),prefix(\"+++\",function(){return warning(\"W007\"),this.arity=\"unary\",this.right=expression(150),this}),infix(\"+++\",function(left){return warning(\"W007\"),this.left=left,this.right=expression(130),this},130),infix(\"-\",\"sub\",130),prefix(\"-\",\"neg\"),prefix(\"---\",function(){return warning(\"W006\"),this.arity=\"unary\",this.right=expression(150),this}),infix(\"---\",function(left){return warning(\"W006\"),this.left=left,this.right=expression(130),this},130),infix(\"*\",\"mult\",140),infix(\"/\",\"div\",140),infix(\"%\",\"mod\",140),suffix(\"++\"),prefix(\"++\",\"preinc\"),state.syntax[\"++\"].exps=!0,suffix(\"--\"),prefix(\"--\",\"predec\"),state.syntax[\"--\"].exps=!0,prefix(\"delete\",function(){var p=expression(10);return p?(\".\"!==p.id&&\"[\"!==p.id&&warning(\"W051\"),this.first=p,p.identifier&&!state.isStrict()&&(p.forgiveUndef=!0),this):this}).exps=!0,prefix(\"~\",function(){return state.option.bitwise&&warning(\"W016\",this,\"~\"),this.arity=\"unary\",this.right=expression(150),this}),prefix(\"...\",function(){return state.inES6(!0)||warning(\"W119\",this,\"spread/rest operator\",\"6\"),state.tokens.next.identifier||\"(string)\"===state.tokens.next.type||checkPunctuators(state.tokens.next,[\"[\",\"(\"])||error(\"E030\",state.tokens.next,state.tokens.next.value),expression(150),this}),prefix(\"!\",function(){return this.arity=\"unary\",this.right=expression(150),this.right||quit(\"E041\",this.line||0),bang[this.right.id]===!0&&warning(\"W018\",this,\"!\"),this}),prefix(\"typeof\",function(){var p=expression(150);return this.first=this.right=p,p||quit(\"E041\",this.line||0,this.character||0),p.identifier&&(p.forgiveUndef=!0),this}),prefix(\"new\",function(){var mp=metaProperty(\"target\",function(){state.inES6(!0)||warning(\"W119\",state.tokens.prev,\"new.target\",\"6\");for(var inFunction,c=state.funct;c&&(inFunction=!c[\"(global)\"],c[\"(arrow)\"]);)c=c[\"(context)\"];inFunction||warning(\"W136\",state.tokens.prev,\"new.target\")});if(mp)return mp;var i,c=expression(155);if(c&&\"function\"!==c.id)if(c.identifier)switch(c[\"new\"]=!0,c.value){case\"Number\":case\"String\":case\"Boolean\":case\"Math\":case\"JSON\":warning(\"W053\",state.tokens.prev,c.value);break;case\"Symbol\":state.inES6()&&warning(\"W053\",state.tokens.prev,c.value);break;case\"Function\":state.option.evil||warning(\"W054\");break;case\"Date\":case\"RegExp\":case\"this\":break;default:\"function\"!==c.id&&(i=c.value.substr(0,1),state.option.newcap&&(\"A\">i||i>\"Z\")&&!state.funct[\"(scope)\"].isPredefined(c.value)&&warning(\"W055\",state.tokens.curr))}else\".\"!==c.id&&\"[\"!==c.id&&\"(\"!==c.id&&warning(\"W056\",state.tokens.curr);else state.option.supernew||warning(\"W057\",this);return\"(\"===state.tokens.next.id||state.option.supernew||warning(\"W058\",state.tokens.curr,state.tokens.curr.value),this.first=this.right=c,this}),state.syntax[\"new\"].exps=!0,prefix(\"void\").exps=!0,infix(\".\",function(left,that){var m=identifier(!1,!0);return\"string\"==typeof m&&countMember(m),that.left=left,that.right=m,m&&\"hasOwnProperty\"===m&&\"=\"===state.tokens.next.value&&warning(\"W001\"),!left||\"arguments\"!==left.value||\"callee\"!==m&&\"caller\"!==m?state.option.evil||!left||\"document\"!==left.value||\"write\"!==m&&\"writeln\"!==m||warning(\"W060\",left):state.option.noarg?warning(\"W059\",left,m):state.isStrict()&&error(\"E008\"),state.option.evil||\"eval\"!==m&&\"execScript\"!==m||isGlobalEval(left,state)&&warning(\"W061\"),that},160,!0),infix(\"(\",function(left,that){state.option.immed&&left&&!left.immed&&\"function\"===left.id&&warning(\"W062\");var n=0,p=[];if(left&&\"(identifier)\"===left.type&&left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&-1===\"Array Number String Boolean Date Object Error Symbol\".indexOf(left.value)&&(\"Math\"===left.value?warning(\"W063\",left):state.option.newcap&&warning(\"W064\",left)),\")\"!==state.tokens.next.id)for(;p[p.length]=expression(10),n+=1,\",\"===state.tokens.next.id;)comma();return advance(\")\"),\"object\"==typeof left&&(state.inES5()||\"parseInt\"!==left.value||1!==n||warning(\"W065\",state.tokens.curr),state.option.evil||(\"eval\"===left.value||\"Function\"===left.value||\"execScript\"===left.value?(warning(\"W061\",left),p[0]&&\"(string)\"===[0].id&&addInternalSrc(left,p[0].value)):!p[0]||\"(string)\"!==p[0].id||\"setTimeout\"!==left.value&&\"setInterval\"!==left.value?!p[0]||\"(string)\"!==p[0].id||\".\"!==left.value||\"window\"!==left.left.value||\"setTimeout\"!==left.right&&\"setInterval\"!==left.right||(warning(\"W066\",left),addInternalSrc(left,p[0].value)):(warning(\"W066\",left),addInternalSrc(left,p[0].value))),left.identifier||\".\"===left.id||\"[\"===left.id||\"=>\"===left.id||\"(\"===left.id||\"&&\"===left.id||\"||\"===left.id||\"?\"===left.id||state.inES6()&&left[\"(name)\"]||warning(\"W067\",that)),that.left=left,that},155,!0).exps=!0,prefix(\"(\",function(){var pn1,ret,triggerFnExpr,first,last,pn=state.tokens.next,i=-1,parens=1,opening=state.tokens.curr,preceeding=state.tokens.prev,isNecessary=!state.option.singleGroups;do\"(\"===pn.value?parens+=1:\")\"===pn.value&&(parens-=1),i+=1,pn1=pn,pn=peek(i);while((0!==parens||\")\"!==pn1.value)&&\";\"!==pn.value&&\"(end)\"!==pn.type);if(\"function\"===state.tokens.next.id&&(triggerFnExpr=state.tokens.next.immed=!0),\"=>\"===pn.value)return doFunction({type:\"arrow\",parsedOpening:!0});var exprs=[];if(\")\"!==state.tokens.next.id)for(;exprs.push(expression(10)),\",\"===state.tokens.next.id;)state.option.nocomma&&warning(\"W127\"),comma();return advance(\")\",this),state.option.immed&&exprs[0]&&\"function\"===exprs[0].id&&\"(\"!==state.tokens.next.id&&\".\"!==state.tokens.next.id&&\"[\"!==state.tokens.next.id&&warning(\"W068\",this),exprs.length?(exprs.length>1?(ret=Object.create(state.syntax[\",\"]),ret.exprs=exprs,first=exprs[0],last=exprs[exprs.length-1],isNecessary||(isNecessary=preceeding.assign||preceeding.delim)):(ret=first=last=exprs[0],isNecessary||(isNecessary=opening.beginsStmt&&(\"{\"===ret.id||triggerFnExpr||isFunctor(ret))||triggerFnExpr&&(!isEndOfExpr()||\"}\"!==state.tokens.prev.id)||isFunctor(ret)&&!isEndOfExpr()||\"{\"===ret.id&&\"=>\"===preceeding.id||\"(number)\"===ret.type&&checkPunctuator(pn,\".\")&&/^\\d+$/.test(ret.value))),ret&&(!isNecessary&&(first.left||first.right||ret.exprs)&&(isNecessary=!isBeginOfExpr(preceeding)&&first.lbp<=preceeding.lbp||!isEndOfExpr()&&last.lbp\"),infix(\"[\",function(left,that){var s,e=expression(10);return e&&\"(string)\"===e.type&&(state.option.evil||\"eval\"!==e.value&&\"execScript\"!==e.value||isGlobalEval(left,state)&&warning(\"W061\"),countMember(e.value),!state.option.sub&®.identifier.test(e.value)&&(s=state.syntax[e.value],s&&isReserved(s)||warning(\"W069\",state.tokens.prev,e.value))),advance(\"]\",that),e&&\"hasOwnProperty\"===e.value&&\"=\"===state.tokens.next.value&&warning(\"W001\"),that.left=left,that.right=e,that},160,!0),prefix(\"[\",function(){var blocktype=lookupBlockType();if(blocktype.isCompArray)return state.option.esnext||state.inMoz()||warning(\"W118\",state.tokens.curr,\"array comprehension\"),comprehensiveArrayExpression();if(blocktype.isDestAssign)return this.destructAssign=destructuringPattern({openingParsed:!0,assignment:!0}),this;var b=state.tokens.curr.line!==startLine(state.tokens.next);for(this.first=[],b&&(indent+=state.option.indent,state.tokens.next.from===indent+state.option.indent&&(indent+=state.option.indent));\"(end)\"!==state.tokens.next.id;){for(;\",\"===state.tokens.next.id;){if(!state.option.elision){if(state.inES5()){warning(\"W128\");do advance(\",\");while(\",\"===state.tokens.next.id);continue}warning(\"W070\")}advance(\",\")}if(\"]\"===state.tokens.next.id)break;if(this.first.push(expression(10)),\",\"!==state.tokens.next.id)break;if(comma({allowTrailing:!0}),\"]\"===state.tokens.next.id&&!state.inES5()){warning(\"W070\",state.tokens.curr);break}}return b&&(indent-=state.option.indent),advance(\"]\",this),this}),function(x){x.nud=function(){var b,f,i,p,t,nextVal,isGeneratorMethod=!1,props=Object.create(null);b=state.tokens.curr.line!==startLine(state.tokens.next),b&&(indent+=state.option.indent,state.tokens.next.from===indent+state.option.indent&&(indent+=state.option.indent));var blocktype=lookupBlockType();if(blocktype.isDestAssign)return this.destructAssign=destructuringPattern({openingParsed:!0,assignment:!0}),this;for(;\"}\"!==state.tokens.next.id;){if(nextVal=state.tokens.next.value,!state.tokens.next.identifier||\",\"!==peekIgnoreEOL().id&&\"}\"!==peekIgnoreEOL().id)if(\":\"===peek().id||\"get\"!==nextVal&&\"set\"!==nextVal){if(\"*\"===state.tokens.next.value&&\"(punctuator)\"===state.tokens.next.type?(state.inES6()||warning(\"W104\",state.tokens.next,\"generator functions\",\"6\"),advance(\"*\"),isGeneratorMethod=!0):isGeneratorMethod=!1,\"[\"===state.tokens.next.id)i=computedPropertyName(),state.nameStack.set(i);else if(state.nameStack.set(state.tokens.next),i=propertyName(),saveProperty(props,i,state.tokens.next),\"string\"!=typeof i)break;\"(\"===state.tokens.next.value?(state.inES6()||warning(\"W104\",state.tokens.curr,\"concise methods\",\"6\"),doFunction({type:isGeneratorMethod?\"generator\":null})):(advance(\":\"),expression(10))}else advance(nextVal),state.inES5()||error(\"E034\"),i=propertyName(),i||state.inES6()||error(\"E035\"),i&&saveAccessor(nextVal,props,i,state.tokens.curr),t=state.tokens.next,f=doFunction(),p=f[\"(params)\"],\"get\"===nextVal&&i&&p?warning(\"W076\",t,p[0],i):\"set\"!==nextVal||!i||p&&1===p.length||warning(\"W077\",t,i);else state.inES6()||warning(\"W104\",state.tokens.next,\"object short notation\",\"6\"),i=propertyName(!0),saveProperty(props,i,state.tokens.next),expression(10);if(countMember(i),\",\"!==state.tokens.next.id)break;comma({allowTrailing:!0,property:!0}),\",\"===state.tokens.next.id?warning(\"W070\",state.tokens.curr):\"}\"!==state.tokens.next.id||state.inES5()||warning(\"W070\",state.tokens.curr)}return b&&(indent-=state.option.indent),advance(\"}\",this),checkProperties(props),this},x.fud=function(){error(\"E036\",state.tokens.curr)}}(delim(\"{\"));var conststatement=stmt(\"const\",function(context){return blockVariableStatement(\"const\",this,context)});conststatement.exps=!0;var letstatement=stmt(\"let\",function(context){return blockVariableStatement(\"let\",this,context)});letstatement.exps=!0;var varstatement=stmt(\"var\",function(context){var tokens,lone,value,prefix=context&&context.prefix,inexport=context&&context.inexport,implied=context&&context.implied,report=!(context&&context.ignore);for(this.first=[];;){var names=[];_.contains([\"{\",\"[\"],state.tokens.next.value)?(tokens=destructuringPattern(),lone=!1):(tokens=[{id:identifier(),token:state.tokens.curr}],lone=!0),prefix&&implied||!report||!state.option.varstmt||warning(\"W132\",this),this.first=this.first.concat(names);for(var t in tokens)tokens.hasOwnProperty(t)&&(t=tokens[t],!implied&&state.funct[\"(global)\"]&&(predefined[t.id]===!1?warning(\"W079\",t.token,t.id):state.option.futurehostile===!1&&(!state.inES5()&&vars.ecmaIdentifiers[5][t.id]===!1||!state.inES6()&&vars.ecmaIdentifiers[6][t.id]===!1)&&warning(\"W129\",t.token,t.id)),t.id&&(\"for\"===implied?(state.funct[\"(scope)\"].has(t.id)||report&&warning(\"W088\",t.token,t.id),state.funct[\"(scope)\"].block.use(t.id,t.token)):(state.funct[\"(scope)\"].addlabel(t.id,{type:\"var\",token:t.token}),lone&&inexport&&state.funct[\"(scope)\"].setExported(t.id,t.token)),names.push(t.token)));if(\"=\"===state.tokens.next.id&&(state.nameStack.set(state.tokens.curr),advance(\"=\"),prefix||!report||state.funct[\"(loopage)\"]||\"undefined\"!==state.tokens.next.id||warning(\"W080\",state.tokens.prev,state.tokens.prev.value),\"=\"===peek(0).id&&state.tokens.next.identifier&&(!prefix&&report&&!state.funct[\"(params)\"]||-1===state.funct[\"(params)\"].indexOf(state.tokens.next.value))&&warning(\"W120\",state.tokens.next,state.tokens.next.value),value=expression(prefix?120:10),lone?tokens[0].first=value:destructuringPatternMatch(names,value)),\",\"!==state.tokens.next.id)break;comma()}return this});varstatement.exps=!0,blockstmt(\"class\",function(){return classdef.call(this,!0)}),blockstmt(\"function\",function(context){var inexport=context&&context.inexport,generator=!1;\"*\"===state.tokens.next.value&&(advance(\"*\"),state.inES6({strict:!0})?generator=!0:warning(\"W119\",state.tokens.curr,\"function*\",\"6\")),inblock&&warning(\"W082\",state.tokens.curr);var i=optionalidentifier();return state.funct[\"(scope)\"].addlabel(i,{type:\"function\",token:state.tokens.curr}),void 0===i?warning(\"W025\"):inexport&&state.funct[\"(scope)\"].setExported(i,state.tokens.prev),doFunction({name:i,statement:this,type:generator?\"generator\":null,ignoreLoopFunc:inblock}),\"(\"===state.tokens.next.id&&state.tokens.next.line===state.tokens.curr.line&&error(\"E039\"),this}),prefix(\"function\",function(){var generator=!1;\"*\"===state.tokens.next.value&&(state.inES6()||warning(\"W119\",state.tokens.curr,\"function*\",\"6\"),advance(\"*\"),generator=!0);var i=optionalidentifier();return doFunction({name:i,type:generator?\"generator\":null}),this}),blockstmt(\"if\",function(){var t=state.tokens.next;increaseComplexityCount(),state.condition=!0,advance(\"(\");var expr=expression(0);checkCondAssignment(expr);var forinifcheck=null;state.option.forin&&state.forinifcheckneeded&&(state.forinifcheckneeded=!1,forinifcheck=state.forinifchecks[state.forinifchecks.length-1],forinifcheck.type=\"(punctuator)\"===expr.type&&\"!\"===expr.value?\"(negative)\":\"(positive)\"),advance(\")\",t),state.condition=!1;var s=block(!0,!0);return forinifcheck&&\"(negative)\"===forinifcheck.type&&s&&s[0]&&\"(identifier)\"===s[0].type&&\"continue\"===s[0].value&&(forinifcheck.type=\"(negative-with-continue)\"),\"else\"===state.tokens.next.id&&(advance(\"else\"),\"if\"===state.tokens.next.id||\"switch\"===state.tokens.next.id?statement():block(!0,!0)),this}),blockstmt(\"try\",function(){function doCatch(){if(advance(\"catch\"),advance(\"(\"),state.funct[\"(scope)\"].stack(\"catchparams\"),checkPunctuators(state.tokens.next,[\"[\",\"{\"])){var tokens=destructuringPattern();_.each(tokens,function(token){token.id&&state.funct[\"(scope)\"].addParam(token.id,token,\"exception\")})}else\"(identifier)\"!==state.tokens.next.type?warning(\"E030\",state.tokens.next,state.tokens.next.value):state.funct[\"(scope)\"].addParam(identifier(),state.tokens.curr,\"exception\");\"if\"===state.tokens.next.value&&(state.inMoz()||warning(\"W118\",state.tokens.curr,\"catch filter\"),advance(\"if\"),expression(0)),advance(\")\"),block(!1),state.funct[\"(scope)\"].unstack()}var b;for(block(!0);\"catch\"===state.tokens.next.id;)increaseComplexityCount(),b&&!state.inMoz()&&warning(\"W118\",state.tokens.next,\"multiple catch blocks\"),doCatch(),b=!0;return\"finally\"===state.tokens.next.id?(advance(\"finally\"),block(!0),void 0):(b||error(\"E021\",state.tokens.next,\"catch\",state.tokens.next.value),this)}),blockstmt(\"while\",function(){var t=state.tokens.next;return state.funct[\"(breakage)\"]+=1,state.funct[\"(loopage)\"]+=1,increaseComplexityCount(),advance(\"(\"),checkCondAssignment(expression(0)),advance(\")\",t),block(!0,!0),state.funct[\"(breakage)\"]-=1,state.funct[\"(loopage)\"]-=1,this}).labelled=!0,blockstmt(\"with\",function(){var t=state.tokens.next;return state.isStrict()?error(\"E010\",state.tokens.curr):state.option.withstmt||warning(\"W085\",state.tokens.curr),advance(\"(\"),expression(0),advance(\")\",t),block(!0,!0),this}),blockstmt(\"switch\",function(){var t=state.tokens.next,g=!1,noindent=!1;\nfor(state.funct[\"(breakage)\"]+=1,advance(\"(\"),checkCondAssignment(expression(0)),advance(\")\",t),t=state.tokens.next,advance(\"{\"),state.tokens.next.from===indent&&(noindent=!0),noindent||(indent+=state.option.indent),this.cases=[];;)switch(state.tokens.next.id){case\"case\":switch(state.funct[\"(verb)\"]){case\"yield\":case\"break\":case\"case\":case\"continue\":case\"return\":case\"switch\":case\"throw\":break;default:state.tokens.curr.caseFallsThrough||warning(\"W086\",state.tokens.curr,\"case\")}advance(\"case\"),this.cases.push(expression(0)),increaseComplexityCount(),g=!0,advance(\":\"),state.funct[\"(verb)\"]=\"case\";break;case\"default\":switch(state.funct[\"(verb)\"]){case\"yield\":case\"break\":case\"continue\":case\"return\":case\"throw\":break;default:this.cases.length&&(state.tokens.curr.caseFallsThrough||warning(\"W086\",state.tokens.curr,\"default\"))}advance(\"default\"),g=!0,advance(\":\");break;case\"}\":return noindent||(indent-=state.option.indent),advance(\"}\",t),state.funct[\"(breakage)\"]-=1,state.funct[\"(verb)\"]=void 0,void 0;case\"(end)\":return error(\"E023\",state.tokens.next,\"}\"),void 0;default:if(indent+=state.option.indent,g)switch(state.tokens.curr.id){case\",\":return error(\"E040\"),void 0;case\":\":g=!1,statements();break;default:return error(\"E025\",state.tokens.curr),void 0}else{if(\":\"!==state.tokens.curr.id)return error(\"E021\",state.tokens.next,\"case\",state.tokens.next.value),void 0;advance(\":\"),error(\"E024\",state.tokens.curr,\":\"),statements()}indent-=state.option.indent}return this}).labelled=!0,stmt(\"debugger\",function(){return state.option.debug||warning(\"W087\",this),this}).exps=!0,function(){var x=stmt(\"do\",function(){state.funct[\"(breakage)\"]+=1,state.funct[\"(loopage)\"]+=1,increaseComplexityCount(),this.first=block(!0,!0),advance(\"while\");var t=state.tokens.next;return advance(\"(\"),checkCondAssignment(expression(0)),advance(\")\",t),state.funct[\"(breakage)\"]-=1,state.funct[\"(loopage)\"]-=1,this});x.labelled=!0,x.exps=!0}(),blockstmt(\"for\",function(){var s,t=state.tokens.next,letscope=!1,foreachtok=null;\"each\"===t.value&&(foreachtok=t,advance(\"each\"),state.inMoz()||warning(\"W118\",state.tokens.curr,\"for each\")),increaseComplexityCount(),advance(\"(\");var nextop,comma,initializer,i=0,inof=[\"in\",\"of\"],level=0;checkPunctuators(state.tokens.next,[\"{\",\"[\"])&&++level;do{if(nextop=peek(i),++i,checkPunctuators(nextop,[\"{\",\"[\"])?++level:checkPunctuators(nextop,[\"}\",\"]\"])&&--level,0>level)break;0===level&&(!comma&&checkPunctuator(nextop,\",\")?comma=nextop:!initializer&&checkPunctuator(nextop,\"=\")&&(initializer=nextop))}while(level>0||!_.contains(inof,nextop.value)&&\";\"!==nextop.value&&\"(end)\"!==nextop.type);if(_.contains(inof,nextop.value)){state.inES6()||\"of\"!==nextop.value||warning(\"W104\",nextop,\"for of\",\"6\");var ok=!(initializer||comma);if(initializer&&error(\"W133\",comma,nextop.value,\"initializer is forbidden\"),comma&&error(\"W133\",comma,nextop.value,\"more than one ForBinding\"),\"var\"===state.tokens.next.id?(advance(\"var\"),state.tokens.curr.fud({prefix:!0})):\"let\"===state.tokens.next.id||\"const\"===state.tokens.next.id?(advance(state.tokens.next.id),letscope=!0,state.funct[\"(scope)\"].stack(),state.tokens.curr.fud({prefix:!0})):Object.create(varstatement).fud({prefix:!0,implied:\"for\",ignore:!ok}),advance(nextop.value),expression(20),advance(\")\",t),\"in\"===nextop.value&&state.option.forin&&(state.forinifcheckneeded=!0,void 0===state.forinifchecks&&(state.forinifchecks=[]),state.forinifchecks.push({type:\"(none)\"})),state.funct[\"(breakage)\"]+=1,state.funct[\"(loopage)\"]+=1,s=block(!0,!0),\"in\"===nextop.value&&state.option.forin){if(state.forinifchecks&&state.forinifchecks.length>0){var check=state.forinifchecks.pop();(s&&s.length>0&&(\"object\"!=typeof s[0]||\"if\"!==s[0].value)||\"(positive)\"===check.type&&s.length>1||\"(negative)\"===check.type)&&warning(\"W089\",this)}state.forinifcheckneeded=!1}state.funct[\"(breakage)\"]-=1,state.funct[\"(loopage)\"]-=1}else{if(foreachtok&&error(\"E045\",foreachtok),\";\"!==state.tokens.next.id)if(\"var\"===state.tokens.next.id)advance(\"var\"),state.tokens.curr.fud();else if(\"let\"===state.tokens.next.id)advance(\"let\"),letscope=!0,state.funct[\"(scope)\"].stack(),state.tokens.curr.fud();else for(;expression(0,\"for\"),\",\"===state.tokens.next.id;)comma();if(nolinebreak(state.tokens.curr),advance(\";\"),state.funct[\"(loopage)\"]+=1,\";\"!==state.tokens.next.id&&checkCondAssignment(expression(0)),nolinebreak(state.tokens.curr),advance(\";\"),\";\"===state.tokens.next.id&&error(\"E021\",state.tokens.next,\")\",\";\"),\")\"!==state.tokens.next.id)for(;expression(0,\"for\"),\",\"===state.tokens.next.id;)comma();advance(\")\",t),state.funct[\"(breakage)\"]+=1,block(!0,!0),state.funct[\"(breakage)\"]-=1,state.funct[\"(loopage)\"]-=1}return letscope&&state.funct[\"(scope)\"].unstack(),this}).labelled=!0,stmt(\"break\",function(){var v=state.tokens.next.value;return state.option.asi||nolinebreak(this),\";\"===state.tokens.next.id||state.tokens.next.reach||state.tokens.curr.line!==startLine(state.tokens.next)?0===state.funct[\"(breakage)\"]&&warning(\"W052\",state.tokens.next,this.value):(state.funct[\"(scope)\"].funct.hasBreakLabel(v)||warning(\"W090\",state.tokens.next,v),this.first=state.tokens.next,advance()),reachable(this),this}).exps=!0,stmt(\"continue\",function(){var v=state.tokens.next.value;return 0===state.funct[\"(breakage)\"]&&warning(\"W052\",state.tokens.next,this.value),state.funct[\"(loopage)\"]||warning(\"W052\",state.tokens.next,this.value),state.option.asi||nolinebreak(this),\";\"===state.tokens.next.id||state.tokens.next.reach||state.tokens.curr.line===startLine(state.tokens.next)&&(state.funct[\"(scope)\"].funct.hasBreakLabel(v)||warning(\"W090\",state.tokens.next,v),this.first=state.tokens.next,advance()),reachable(this),this}).exps=!0,stmt(\"return\",function(){return this.line===startLine(state.tokens.next)?\";\"===state.tokens.next.id||state.tokens.next.reach||(this.first=expression(0),!this.first||\"(punctuator)\"!==this.first.type||\"=\"!==this.first.value||this.first.paren||state.option.boss||warningAt(\"W093\",this.first.line,this.first.character)):\"(punctuator)\"===state.tokens.next.type&&[\"[\",\"{\",\"+\",\"-\"].indexOf(state.tokens.next.value)>-1&&nolinebreak(this),reachable(this),this}).exps=!0,function(x){x.exps=!0,x.lbp=25}(prefix(\"yield\",function(){var prev=state.tokens.prev;state.inES6(!0)&&!state.funct[\"(generator)\"]?\"(catch)\"===state.funct[\"(name)\"]&&state.funct[\"(context)\"][\"(generator)\"]||error(\"E046\",state.tokens.curr,\"yield\"):state.inES6()||warning(\"W104\",state.tokens.curr,\"yield\",\"6\"),state.funct[\"(generator)\"]=\"yielded\";var delegatingYield=!1;return\"*\"===state.tokens.next.value&&(delegatingYield=!0,advance(\"*\")),this.line!==startLine(state.tokens.next)&&state.inMoz()?state.option.asi||nolinebreak(this):((delegatingYield||\";\"!==state.tokens.next.id&&!state.option.asi&&!state.tokens.next.reach&&state.tokens.next.nud)&&(nobreaknonadjacent(state.tokens.curr,state.tokens.next),this.first=expression(10),\"(punctuator)\"!==this.first.type||\"=\"!==this.first.value||this.first.paren||state.option.boss||warningAt(\"W093\",this.first.line,this.first.character)),state.inMoz()&&\")\"!==state.tokens.next.id&&(prev.lbp>30||!prev.assign&&!isEndOfExpr()||\"yield\"===prev.id)&&error(\"E050\",this)),this})),stmt(\"throw\",function(){return nolinebreak(this),this.first=expression(20),reachable(this),this}).exps=!0,stmt(\"import\",function(){if(state.inES6()||warning(\"W119\",state.tokens.curr,\"import\",\"6\"),\"(string)\"===state.tokens.next.type)return advance(\"(string)\"),this;if(state.tokens.next.identifier){if(this.name=identifier(),state.funct[\"(scope)\"].addlabel(this.name,{type:\"const\",token:state.tokens.curr}),\",\"!==state.tokens.next.value)return advance(\"from\"),advance(\"(string)\"),this;advance(\",\")}if(\"*\"===state.tokens.next.id)advance(\"*\"),advance(\"as\"),state.tokens.next.identifier&&(this.name=identifier(),state.funct[\"(scope)\"].addlabel(this.name,{type:\"const\",token:state.tokens.curr}));else for(advance(\"{\");;){if(\"}\"===state.tokens.next.value){advance(\"}\");break}var importName;if(\"default\"===state.tokens.next.type?(importName=\"default\",advance(\"default\")):importName=identifier(),\"as\"===state.tokens.next.value&&(advance(\"as\"),importName=identifier()),state.funct[\"(scope)\"].addlabel(importName,{type:\"const\",token:state.tokens.curr}),\",\"!==state.tokens.next.value){if(\"}\"===state.tokens.next.value){advance(\"}\");break}error(\"E024\",state.tokens.next,state.tokens.next.value);break}advance(\",\")}return advance(\"from\"),advance(\"(string)\"),this}).exps=!0,stmt(\"export\",function(){var token,identifier,ok=!0;if(state.inES6()||(warning(\"W119\",state.tokens.curr,\"export\",\"6\"),ok=!1),state.funct[\"(scope)\"].block.isGlobal()||(error(\"E053\",state.tokens.curr),ok=!1),\"*\"===state.tokens.next.value)return advance(\"*\"),advance(\"from\"),advance(\"(string)\"),this;if(\"default\"===state.tokens.next.type){state.nameStack.set(state.tokens.next),advance(\"default\");var exportType=state.tokens.next.id;return(\"function\"===exportType||\"class\"===exportType)&&(this.block=!0),token=peek(),expression(10),identifier=token.value,this.block&&(state.funct[\"(scope)\"].addlabel(identifier,{type:exportType,token:token}),state.funct[\"(scope)\"].setExported(identifier,token)),this}if(\"{\"===state.tokens.next.value){advance(\"{\");for(var exportedTokens=[];;){if(state.tokens.next.identifier||error(\"E030\",state.tokens.next,state.tokens.next.value),advance(),exportedTokens.push(state.tokens.curr),\"as\"===state.tokens.next.value&&(advance(\"as\"),state.tokens.next.identifier||error(\"E030\",state.tokens.next,state.tokens.next.value),advance()),\",\"!==state.tokens.next.value){if(\"}\"===state.tokens.next.value){advance(\"}\");break}error(\"E024\",state.tokens.next,state.tokens.next.value);break}advance(\",\")}return\"from\"===state.tokens.next.value?(advance(\"from\"),advance(\"(string)\")):ok&&exportedTokens.forEach(function(token){state.funct[\"(scope)\"].setExported(token.value,token)}),this}if(\"var\"===state.tokens.next.id)advance(\"var\"),state.tokens.curr.fud({inexport:!0});else if(\"let\"===state.tokens.next.id)advance(\"let\"),state.tokens.curr.fud({inexport:!0});else if(\"const\"===state.tokens.next.id)advance(\"const\"),state.tokens.curr.fud({inexport:!0});else if(\"function\"===state.tokens.next.id)this.block=!0,advance(\"function\"),state.syntax[\"function\"].fud({inexport:!0});else if(\"class\"===state.tokens.next.id){this.block=!0,advance(\"class\");var classNameToken=state.tokens.next;state.syntax[\"class\"].fud(),state.funct[\"(scope)\"].setExported(classNameToken.value,classNameToken)}else error(\"E024\",state.tokens.next,state.tokens.next.value);return this}).exps=!0,FutureReservedWord(\"abstract\"),FutureReservedWord(\"boolean\"),FutureReservedWord(\"byte\"),FutureReservedWord(\"char\"),FutureReservedWord(\"class\",{es5:!0,nud:classdef}),FutureReservedWord(\"double\"),FutureReservedWord(\"enum\",{es5:!0}),FutureReservedWord(\"export\",{es5:!0}),FutureReservedWord(\"extends\",{es5:!0}),FutureReservedWord(\"final\"),FutureReservedWord(\"float\"),FutureReservedWord(\"goto\"),FutureReservedWord(\"implements\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"import\",{es5:!0}),FutureReservedWord(\"int\"),FutureReservedWord(\"interface\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"long\"),FutureReservedWord(\"native\"),FutureReservedWord(\"package\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"private\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"protected\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"public\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"short\"),FutureReservedWord(\"static\",{es5:!0,strictOnly:!0}),FutureReservedWord(\"super\",{es5:!0}),FutureReservedWord(\"synchronized\"),FutureReservedWord(\"transient\"),FutureReservedWord(\"volatile\");var lookupBlockType=function(){var pn,pn1,prev,i=-1,bracketStack=0,ret={};checkPunctuators(state.tokens.curr,[\"[\",\"{\"])&&(bracketStack+=1);do{if(prev=-1===i?state.tokens.curr:pn,pn=-1===i?state.tokens.next:peek(i),pn1=peek(i+1),i+=1,checkPunctuators(pn,[\"[\",\"{\"])?bracketStack+=1:checkPunctuators(pn,[\"]\",\"}\"])&&(bracketStack-=1),1===bracketStack&&pn.identifier&&\"for\"===pn.value&&!checkPunctuator(prev,\".\")){ret.isCompArray=!0,ret.notJson=!0;break}if(0===bracketStack&&checkPunctuators(pn,[\"}\",\"]\"])){if(\"=\"===pn1.value){ret.isDestAssign=!0,ret.notJson=!0;break}if(\".\"===pn1.value){ret.notJson=!0;break}}checkPunctuator(pn,\";\")&&(ret.isBlock=!0,ret.notJson=!0)}while(bracketStack>0&&\"(end)\"!==pn.id);return ret},arrayComprehension=function(){function declare(v){var l=_current.variables.filter(function(elt){return elt.value===v?(elt.undef=!1,v):void 0}).length;return 0!==l}function use(v){var l=_current.variables.filter(function(elt){return elt.value!==v||elt.undef?void 0:(elt.unused===!0&&(elt.unused=!1),v)}).length;return 0===l}var _current,CompArray=function(){this.mode=\"use\",this.variables=[]},_carrays=[];return{stack:function(){_current=new CompArray,_carrays.push(_current)},unstack:function(){_current.variables.filter(function(v){v.unused&&warning(\"W098\",v.token,v.raw_text||v.value),v.undef&&state.funct[\"(scope)\"].block.use(v.value,v.token)}),_carrays.splice(-1,1),_current=_carrays[_carrays.length-1]},setState:function(s){_.contains([\"use\",\"define\",\"generate\",\"filter\"],s)&&(_current.mode=s)},check:function(v){return _current?_current&&\"use\"===_current.mode?(use(v)&&_current.variables.push({funct:state.funct,token:state.tokens.curr,value:v,undef:!0,unused:!1}),!0):_current&&\"define\"===_current.mode?(declare(v)||_current.variables.push({funct:state.funct,token:state.tokens.curr,value:v,undef:!1,unused:!0}),!0):_current&&\"generate\"===_current.mode?(state.funct[\"(scope)\"].block.use(v,state.tokens.curr),!0):_current&&\"filter\"===_current.mode?(use(v)&&state.funct[\"(scope)\"].block.use(v,state.tokens.curr),!0):!1:void 0}}},escapeRegex=function(str){return str.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")},itself=function(s,o,g){function each(obj,cb){obj&&(Array.isArray(obj)||\"object\"!=typeof obj||(obj=Object.keys(obj)),obj.forEach(cb))}var i,k,x,reIgnoreStr,reIgnore,optionKeys,newOptionObj={},newIgnoredObj={};o=_.clone(o),state.reset(),o&&o.scope?JSHINT.scope=o.scope:(JSHINT.errors=[],JSHINT.undefs=[],JSHINT.internals=[],JSHINT.blacklist={},JSHINT.scope=\"(main)\"),predefined=Object.create(null),combine(predefined,vars.ecmaIdentifiers[3]),combine(predefined,vars.reservedVars),combine(predefined,g||{}),declared=Object.create(null);var exported=Object.create(null);if(o)for(each(o.predef||null,function(item){var slice,prop;\"-\"===item[0]?(slice=item.slice(1),JSHINT.blacklist[slice]=slice,delete predefined[slice]):(prop=Object.getOwnPropertyDescriptor(o.predef,item),predefined[item]=prop?prop.value:!1)}),each(o.exported||null,function(item){exported[item]=!0}),delete o.predef,delete o.exported,optionKeys=Object.keys(o),x=0;optionKeys.length>x;x++)if(/^-W\\d{3}$/g.test(optionKeys[x]))newIgnoredObj[optionKeys[x].slice(1)]=!0;else{var optionKey=optionKeys[x];newOptionObj[optionKey]=o[optionKey],(\"esversion\"===optionKey&&5===o[optionKey]||\"es5\"===optionKey&&o[optionKey])&&warning(\"I003\"),\"newcap\"===optionKeys[x]&&o[optionKey]===!1&&(newOptionObj[\"(explicitNewcap)\"]=!0)}state.option=newOptionObj,state.ignored=newIgnoredObj,state.option.indent=state.option.indent||4,state.option.maxerr=state.option.maxerr||50,indent=1;var scopeManagerInst=scopeManager(state,predefined,exported,declared);if(scopeManagerInst.on(\"warning\",function(ev){warning.apply(null,[ev.code,ev.token].concat(ev.data))}),scopeManagerInst.on(\"error\",function(ev){error.apply(null,[ev.code,ev.token].concat(ev.data))}),state.funct=functor(\"(global)\",null,{\"(global)\":!0,\"(scope)\":scopeManagerInst,\"(comparray)\":arrayComprehension(),\"(metrics)\":createMetrics(state.tokens.next)}),functions=[state.funct],urls=[],stack=null,member={},membersOnly=null,inblock=!1,lookahead=[],!isString(s)&&!Array.isArray(s))return errorAt(\"E004\",0),!1;api={get isJSON(){return state.jsonMode},getOption:function(name){return state.option[name]||null},getCache:function(name){return state.cache[name]},setCache:function(name,value){state.cache[name]=value},warn:function(code,data){warningAt.apply(null,[code,data.line,data.char].concat(data.data))},on:function(names,listener){names.split(\" \").forEach(function(name){emitter.on(name,listener)}.bind(this))}},emitter.removeAllListeners(),(extraModules||[]).forEach(function(func){func(api)}),state.tokens.prev=state.tokens.curr=state.tokens.next=state.syntax[\"(begin)\"],o&&o.ignoreDelimiters&&(Array.isArray(o.ignoreDelimiters)||(o.ignoreDelimiters=[o.ignoreDelimiters]),o.ignoreDelimiters.forEach(function(delimiterPair){delimiterPair.start&&delimiterPair.end&&(reIgnoreStr=escapeRegex(delimiterPair.start)+\"[\\\\s\\\\S]*?\"+escapeRegex(delimiterPair.end),reIgnore=RegExp(reIgnoreStr,\"ig\"),s=s.replace(reIgnore,function(match){return match.replace(/./g,\" \")}))})),lex=new Lexer(s),lex.on(\"warning\",function(ev){warningAt.apply(null,[ev.code,ev.line,ev.character].concat(ev.data))}),lex.on(\"error\",function(ev){errorAt.apply(null,[ev.code,ev.line,ev.character].concat(ev.data))}),lex.on(\"fatal\",function(ev){quit(\"E041\",ev.line,ev.from)}),lex.on(\"Identifier\",function(ev){emitter.emit(\"Identifier\",ev)}),lex.on(\"String\",function(ev){emitter.emit(\"String\",ev)}),lex.on(\"Number\",function(ev){emitter.emit(\"Number\",ev)}),lex.start();for(var name in o)_.has(o,name)&&checkOption(name,state.tokens.curr);assume(),combine(predefined,g||{}),comma.first=!0;try{switch(advance(),state.tokens.next.id){case\"{\":case\"[\":destructuringAssignOrJsonValue();break;default:directives(),state.directive[\"use strict\"]&&\"global\"!==state.option.strict&&warning(\"W097\",state.tokens.prev),statements()}\"(end)\"!==state.tokens.next.id&&quit(\"E041\",state.tokens.curr.line),state.funct[\"(scope)\"].unstack()}catch(err){if(!err||\"JSHintError\"!==err.name)throw err;var nt=state.tokens.next||{};JSHINT.errors.push({scope:\"(main)\",raw:err.raw,code:err.code,reason:err.message,line:err.line||nt.line,character:err.character||nt.from},null)}if(\"(main)\"===JSHINT.scope)for(o=o||{},i=0;JSHINT.internals.length>i;i+=1)k=JSHINT.internals[i],o.scope=k.elem,itself(k.value,o,g);return 0===JSHINT.errors.length};return itself.addModule=function(func){extraModules.push(func)},itself.addModule(style.register),itself.data=function(){var fu,f,i,j,n,globals,data={functions:[],options:state.option};itself.errors.length&&(data.errors=itself.errors),state.jsonMode&&(data.json=!0);var impliedGlobals=state.funct[\"(scope)\"].getImpliedGlobals();for(impliedGlobals.length>0&&(data.implieds=impliedGlobals),urls.length>0&&(data.urls=urls),globals=state.funct[\"(scope)\"].getUsedOrDefinedGlobals(),globals.length>0&&(data.globals=globals),i=1;functions.length>i;i+=1){for(f=functions[i],fu={},j=0;functionicity.length>j;j+=1)fu[functionicity[j]]=[];for(j=0;functionicity.length>j;j+=1)0===fu[functionicity[j]].length&&delete fu[functionicity[j]];fu.name=f[\"(name)\"],fu.param=f[\"(params)\"],fu.line=f[\"(line)\"],fu.character=f[\"(character)\"],fu.last=f[\"(last)\"],fu.lastcharacter=f[\"(lastcharacter)\"],fu.metrics={complexity:f[\"(metrics)\"].ComplexityCount,parameters:f[\"(metrics)\"].arity,statements:f[\"(metrics)\"].statementCount},data.functions.push(fu)}var unuseds=state.funct[\"(scope)\"].getUnuseds();unuseds.length>0&&(data.unused=unuseds);for(n in member)if(\"number\"==typeof member[n]){data.member=member;break}return data},itself.jshint=itself,itself}();\"object\"==typeof exports&&exports&&(exports.JSHINT=JSHINT)},{\"../lodash\":\"/node_modules/jshint/lodash.js\",\"./lex.js\":\"/node_modules/jshint/src/lex.js\",\"./messages.js\":\"/node_modules/jshint/src/messages.js\",\"./options.js\":\"/node_modules/jshint/src/options.js\",\"./reg.js\":\"/node_modules/jshint/src/reg.js\",\"./scope-manager.js\":\"/node_modules/jshint/src/scope-manager.js\",\"./state.js\":\"/node_modules/jshint/src/state.js\",\"./style.js\":\"/node_modules/jshint/src/style.js\",\"./vars.js\":\"/node_modules/jshint/src/vars.js\",events:\"/node_modules/browserify/node_modules/events/events.js\"}],\"/node_modules/jshint/src/lex.js\":[function(_dereq_,module,exports){\"use strict\";function asyncTrigger(){var _checks=[];return{push:function(fn){_checks.push(fn)},check:function(){for(var check=0;_checks.length>check;++check)_checks[check]();_checks.splice(0,_checks.length)}}}function Lexer(source){var lines=source;\"string\"==typeof lines&&(lines=lines.replace(/\\r\\n/g,\"\\n\").replace(/\\r/g,\"\\n\").split(\"\\n\")),lines[0]&&\"#!\"===lines[0].substr(0,2)&&(-1!==lines[0].indexOf(\"node\")&&(state.option.node=!0),lines[0]=\"\"),this.emitter=new events.EventEmitter,this.source=source,this.setLines(lines),this.prereg=!0,this.line=0,this.char=1,this.from=1,this.input=\"\",this.inComment=!1,this.context=[],this.templateStarts=[];for(var i=0;state.option.indent>i;i+=1)state.tab+=\" \";this.ignoreLinterErrors=!1}var _=_dereq_(\"../lodash\"),events=_dereq_(\"events\"),reg=_dereq_(\"./reg.js\"),state=_dereq_(\"./state.js\").state,unicodeData=_dereq_(\"../data/ascii-identifier-data.js\"),asciiIdentifierStartTable=unicodeData.asciiIdentifierStartTable,asciiIdentifierPartTable=unicodeData.asciiIdentifierPartTable,Token={Identifier:1,Punctuator:2,NumericLiteral:3,StringLiteral:4,Comment:5,Keyword:6,NullLiteral:7,BooleanLiteral:8,RegExp:9,TemplateHead:10,TemplateMiddle:11,TemplateTail:12,NoSubstTemplate:13},Context={Block:1,Template:2};Lexer.prototype={_lines:[],inContext:function(ctxType){return this.context.length>0&&this.context[this.context.length-1].type===ctxType},pushContext:function(ctxType){this.context.push({type:ctxType})},popContext:function(){return this.context.pop()},isContext:function(context){return this.context.length>0&&this.context[this.context.length-1]===context},currentContext:function(){return this.context.length>0&&this.context[this.context.length-1]},getLines:function(){return this._lines=state.lines,this._lines},setLines:function(val){this._lines=val,state.lines=this._lines},peek:function(i){return this.input.charAt(i||0)},skip:function(i){i=i||1,this.char+=i,this.input=this.input.slice(i)},on:function(names,listener){names.split(\" \").forEach(function(name){this.emitter.on(name,listener)}.bind(this))},trigger:function(){this.emitter.emit.apply(this.emitter,Array.prototype.slice.call(arguments))},triggerAsync:function(type,args,checks,fn){checks.push(function(){fn()&&this.trigger(type,args)}.bind(this))},scanPunctuator:function(){var ch2,ch3,ch4,ch1=this.peek();switch(ch1){case\".\":if(/^[0-9]$/.test(this.peek(1)))return null;if(\".\"===this.peek(1)&&\".\"===this.peek(2))return{type:Token.Punctuator,value:\"...\"};case\"(\":case\")\":case\";\":case\",\":case\"[\":case\"]\":case\":\":case\"~\":case\"?\":return{type:Token.Punctuator,value:ch1};case\"{\":return this.pushContext(Context.Block),{type:Token.Punctuator,value:ch1};case\"}\":return this.inContext(Context.Block)&&this.popContext(),{type:Token.Punctuator,value:ch1};case\"#\":return{type:Token.Punctuator,value:ch1};case\"\":return null}return ch2=this.peek(1),ch3=this.peek(2),ch4=this.peek(3),\">\"===ch1&&\">\"===ch2&&\">\"===ch3&&\"=\"===ch4?{type:Token.Punctuator,value:\">>>=\"}:\"=\"===ch1&&\"=\"===ch2&&\"=\"===ch3?{type:Token.Punctuator,value:\"===\"}:\"!\"===ch1&&\"=\"===ch2&&\"=\"===ch3?{type:Token.Punctuator,value:\"!==\"}:\">\"===ch1&&\">\"===ch2&&\">\"===ch3?{type:Token.Punctuator,value:\">>>\"}:\"<\"===ch1&&\"<\"===ch2&&\"=\"===ch3?{type:Token.Punctuator,value:\"<<=\"}:\">\"===ch1&&\">\"===ch2&&\"=\"===ch3?{type:Token.Punctuator,value:\">>=\"}:\"=\"===ch1&&\">\"===ch2?{type:Token.Punctuator,value:ch1+ch2}:ch1===ch2&&\"+-<>&|\".indexOf(ch1)>=0?{type:Token.Punctuator,value:ch1+ch2}:\"<>=!+-*%&|^\".indexOf(ch1)>=0?\"=\"===ch2?{type:Token.Punctuator,value:ch1+ch2}:{type:Token.Punctuator,value:ch1}:\"/\"===ch1?\"=\"===ch2?{type:Token.Punctuator,value:\"/=\"}:{type:Token.Punctuator,value:\"/\"}:null},scanComments:function(){function commentToken(label,body,opt){var special=[\"jshint\",\"jslint\",\"members\",\"member\",\"globals\",\"global\",\"exported\"],isSpecial=!1,value=label+body,commentType=\"plain\";return opt=opt||{},opt.isMultiline&&(value+=\"*/\"),body=body.replace(/\\n/g,\" \"),\"/*\"===label&®.fallsThrough.test(body)&&(isSpecial=!0,commentType=\"falls through\"),special.forEach(function(str){if(!isSpecial&&(\"//\"!==label||\"jshint\"===str)&&(\" \"===body.charAt(str.length)&&body.substr(0,str.length)===str&&(isSpecial=!0,label+=str,body=body.substr(str.length)),isSpecial||\" \"!==body.charAt(0)||\" \"!==body.charAt(str.length+1)||body.substr(1,str.length)!==str||(isSpecial=!0,label=label+\" \"+str,body=body.substr(str.length+1)),isSpecial))switch(str){case\"member\":commentType=\"members\";break;case\"global\":commentType=\"globals\";break;default:var options=body.split(\":\").map(function(v){return v.replace(/^\\s+/,\"\").replace(/\\s+$/,\"\")});if(2===options.length)switch(options[0]){case\"ignore\":switch(options[1]){case\"start\":self.ignoringLinterErrors=!0,isSpecial=!1;break;case\"end\":self.ignoringLinterErrors=!1,isSpecial=!1}}commentType=str}}),{type:Token.Comment,commentType:commentType,value:value,body:body,isSpecial:isSpecial,isMultiline:opt.isMultiline||!1,isMalformed:opt.isMalformed||!1}}var ch1=this.peek(),ch2=this.peek(1),rest=this.input.substr(2),startLine=this.line,startChar=this.char,self=this;if(\"*\"===ch1&&\"/\"===ch2)return this.trigger(\"error\",{code:\"E018\",line:startLine,character:startChar}),this.skip(2),null;if(\"/\"!==ch1||\"*\"!==ch2&&\"/\"!==ch2)return null;if(\"/\"===ch2)return this.skip(this.input.length),commentToken(\"//\",rest);var body=\"\";if(\"*\"===ch2){for(this.inComment=!0,this.skip(2);\"*\"!==this.peek()||\"/\"!==this.peek(1);)if(\"\"===this.peek()){if(body+=\"\\n\",!this.nextLine())return this.trigger(\"error\",{code:\"E017\",line:startLine,character:startChar}),this.inComment=!1,commentToken(\"/*\",body,{isMultiline:!0,isMalformed:!0})}else body+=this.peek(),this.skip();return this.skip(2),this.inComment=!1,commentToken(\"/*\",body,{isMultiline:!0})}},scanKeyword:function(){var result=/^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input),keywords=[\"if\",\"in\",\"do\",\"var\",\"for\",\"new\",\"try\",\"let\",\"this\",\"else\",\"case\",\"void\",\"with\",\"enum\",\"while\",\"break\",\"catch\",\"throw\",\"const\",\"yield\",\"class\",\"super\",\"return\",\"typeof\",\"delete\",\"switch\",\"export\",\"import\",\"default\",\"finally\",\"extends\",\"function\",\"continue\",\"debugger\",\"instanceof\"];return result&&keywords.indexOf(result[0])>=0?{type:Token.Keyword,value:result[0]}:null},scanIdentifier:function(){function isNonAsciiIdentifierStart(code){return code>256}function isNonAsciiIdentifierPart(code){return code>256}function isHexDigit(str){return/^[0-9a-fA-F]$/.test(str)}function removeEscapeSequences(id){return id.replace(/\\\\u([0-9a-fA-F]{4})/g,function(m0,codepoint){return String.fromCharCode(parseInt(codepoint,16))})}var type,char,id=\"\",index=0,readUnicodeEscapeSequence=function(){if(index+=1,\"u\"!==this.peek(index))return null;var code,ch1=this.peek(index+1),ch2=this.peek(index+2),ch3=this.peek(index+3),ch4=this.peek(index+4);return isHexDigit(ch1)&&isHexDigit(ch2)&&isHexDigit(ch3)&&isHexDigit(ch4)?(code=parseInt(ch1+ch2+ch3+ch4,16),asciiIdentifierPartTable[code]||isNonAsciiIdentifierPart(code)?(index+=5,\"\\\\u\"+ch1+ch2+ch3+ch4):null):null}.bind(this),getIdentifierStart=function(){var chr=this.peek(index),code=chr.charCodeAt(0);return 92===code?readUnicodeEscapeSequence():128>code?asciiIdentifierStartTable[code]?(index+=1,chr):null:isNonAsciiIdentifierStart(code)?(index+=1,chr):null}.bind(this),getIdentifierPart=function(){var chr=this.peek(index),code=chr.charCodeAt(0);return 92===code?readUnicodeEscapeSequence():128>code?asciiIdentifierPartTable[code]?(index+=1,chr):null:isNonAsciiIdentifierPart(code)?(index+=1,chr):null}.bind(this);if(char=getIdentifierStart(),null===char)return null;for(id=char;char=getIdentifierPart(),null!==char;)id+=char;switch(id){case\"true\":case\"false\":type=Token.BooleanLiteral;break;case\"null\":type=Token.NullLiteral;break;default:type=Token.Identifier}return{type:type,value:removeEscapeSequences(id),text:id,tokenLength:id.length}},scanNumericLiteral:function(){function isDecimalDigit(str){return/^[0-9]$/.test(str)}function isOctalDigit(str){return/^[0-7]$/.test(str)}function isBinaryDigit(str){return/^[01]$/.test(str)}function isHexDigit(str){return/^[0-9a-fA-F]$/.test(str)}function isIdentifierStart(ch){return\"$\"===ch||\"_\"===ch||\"\\\\\"===ch||ch>=\"a\"&&\"z\">=ch||ch>=\"A\"&&\"Z\">=ch}var bad,index=0,value=\"\",length=this.input.length,char=this.peek(index),isAllowedDigit=isDecimalDigit,base=10,isLegacy=!1;if(\".\"!==char&&!isDecimalDigit(char))return null;if(\".\"!==char){for(value=this.peek(index),index+=1,char=this.peek(index),\"0\"===value&&((\"x\"===char||\"X\"===char)&&(isAllowedDigit=isHexDigit,base=16,index+=1,value+=char),(\"o\"===char||\"O\"===char)&&(isAllowedDigit=isOctalDigit,base=8,state.inES6(!0)||this.trigger(\"warning\",{code:\"W119\",line:this.line,character:this.char,data:[\"Octal integer literal\",\"6\"]}),index+=1,value+=char),(\"b\"===char||\"B\"===char)&&(isAllowedDigit=isBinaryDigit,base=2,state.inES6(!0)||this.trigger(\"warning\",{code:\"W119\",line:this.line,character:this.char,data:[\"Binary integer literal\",\"6\"]}),index+=1,value+=char),isOctalDigit(char)&&(isAllowedDigit=isOctalDigit,base=8,isLegacy=!0,bad=!1,index+=1,value+=char),!isOctalDigit(char)&&isDecimalDigit(char)&&(index+=1,value+=char));length>index;){if(char=this.peek(index),isLegacy&&isDecimalDigit(char))bad=!0;else if(!isAllowedDigit(char))break;value+=char,index+=1}if(isAllowedDigit!==isDecimalDigit)return!isLegacy&&2>=value.length?{type:Token.NumericLiteral,value:value,isMalformed:!0}:length>index&&(char=this.peek(index),isIdentifierStart(char))?null:{type:Token.NumericLiteral,value:value,base:base,isLegacy:isLegacy,isMalformed:!1}}if(\".\"===char)for(value+=char,index+=1;length>index&&(char=this.peek(index),isDecimalDigit(char));)value+=char,index+=1;if(\"e\"===char||\"E\"===char){if(value+=char,index+=1,char=this.peek(index),(\"+\"===char||\"-\"===char)&&(value+=this.peek(index),index+=1),char=this.peek(index),!isDecimalDigit(char))return null;for(value+=char,index+=1;length>index&&(char=this.peek(index),isDecimalDigit(char));)value+=char,index+=1}return length>index&&(char=this.peek(index),isIdentifierStart(char))?null:{type:Token.NumericLiteral,value:value,base:base,isMalformed:!isFinite(value)}},scanEscapeSequence:function(checks){var allowNewLine=!1,jump=1;this.skip();var char=this.peek();switch(char){case\"'\":this.triggerAsync(\"warning\",{code:\"W114\",line:this.line,character:this.char,data:[\"\\\\'\"]},checks,function(){return state.jsonMode});break;case\"b\":char=\"\\\\b\";break;case\"f\":char=\"\\\\f\";break;case\"n\":char=\"\\\\n\";break;case\"r\":char=\"\\\\r\";break;case\"t\":char=\"\\\\t\";break;case\"0\":char=\"\\\\0\";var n=parseInt(this.peek(1),10);this.triggerAsync(\"warning\",{code:\"W115\",line:this.line,character:this.char},checks,function(){return n>=0&&7>=n&&state.isStrict()});break;case\"u\":var hexCode=this.input.substr(1,4),code=parseInt(hexCode,16);isNaN(code)&&this.trigger(\"warning\",{code:\"W052\",line:this.line,character:this.char,data:[\"u\"+hexCode]}),char=String.fromCharCode(code),jump=5;break;case\"v\":this.triggerAsync(\"warning\",{code:\"W114\",line:this.line,character:this.char,data:[\"\\\\v\"]},checks,function(){return state.jsonMode}),char=\"\u000b\";break;case\"x\":var x=parseInt(this.input.substr(1,2),16);this.triggerAsync(\"warning\",{code:\"W114\",line:this.line,character:this.char,data:[\"\\\\x-\"]},checks,function(){return state.jsonMode}),char=String.fromCharCode(x),jump=3;break;case\"\\\\\":char=\"\\\\\\\\\";break;case'\"':char='\\\\\"';break;case\"/\":break;case\"\":allowNewLine=!0,char=\"\"}return{\"char\":char,jump:jump,allowNewLine:allowNewLine}},scanTemplateLiteral:function(checks){var tokenType,ch,value=\"\",startLine=this.line,startChar=this.char,depth=this.templateStarts.length;if(!state.inES6(!0))return null;if(\"`\"===this.peek())tokenType=Token.TemplateHead,this.templateStarts.push({line:this.line,\"char\":this.char}),depth=this.templateStarts.length,this.skip(1),this.pushContext(Context.Template);else{if(!this.inContext(Context.Template)||\"}\"!==this.peek())return null;tokenType=Token.TemplateMiddle}for(;\"`\"!==this.peek();){for(;\"\"===(ch=this.peek());)if(value+=\"\\n\",!this.nextLine()){var startPos=this.templateStarts.pop();return this.trigger(\"error\",{code:\"E052\",line:startPos.line,character:startPos.char}),{type:tokenType,value:value,startLine:startLine,startChar:startChar,isUnclosed:!0,depth:depth,context:this.popContext()}}if(\"$\"===ch&&\"{\"===this.peek(1))return value+=\"${\",this.skip(2),{type:tokenType,value:value,startLine:startLine,startChar:startChar,isUnclosed:!1,depth:depth,context:this.currentContext()};\nif(\"\\\\\"===ch){var escape=this.scanEscapeSequence(checks);value+=escape.char,this.skip(escape.jump)}else\"`\"!==ch&&(value+=ch,this.skip(1))}return tokenType=tokenType===Token.TemplateHead?Token.NoSubstTemplate:Token.TemplateTail,this.skip(1),this.templateStarts.pop(),{type:tokenType,value:value,startLine:startLine,startChar:startChar,isUnclosed:!1,depth:depth,context:this.popContext()}},scanStringLiteral:function(checks){var quote=this.peek();if('\"'!==quote&&\"'\"!==quote)return null;this.triggerAsync(\"warning\",{code:\"W108\",line:this.line,character:this.char},checks,function(){return state.jsonMode&&'\"'!==quote});var value=\"\",startLine=this.line,startChar=this.char,allowNewLine=!1;for(this.skip();this.peek()!==quote;)if(\"\"===this.peek()){if(allowNewLine?(allowNewLine=!1,this.triggerAsync(\"warning\",{code:\"W043\",line:this.line,character:this.char},checks,function(){return!state.option.multistr}),this.triggerAsync(\"warning\",{code:\"W042\",line:this.line,character:this.char},checks,function(){return state.jsonMode&&state.option.multistr})):this.trigger(\"warning\",{code:\"W112\",line:this.line,character:this.char}),!this.nextLine())return this.trigger(\"error\",{code:\"E029\",line:startLine,character:startChar}),{type:Token.StringLiteral,value:value,startLine:startLine,startChar:startChar,isUnclosed:!0,quote:quote}}else{allowNewLine=!1;var char=this.peek(),jump=1;if(\" \">char&&this.trigger(\"warning\",{code:\"W113\",line:this.line,character:this.char,data:[\"\"]}),\"\\\\\"===char){var parsed=this.scanEscapeSequence(checks);char=parsed.char,jump=parsed.jump,allowNewLine=parsed.allowNewLine}value+=char,this.skip(jump)}return this.skip(),{type:Token.StringLiteral,value:value,startLine:startLine,startChar:startChar,isUnclosed:!1,quote:quote}},scanRegExp:function(){var terminated,index=0,length=this.input.length,char=this.peek(),value=char,body=\"\",flags=[],malformed=!1,isCharSet=!1,scanUnexpectedChars=function(){\" \">char&&(malformed=!0,this.trigger(\"warning\",{code:\"W048\",line:this.line,character:this.char})),\"<\"===char&&(malformed=!0,this.trigger(\"warning\",{code:\"W049\",line:this.line,character:this.char,data:[char]}))}.bind(this);if(!this.prereg||\"/\"!==char)return null;for(index+=1,terminated=!1;length>index;)if(char=this.peek(index),value+=char,body+=char,isCharSet)\"]\"===char&&(\"\\\\\"!==this.peek(index-1)||\"\\\\\"===this.peek(index-2))&&(isCharSet=!1),\"\\\\\"===char&&(index+=1,char=this.peek(index),body+=char,value+=char,scanUnexpectedChars()),index+=1;else{if(\"\\\\\"===char){if(index+=1,char=this.peek(index),body+=char,value+=char,scanUnexpectedChars(),\"/\"===char){index+=1;continue}if(\"[\"===char){index+=1;continue}}if(\"[\"!==char){if(\"/\"===char){body=body.substr(0,body.length-1),terminated=!0,index+=1;break}index+=1}else isCharSet=!0,index+=1}if(!terminated)return this.trigger(\"error\",{code:\"E015\",line:this.line,character:this.from}),void this.trigger(\"fatal\",{line:this.line,from:this.from});for(;length>index&&(char=this.peek(index),/[gim]/.test(char));)flags.push(char),value+=char,index+=1;try{RegExp(body,flags.join(\"\"))}catch(err){malformed=!0,this.trigger(\"error\",{code:\"E016\",line:this.line,character:this.char,data:[err.message]})}return{type:Token.RegExp,value:value,flags:flags,isMalformed:malformed}},scanNonBreakingSpaces:function(){return state.option.nonbsp?this.input.search(/(\\u00A0)/):-1},scanUnsafeChars:function(){return this.input.search(reg.unsafeChars)},next:function(checks){this.from=this.char;var start;if(/\\s/.test(this.peek()))for(start=this.char;/\\s/.test(this.peek());)this.from+=1,this.skip();var match=this.scanComments()||this.scanStringLiteral(checks)||this.scanTemplateLiteral(checks);return match?match:(match=this.scanRegExp()||this.scanPunctuator()||this.scanKeyword()||this.scanIdentifier()||this.scanNumericLiteral(),match?(this.skip(match.tokenLength||match.value.length),match):null)},nextLine:function(){var char;if(this.line>=this.getLines().length)return!1;this.input=this.getLines()[this.line],this.line+=1,this.char=1,this.from=1;var inputTrimmed=this.input.trim(),startsWith=function(){return _.some(arguments,function(prefix){return 0===inputTrimmed.indexOf(prefix)})},endsWith=function(){return _.some(arguments,function(suffix){return-1!==inputTrimmed.indexOf(suffix,inputTrimmed.length-suffix.length)})};if(this.ignoringLinterErrors===!0&&(startsWith(\"/*\",\"//\")||this.inComment&&endsWith(\"*/\")||(this.input=\"\")),char=this.scanNonBreakingSpaces(),char>=0&&this.trigger(\"warning\",{code:\"W125\",line:this.line,character:char+1}),this.input=this.input.replace(/\\t/g,state.tab),char=this.scanUnsafeChars(),char>=0&&this.trigger(\"warning\",{code:\"W100\",line:this.line,character:char}),!this.ignoringLinterErrors&&state.option.maxlen&&state.option.maxlen=0;--i){var scopeLabels=_scopeStack[i][\"(labels)\"];if(scopeLabels[labelName])return scopeLabels}}function usedSoFarInCurrentFunction(labelName){for(var i=_scopeStack.length-1;i>=0;i--){var current=_scopeStack[i];if(current[\"(usages)\"][labelName])return current[\"(usages)\"][labelName];if(current===_currentFunctBody)break}return!1}function _checkOuterShadow(labelName,token){if(\"outer\"===state.option.shadow)for(var isGlobal=\"global\"===_currentFunctBody[\"(type)\"],isNewFunction=\"functionparams\"===_current[\"(type)\"],outsideCurrentFunction=!isGlobal,i=0;_scopeStack.length>i;i++){var stackItem=_scopeStack[i];isNewFunction||_scopeStack[i+1]!==_currentFunctBody||(outsideCurrentFunction=!1),outsideCurrentFunction&&stackItem[\"(labels)\"][labelName]&&warning(\"W123\",token,labelName),stackItem[\"(breakLabels)\"][labelName]&&warning(\"W123\",token,labelName)}}function _latedefWarning(type,labelName,token){state.option.latedef&&(state.option.latedef===!0&&\"function\"===type||\"function\"!==type)&&warning(\"W003\",token,labelName)}var _current,_scopeStack=[];_newScope(\"global\"),_current[\"(predefined)\"]=predefined;var _currentFunctBody=_current,usedPredefinedAndGlobals=Object.create(null),impliedGlobals=Object.create(null),unuseds=[],emitter=new events.EventEmitter,_getUnusedOption=function(unused_opt){return void 0===unused_opt&&(unused_opt=state.option.unused),unused_opt===!0&&(unused_opt=\"last-param\"),unused_opt},_warnUnused=function(name,tkn,type,unused_opt){var line=tkn.line,chr=tkn.from,raw_name=tkn.raw_text||name;unused_opt=_getUnusedOption(unused_opt);var warnable_types={vars:[\"var\"],\"last-param\":[\"var\",\"param\"],strict:[\"var\",\"param\",\"last-param\"]};unused_opt&&warnable_types[unused_opt]&&-1!==warnable_types[unused_opt].indexOf(type)&&warning(\"W098\",{line:line,from:chr},raw_name),(unused_opt||\"var\"===type)&&unuseds.push({name:name,line:line,character:chr})},scopeManagerInst={on:function(names,listener){names.split(\" \").forEach(function(name){emitter.on(name,listener)})},isPredefined:function(labelName){return!this.has(labelName)&&_.has(_scopeStack[0][\"(predefined)\"],labelName)},stack:function(type){var previousScope=_current;_newScope(type),type||\"functionparams\"!==previousScope[\"(type)\"]||(_current[\"(isFuncBody)\"]=!0,_current[\"(context)\"]=_currentFunctBody,_currentFunctBody=_current)},unstack:function(){var i,j,subScope=_scopeStack.length>1?_scopeStack[_scopeStack.length-2]:null,isUnstackingFunctionBody=_current===_currentFunctBody,isUnstackingFunctionParams=\"functionparams\"===_current[\"(type)\"],isUnstackingFunctionOuter=\"functionouter\"===_current[\"(type)\"],currentUsages=_current[\"(usages)\"],currentLabels=_current[\"(labels)\"],usedLabelNameList=Object.keys(currentUsages);for(currentUsages.__proto__&&-1===usedLabelNameList.indexOf(\"__proto__\")&&usedLabelNameList.push(\"__proto__\"),i=0;usedLabelNameList.length>i;i++){var usedLabelName=usedLabelNameList[i],usage=currentUsages[usedLabelName],usedLabel=currentLabels[usedLabelName];if(usedLabel){var usedLabelType=usedLabel[\"(type)\"];if(usedLabel[\"(useOutsideOfScope)\"]&&!state.option.funcscope){var usedTokens=usage[\"(tokens)\"];if(usedTokens)for(j=0;usedTokens.length>j;j++)usedLabel[\"(function)\"]===usedTokens[j][\"(function)\"]&&error(\"W038\",usedTokens[j],usedLabelName)}if(_current[\"(labels)\"][usedLabelName][\"(unused)\"]=!1,\"const\"===usedLabelType&&usage[\"(modified)\"])for(j=0;usage[\"(modified)\"].length>j;j++)error(\"E013\",usage[\"(modified)\"][j],usedLabelName);if((\"function\"===usedLabelType||\"class\"===usedLabelType)&&usage[\"(reassigned)\"])for(j=0;usage[\"(reassigned)\"].length>j;j++)error(\"W021\",usage[\"(reassigned)\"][j],usedLabelName,usedLabelType)}else if(isUnstackingFunctionOuter&&(state.funct[\"(isCapturing)\"]=!0),subScope)if(subScope[\"(usages)\"][usedLabelName]){var subScopeUsage=subScope[\"(usages)\"][usedLabelName];subScopeUsage[\"(modified)\"]=subScopeUsage[\"(modified)\"].concat(usage[\"(modified)\"]),subScopeUsage[\"(tokens)\"]=subScopeUsage[\"(tokens)\"].concat(usage[\"(tokens)\"]),subScopeUsage[\"(reassigned)\"]=subScopeUsage[\"(reassigned)\"].concat(usage[\"(reassigned)\"]),subScopeUsage[\"(onlyUsedSubFunction)\"]=!1}else subScope[\"(usages)\"][usedLabelName]=usage,isUnstackingFunctionBody&&(subScope[\"(usages)\"][usedLabelName][\"(onlyUsedSubFunction)\"]=!0);else if(\"boolean\"==typeof _current[\"(predefined)\"][usedLabelName]){if(delete declared[usedLabelName],usedPredefinedAndGlobals[usedLabelName]=marker,_current[\"(predefined)\"][usedLabelName]===!1&&usage[\"(reassigned)\"])for(j=0;usage[\"(reassigned)\"].length>j;j++)warning(\"W020\",usage[\"(reassigned)\"][j])}else if(usage[\"(tokens)\"])for(j=0;usage[\"(tokens)\"].length>j;j++){var undefinedToken=usage[\"(tokens)\"][j];undefinedToken.forgiveUndef||(state.option.undef&&!undefinedToken.ignoreUndef&&warning(\"W117\",undefinedToken,usedLabelName),impliedGlobals[usedLabelName]?impliedGlobals[usedLabelName].line.push(undefinedToken.line):impliedGlobals[usedLabelName]={name:usedLabelName,line:[undefinedToken.line]})}}if(subScope||Object.keys(declared).forEach(function(labelNotUsed){_warnUnused(labelNotUsed,declared[labelNotUsed],\"var\")}),subScope&&!isUnstackingFunctionBody&&!isUnstackingFunctionParams&&!isUnstackingFunctionOuter){var labelNames=Object.keys(currentLabels);for(i=0;labelNames.length>i;i++){var defLabelName=labelNames[i];currentLabels[defLabelName][\"(blockscoped)\"]||\"exception\"===currentLabels[defLabelName][\"(type)\"]||this.funct.has(defLabelName,{excludeCurrent:!0})||(subScope[\"(labels)\"][defLabelName]=currentLabels[defLabelName],\"global\"!==_currentFunctBody[\"(type)\"]&&(subScope[\"(labels)\"][defLabelName][\"(useOutsideOfScope)\"]=!0),delete currentLabels[defLabelName])}}_checkForUnused(),_scopeStack.pop(),isUnstackingFunctionBody&&(_currentFunctBody=_scopeStack[_.findLastIndex(_scopeStack,function(scope){return scope[\"(isFuncBody)\"]||\"global\"===scope[\"(type)\"]})]),_current=subScope},addParam:function(labelName,token,type){if(type=type||\"param\",\"exception\"===type){var previouslyDefinedLabelType=this.funct.labeltype(labelName);previouslyDefinedLabelType&&\"exception\"!==previouslyDefinedLabelType&&(state.option.node||warning(\"W002\",state.tokens.next,labelName))}if(_.has(_current[\"(labels)\"],labelName)?_current[\"(labels)\"][labelName].duplicated=!0:(_checkOuterShadow(labelName,token,type),_current[\"(labels)\"][labelName]={\"(type)\":type,\"(token)\":token,\"(unused)\":!0},_current[\"(params)\"].push(labelName)),_.has(_current[\"(usages)\"],labelName)){var usage=_current[\"(usages)\"][labelName];usage[\"(onlyUsedSubFunction)\"]?_latedefWarning(type,labelName,token):warning(\"E056\",token,labelName,type)}},validateParams:function(){if(\"global\"!==_currentFunctBody[\"(type)\"]){var isStrict=state.isStrict(),currentFunctParamScope=_currentFunctBody[\"(parent)\"];currentFunctParamScope[\"(params)\"]&¤tFunctParamScope[\"(params)\"].forEach(function(labelName){var label=currentFunctParamScope[\"(labels)\"][labelName];label&&label.duplicated&&(isStrict?warning(\"E011\",label[\"(token)\"],labelName):state.option.shadow!==!0&&warning(\"W004\",label[\"(token)\"],labelName))})}},getUsedOrDefinedGlobals:function(){var list=Object.keys(usedPredefinedAndGlobals);return usedPredefinedAndGlobals.__proto__===marker&&-1===list.indexOf(\"__proto__\")&&list.push(\"__proto__\"),list},getImpliedGlobals:function(){var values=_.values(impliedGlobals),hasProto=!1;return impliedGlobals.__proto__&&(hasProto=values.some(function(value){return\"__proto__\"===value.name}),hasProto||values.push(impliedGlobals.__proto__)),values},getUnuseds:function(){return unuseds},has:function(labelName){return Boolean(_getLabel(labelName))},labeltype:function(labelName){var scopeLabels=_getLabel(labelName);return scopeLabels?scopeLabels[labelName][\"(type)\"]:null},addExported:function(labelName){var globalLabels=_scopeStack[0][\"(labels)\"];if(_.has(declared,labelName))delete declared[labelName];else if(_.has(globalLabels,labelName))globalLabels[labelName][\"(unused)\"]=!1;else{for(var i=1;_scopeStack.length>i;i++){var scope=_scopeStack[i];if(scope[\"(type)\"])break;if(_.has(scope[\"(labels)\"],labelName)&&!scope[\"(labels)\"][labelName][\"(blockscoped)\"])return scope[\"(labels)\"][labelName][\"(unused)\"]=!1,void 0}exported[labelName]=!0}},setExported:function(labelName,token){this.block.use(labelName,token)\n},addlabel:function(labelName,opts){var type=opts.type,token=opts.token,isblockscoped=\"let\"===type||\"const\"===type||\"class\"===type,isexported=\"global\"===(isblockscoped?_current:_currentFunctBody)[\"(type)\"]&&_.has(exported,labelName);if(_checkOuterShadow(labelName,token,type),isblockscoped){var declaredInCurrentScope=_current[\"(labels)\"][labelName];if(declaredInCurrentScope||_current!==_currentFunctBody||\"global\"===_current[\"(type)\"]||(declaredInCurrentScope=!!_currentFunctBody[\"(parent)\"][\"(labels)\"][labelName]),!declaredInCurrentScope&&_current[\"(usages)\"][labelName]){var usage=_current[\"(usages)\"][labelName];usage[\"(onlyUsedSubFunction)\"]?_latedefWarning(type,labelName,token):warning(\"E056\",token,labelName,type)}declaredInCurrentScope?warning(\"E011\",token,labelName):\"outer\"===state.option.shadow&&scopeManagerInst.funct.has(labelName)&&warning(\"W004\",token,labelName),scopeManagerInst.block.add(labelName,type,token,!isexported)}else{var declaredInCurrentFunctionScope=scopeManagerInst.funct.has(labelName);!declaredInCurrentFunctionScope&&usedSoFarInCurrentFunction(labelName)&&_latedefWarning(type,labelName,token),scopeManagerInst.funct.has(labelName,{onlyBlockscoped:!0})?warning(\"E011\",token,labelName):state.option.shadow!==!0&&declaredInCurrentFunctionScope&&\"__proto__\"!==labelName&&\"global\"!==_currentFunctBody[\"(type)\"]&&warning(\"W004\",token,labelName),scopeManagerInst.funct.add(labelName,type,token,!isexported),\"global\"===_currentFunctBody[\"(type)\"]&&(usedPredefinedAndGlobals[labelName]=marker)}},funct:{labeltype:function(labelName,options){for(var onlyBlockscoped=options&&options.onlyBlockscoped,excludeParams=options&&options.excludeParams,currentScopeIndex=_scopeStack.length-(options&&options.excludeCurrent?2:1),i=currentScopeIndex;i>=0;i--){var current=_scopeStack[i];if(current[\"(labels)\"][labelName]&&(!onlyBlockscoped||current[\"(labels)\"][labelName][\"(blockscoped)\"]))return current[\"(labels)\"][labelName][\"(type)\"];var scopeCheck=excludeParams?_scopeStack[i-1]:current;if(scopeCheck&&\"functionparams\"===scopeCheck[\"(type)\"])return null}return null},hasBreakLabel:function(labelName){for(var i=_scopeStack.length-1;i>=0;i--){var current=_scopeStack[i];if(current[\"(breakLabels)\"][labelName])return!0;if(\"functionparams\"===current[\"(type)\"])return!1}return!1},has:function(labelName,options){return Boolean(this.labeltype(labelName,options))},add:function(labelName,type,tok,unused){_current[\"(labels)\"][labelName]={\"(type)\":type,\"(token)\":tok,\"(blockscoped)\":!1,\"(function)\":_currentFunctBody,\"(unused)\":unused}}},block:{isGlobal:function(){return\"global\"===_current[\"(type)\"]},use:function(labelName,token){var paramScope=_currentFunctBody[\"(parent)\"];paramScope&¶mScope[\"(labels)\"][labelName]&&\"param\"===paramScope[\"(labels)\"][labelName][\"(type)\"]&&(scopeManagerInst.funct.has(labelName,{excludeParams:!0,onlyBlockscoped:!0})||(paramScope[\"(labels)\"][labelName][\"(unused)\"]=!1)),token&&(state.ignored.W117||state.option.undef===!1)&&(token.ignoreUndef=!0),_setupUsages(labelName),token&&(token[\"(function)\"]=_currentFunctBody,_current[\"(usages)\"][labelName][\"(tokens)\"].push(token))},reassign:function(labelName,token){this.modify(labelName,token),_current[\"(usages)\"][labelName][\"(reassigned)\"].push(token)},modify:function(labelName,token){_setupUsages(labelName),_current[\"(usages)\"][labelName][\"(modified)\"].push(token)},add:function(labelName,type,tok,unused){_current[\"(labels)\"][labelName]={\"(type)\":type,\"(token)\":tok,\"(blockscoped)\":!0,\"(unused)\":unused}},addBreakLabel:function(labelName,opts){var token=opts.token;scopeManagerInst.funct.hasBreakLabel(labelName)?warning(\"E011\",token,labelName):\"outer\"===state.option.shadow&&(scopeManagerInst.funct.has(labelName)?warning(\"W004\",token,labelName):_checkOuterShadow(labelName,token)),_current[\"(breakLabels)\"][labelName]=token}}};return scopeManagerInst};module.exports=scopeManager},{\"../lodash\":\"/node_modules/jshint/lodash.js\",events:\"/node_modules/browserify/node_modules/events/events.js\"}],\"/node_modules/jshint/src/state.js\":[function(_dereq_,module,exports){\"use strict\";var NameStack=_dereq_(\"./name-stack.js\"),state={syntax:{},isStrict:function(){return this.directive[\"use strict\"]||this.inClassBody||this.option.module||\"implied\"===this.option.strict},inMoz:function(){return this.option.moz},inES6:function(){return this.option.moz||this.option.esversion>=6},inES5:function(strict){return strict?!(this.option.esversion&&5!==this.option.esversion||this.option.moz):!this.option.esversion||this.option.esversion>=5||this.option.moz},reset:function(){this.tokens={prev:null,next:null,curr:null},this.option={},this.funct=null,this.ignored={},this.directive={},this.jsonMode=!1,this.jsonWarnings=[],this.lines=[],this.tab=\"\",this.cache={},this.ignoredLines={},this.forinifcheckneeded=!1,this.nameStack=new NameStack,this.inClassBody=!1}};exports.state=state},{\"./name-stack.js\":\"/node_modules/jshint/src/name-stack.js\"}],\"/node_modules/jshint/src/style.js\":[function(_dereq_,module,exports){\"use strict\";exports.register=function(linter){linter.on(\"Identifier\",function(data){linter.getOption(\"proto\")||\"__proto__\"===data.name&&linter.warn(\"W103\",{line:data.line,\"char\":data.char,data:[data.name,\"6\"]})}),linter.on(\"Identifier\",function(data){linter.getOption(\"iterator\")||\"__iterator__\"===data.name&&linter.warn(\"W103\",{line:data.line,\"char\":data.char,data:[data.name]})}),linter.on(\"Identifier\",function(data){linter.getOption(\"camelcase\")&&data.name.replace(/^_+|_+$/g,\"\").indexOf(\"_\")>-1&&!data.name.match(/^[A-Z0-9_]*$/)&&linter.warn(\"W106\",{line:data.line,\"char\":data.from,data:[data.name]})}),linter.on(\"String\",function(data){var code,quotmark=linter.getOption(\"quotmark\");quotmark&&(\"single\"===quotmark&&\"'\"!==data.quote&&(code=\"W109\"),\"double\"===quotmark&&'\"'!==data.quote&&(code=\"W108\"),quotmark===!0&&(linter.getCache(\"quotmark\")||linter.setCache(\"quotmark\",data.quote),linter.getCache(\"quotmark\")!==data.quote&&(code=\"W110\")),code&&linter.warn(code,{line:data.line,\"char\":data.char}))}),linter.on(\"Number\",function(data){\".\"===data.value.charAt(0)&&linter.warn(\"W008\",{line:data.line,\"char\":data.char,data:[data.value]}),\".\"===data.value.substr(data.value.length-1)&&linter.warn(\"W047\",{line:data.line,\"char\":data.char,data:[data.value]}),/^00+/.test(data.value)&&linter.warn(\"W046\",{line:data.line,\"char\":data.char,data:[data.value]})}),linter.on(\"String\",function(data){var re=/^(?:javascript|jscript|ecmascript|vbscript|livescript)\\s*:/i;linter.getOption(\"scripturl\")||re.test(data.value)&&linter.warn(\"W107\",{line:data.line,\"char\":data.char})})}},{}],\"/node_modules/jshint/src/vars.js\":[function(_dereq_,module,exports){\"use strict\";exports.reservedVars={arguments:!1,NaN:!1},exports.ecmaIdentifiers={3:{Array:!1,Boolean:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,isFinite:!1,isNaN:!1,Math:!1,Number:!1,Object:!1,parseInt:!1,parseFloat:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,TypeError:!1,URIError:!1},5:{JSON:!1},6:{Map:!1,Promise:!1,Proxy:!1,Reflect:!1,Set:!1,Symbol:!1,WeakMap:!1,WeakSet:!1}},exports.browser={Audio:!1,Blob:!1,addEventListener:!1,applicationCache:!1,atob:!1,blur:!1,btoa:!1,cancelAnimationFrame:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,CSS:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,Comment:!1,CustomEvent:!1,DOMParser:!1,defaultStatus:!1,Document:!1,document:!1,DocumentFragment:!1,Element:!1,ElementTimeControl:!1,Event:!1,event:!1,fetch:!1,FileReader:!1,FormData:!1,focus:!1,frames:!1,getComputedStyle:!1,HTMLElement:!1,HTMLAnchorElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPreElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLUListElement:!1,HTMLVideoElement:!1,history:!1,Image:!1,Intl:!1,length:!1,localStorage:!1,location:!1,matchMedia:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationObserver:!1,name:!1,Node:!1,NodeFilter:!1,NodeList:!1,Notification:!1,navigator:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,Option:!1,parent:!1,performance:!1,print:!1,Range:!1,requestAnimationFrame:!1,removeEventListener:!1,resizeBy:!1,resizeTo:!1,screen:!1,scroll:!1,scrollBy:!1,scrollTo:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,SharedWorker:!1,status:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimationElement:!1,SVGCSSRule:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLineElement:!1,SVGLinearGradientElement:!1,SVGLocatable:!1,SVGMPathElement:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGSVGElement:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformList:!1,SVGTransformable:!1,SVGURIReference:!1,SVGUnitTypes:!1,SVGUseElement:!1,SVGVKernElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGZoomAndPan:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TimeEvent:!1,top:!1,URL:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLHttpRequest:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},exports.devel={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},exports.worker={importScripts:!0,postMessage:!0,self:!0,FileReaderSync:!0},exports.nonstandard={escape:!1,unescape:!1},exports.couch={require:!1,respond:!1,getRow:!1,emit:!1,send:!1,start:!1,sum:!1,log:!1,exports:!1,module:!1,provides:!1},exports.node={__filename:!1,__dirname:!1,GLOBAL:!1,global:!1,module:!1,acequire:!1,Buffer:!0,console:!0,exports:!0,process:!0,setTimeout:!0,clearTimeout:!0,setInterval:!0,clearInterval:!0,setImmediate:!0,clearImmediate:!0},exports.browserify={__filename:!1,__dirname:!1,global:!1,module:!1,acequire:!1,Buffer:!0,exports:!0,process:!0},exports.phantom={phantom:!0,acequire:!0,WebPage:!0,console:!0,exports:!0},exports.qunit={asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,\"throws\":!1},exports.rhino={defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},exports.shelljs={target:!1,echo:!1,exit:!1,cd:!1,pwd:!1,ls:!1,find:!1,cp:!1,rm:!1,mv:!1,mkdir:!1,test:!1,cat:!1,sed:!1,grep:!1,which:!1,dirs:!1,pushd:!1,popd:!1,env:!1,exec:!1,chmod:!1,config:!1,error:!1,tempdir:!1},exports.typed={ArrayBuffer:!1,ArrayBufferView:!1,DataView:!1,Float32Array:!1,Float64Array:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1},exports.wsh={ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WSH:!0,WScript:!0,XDomainRequest:!0},exports.dojo={dojo:!1,dijit:!1,dojox:!1,define:!1,require:!1},exports.jquery={$:!1,jQuery:!1},exports.mootools={$:!1,$$:!1,Asset:!1,Browser:!1,Chain:!1,Class:!1,Color:!1,Cookie:!1,Core:!1,Document:!1,DomReady:!1,DOMEvent:!1,DOMReady:!1,Drag:!1,Element:!1,Elements:!1,Event:!1,Events:!1,Fx:!1,Group:!1,Hash:!1,HtmlTable:!1,IFrame:!1,IframeShim:!1,InputValidator:!1,instanceOf:!1,Keyboard:!1,Locale:!1,Mask:!1,MooTools:!1,Native:!1,Options:!1,OverText:!1,Request:!1,Scroller:!1,Slick:!1,Slider:!1,Sortables:!1,Spinner:!1,Swiff:!1,Tips:!1,Type:!1,typeOf:!1,URI:!1,Window:!1},exports.prototypejs={$:!1,$$:!1,$A:!1,$F:!1,$H:!1,$R:!1,$break:!1,$continue:!1,$w:!1,Abstract:!1,Ajax:!1,Class:!1,Enumerable:!1,Element:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Selector:!1,Template:!1,Toggle:!1,Try:!1,Autocompleter:!1,Builder:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Scriptaculous:!1},exports.yui={YUI:!1,Y:!1,YUI_config:!1},exports.mocha={mocha:!1,describe:!1,xdescribe:!1,it:!1,xit:!1,context:!1,xcontext:!1,before:!1,after:!1,beforeEach:!1,afterEach:!1,suite:!1,test:!1,setup:!1,teardown:!1,suiteSetup:!1,suiteTeardown:!1},exports.jasmine={jasmine:!1,describe:!1,xdescribe:!1,it:!1,xit:!1,beforeEach:!1,afterEach:!1,setFixtures:!1,loadFixtures:!1,spyOn:!1,expect:!1,runs:!1,waitsFor:!1,waits:!1,beforeAll:!1,afterAll:!1,fail:!1,fdescribe:!1,fit:!1,pending:!1}},{}]},{},[\"/node_modules/jshint/src/jshint.js\"])}),ace.define(\"ace/mode/javascript_worker\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/worker/mirror\",\"ace/mode/javascript/jshint\"],function(acequire,exports,module){\"use strict\";function startRegex(arr){return RegExp(\"^(\"+arr.join(\"|\")+\")\")}var oop=acequire(\"../lib/oop\"),Mirror=acequire(\"../worker/mirror\").Mirror,lint=acequire(\"./javascript/jshint\").JSHINT,disabledWarningsRe=startRegex([\"Bad for in variable '(.+)'.\",'Missing \"use strict\"']),errorsRe=startRegex([\"Unexpected\",\"Expected \",\"Confusing (plus|minus)\",\"\\\\{a\\\\} unterminated regular expression\",\"Unclosed \",\"Unmatched \",\"Unbegun comment\",\"Bad invocation\",\"Missing space after\",\"Missing operator at\"]),infoRe=startRegex([\"Expected an assignment\",\"Bad escapement of EOL\",\"Unexpected comma\",\"Unexpected space\",\"Missing radix parameter.\",\"A leading decimal point can\",\"\\\\['{a}'\\\\] is better written in dot notation.\",\"'{a}' used out of scope\"]),JavaScriptWorker=exports.JavaScriptWorker=function(sender){Mirror.call(this,sender),this.setTimeout(500),this.setOptions()};oop.inherits(JavaScriptWorker,Mirror),function(){this.setOptions=function(options){this.options=options||{esnext:!0,moz:!0,devel:!0,browser:!0,node:!0,laxcomma:!0,laxbreak:!0,lastsemic:!0,onevar:!1,passfail:!1,maxerr:100,expr:!0,multistr:!0,globalstrict:!0},this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.changeOptions=function(newOptions){oop.mixin(this.options,newOptions),this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.isValidJS=function(str){try{eval(\"throw 0;\"+str)}catch(e){if(0===e)return!0}return!1},this.onUpdate=function(){var value=this.doc.getValue();if(value=value.replace(/^#!.*\\n/,\"\\n\"),!value)return this.sender.emit(\"annotate\",[]);var errors=[],maxErrorLevel=this.isValidJS(value)?\"warning\":\"error\";lint(value,this.options,this.options.globals);for(var results=lint.errors,errorAdded=!1,i=0;results.length>i;i++){var error=results[i];if(error){var raw=error.raw,type=\"warning\";if(\"Missing semicolon.\"==raw){var str=error.evidence.substr(error.character);str=str.charAt(str.search(/\\S/)),\"error\"==maxErrorLevel&&str&&/[\\w\\d{(['\"]/.test(str)?(error.reason='Missing \";\" before statement',type=\"error\"):type=\"info\"}else{if(disabledWarningsRe.test(raw))continue;infoRe.test(raw)?type=\"info\":errorsRe.test(raw)?(errorAdded=!0,type=maxErrorLevel):\"'{a}' is not defined.\"==raw?type=\"warning\":\"'{a}' is defined but never used.\"==raw&&(type=\"info\")}errors.push({row:error.line-1,column:error.character-1,text:error.reason,type:type,raw:raw})}}this.sender.emit(\"annotate\",errors)}}.call(JavaScriptWorker.prototype)}),ace.define(\"ace/lib/es5-shim\",[\"require\",\"exports\",\"module\"],function(){function Empty(){}function doesDefinePropertyWork(object){try{return Object.defineProperty(object,\"sentinel\",{}),\"sentinel\"in object}catch(exception){}}function toInteger(n){return n=+n,n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if(\"function\"!=typeof target)throw new TypeError(\"Function.prototype.bind called on incompatible \"+target);var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))};return target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound});var defineGetter,defineSetter,lookupGetter,lookupSetter,supportsAccessors,call=Function.prototype.call,prototypeOfArray=Array.prototype,prototypeOfObject=Object.prototype,slice=prototypeOfArray.slice,_toString=call.bind(prototypeOfObject.toString),owns=call.bind(prototypeOfObject.hasOwnProperty);if((supportsAccessors=owns(prototypeOfObject,\"__defineGetter__\"))&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function makeArray(l){var a=Array(l+2);return a[0]=a[1]=0,a}var lengthBefore,array=[];return array.splice.apply(array,makeArray(20)),array.splice.apply(array,makeArray(26)),lengthBefore=array.length,array.splice(5,0,\"XXX\"),lengthBefore+1==array.length,lengthBefore+1==array.length?!0:void 0}()){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){return arguments.length?array_splice.apply(this,[void 0===start?0:start,void 0===deleteCount?this.length-start:deleteCount].concat(slice.call(arguments,2))):[]}}else Array.prototype.splice=function(pos,removeCount){var length=this.length;pos>0?pos>length&&(pos=length):void 0==pos?pos=0:0>pos&&(pos=Math.max(length+pos,0)),length>pos+removeCount||(removeCount=length-pos);var removed=this.slice(pos,pos+removeCount),insert=slice.call(arguments,2),add=insert.length;if(pos===length)add&&this.push.apply(this,insert);else{var remove=Math.min(removeCount,length-pos),tailOldPos=pos+remove,tailNewPos=tailOldPos+add-remove,tailCount=length-tailOldPos,lengthAfterRemove=length-remove;if(tailOldPos>tailNewPos)for(var i=0;tailCount>i;++i)this[tailNewPos+i]=this[tailOldPos+i];else if(tailNewPos>tailOldPos)for(i=tailCount;i--;)this[tailNewPos+i]=this[tailOldPos+i];if(add&&pos===lengthAfterRemove)this.length=lengthAfterRemove,this.push.apply(this,insert);else for(this.length=lengthAfterRemove+add,i=0;add>i;++i)this[pos+i]=insert[i]}return removed};Array.isArray||(Array.isArray=function(obj){return\"[object Array]\"==_toString(obj)});var boxedString=Object(\"a\"),splitString=\"a\"!=boxedString[0]||!(0 in boxedString);if(Array.prototype.forEach||(Array.prototype.forEach=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,thisp=arguments[1],i=-1,length=self.length>>>0;if(\"[object Function]\"!=_toString(fun))throw new TypeError;for(;length>++i;)i in self&&fun.call(thisp,self[i],i,object)}),Array.prototype.map||(Array.prototype.map=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)i in self&&(result[i]=fun.call(thisp,self[i],i,object));return result}),Array.prototype.filter||(Array.prototype.filter=function(fun){var value,object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,result=[],thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)i in self&&(value=self[i],fun.call(thisp,value,i,object)&&result.push(value));return result}),Array.prototype.every||(Array.prototype.every=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0,thisp=arguments[1];if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");for(var i=0;length>i;i++)if(i in self&&fun.call(thisp,self[i],i,object))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0;if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");if(!length&&1==arguments.length)throw new TypeError(\"reduce of empty array with no initial value\");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError(\"reduce of empty array with no initial value\")}for(;length>i;i++)i in self&&(result=fun.call(void 0,result,self[i],i,object));return result}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(fun){var object=toObject(this),self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):object,length=self.length>>>0;if(\"[object Function]\"!=_toString(fun))throw new TypeError(fun+\" is not a function\");if(!length&&1==arguments.length)throw new TypeError(\"reduceRight of empty array with no initial value\");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(0>--i)throw new TypeError(\"reduceRight of empty array with no initial value\")}do i in this&&(result=fun.call(void 0,result,self[i],i,object));while(i--);return result}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(sought){var self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;for(arguments.length>1&&(i=toInteger(arguments[1])),i=i>=0?i:Math.max(0,length+i);length>i;i++)if(i in self&&self[i]===sought)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(sought){var self=splitString&&\"[object String]\"==_toString(this)?this.split(\"\"):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;for(arguments.length>1&&(i=Math.min(i,toInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&sought===self[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}),!Object.getOwnPropertyDescriptor){var ERR_NON_OBJECT=\"Object.getOwnPropertyDescriptor called on a non-object: \";Object.getOwnPropertyDescriptor=function(object,property){if(\"object\"!=typeof object&&\"function\"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT+object);if(owns(object,property)){var descriptor,getter,setter;if(descriptor={enumerable:!0,configurable:!0},supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(object.__proto__=prototype,getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(object){return Object.keys(object)}),!Object.create){var createEmpty;createEmpty=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var empty={};for(var i in empty)empty[i]=null;return empty.constructor=empty.hasOwnProperty=empty.propertyIsEnumerable=empty.isPrototypeOf=empty.toLocaleString=empty.toString=empty.valueOf=empty.__proto__=null,empty},Object.create=function(prototype,properties){var object;if(null===prototype)object=createEmpty();else{if(\"object\"!=typeof prototype)throw new TypeError(\"typeof prototype[\"+typeof prototype+\"] != 'object'\");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom=\"undefined\"==typeof document||doesDefinePropertyWork(document.createElement(\"div\"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR=\"Property description must be an object: \",ERR_NON_OBJECT_TARGET=\"Object.defineProperty called on non-object: \",ERR_ACCESSORS_NOT_SUPPORTED=\"getters & setters can not be defined on this javascript engine\";Object.defineProperty=function(object,property,descriptor){if(\"object\"!=typeof object&&\"function\"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT_TARGET+object);if(\"object\"!=typeof descriptor&&\"function\"!=typeof descriptor||null===descriptor)throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if(owns(descriptor,\"value\"))if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{if(!supportsAccessors)throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);owns(descriptor,\"get\")&&defineGetter(object,property,descriptor.get),owns(descriptor,\"set\")&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties||(Object.defineProperties=function(object,properties){for(var property in properties)owns(properties,property)&&Object.defineProperty(object,property,properties[property]);return object}),Object.seal||(Object.seal=function(object){return object}),Object.freeze||(Object.freeze=function(object){return object});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(freezeObject){return function(object){return\"function\"==typeof object?object:freezeObject(object)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(object){return object}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(object){if(Object(object)===object)throw new TypeError;for(var name=\"\";owns(object,name);)name+=\"?\";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue}),!Object.keys){var hasDontEnumBug=!0,dontEnums=[\"toString\",\"toLocaleString\",\"valueOf\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"constructor\"],dontEnumsLength=dontEnums.length;for(var key in{toString:null})hasDontEnumBug=!1;Object.keys=function(object){if(\"object\"!=typeof object&&\"function\"!=typeof object||null===object)throw new TypeError(\"Object.keys called on a non-object\");var keys=[];for(var name in object)owns(object,name)&&keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;ii>i;i++){var dontEnum=dontEnums[i];owns(object,dontEnum)&&keys.push(dontEnum)}return keys}}Date.now||(Date.now=function(){return(new Date).getTime()});var ws=\"\t\\n\u000b\\f\\r   ᠎              \\u2028\\u2029\";if(!String.prototype.trim||ws.trim()){ws=\"[\"+ws+\"]\";var trimBeginRegexp=RegExp(\"^\"+ws+ws+\"*\"),trimEndRegexp=RegExp(ws+ws+\"*$\");String.prototype.trim=function(){return(this+\"\").replace(trimBeginRegexp,\"\").replace(trimEndRegexp,\"\")}}var toObject=function(o){if(null==o)throw new TypeError(\"can't convert \"+o+\" to object\");return Object(o)}});"; /***/ }), -/* 56 */ +/* 57 */ /***/ (function(module, exports) { ace.define("ace/theme/chaos",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { @@ -75622,7 +76925,7 @@ dom.importCssString(exports.cssText, exports.cssClass); /***/ }), -/* 57 */ +/* 58 */ /***/ (function(module, exports) { ace.define("ace/theme/chrome",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { @@ -75756,7 +77059,7 @@ dom.importCssString(exports.cssText, exports.cssClass); /***/ }), -/* 58 */ +/* 59 */ /***/ (function(module, exports) { ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { @@ -75867,7 +77170,7 @@ dom.importCssString(exports.cssText, exports.cssClass); /***/ }), -/* 59 */ +/* 60 */ /***/ (function(module, exports) { ace.define("ace/theme/solarized_dark",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { @@ -75961,7 +77264,7 @@ dom.importCssString(exports.cssText, exports.cssClass); /***/ }), -/* 60 */ +/* 61 */ /***/ (function(module, exports) { ace.define("ace/theme/solarized_light",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { @@ -76058,7 +77361,7 @@ dom.importCssString(exports.cssText, exports.cssClass); /***/ }), -/* 61 */ +/* 62 */ /***/ (function(module, exports) { ace.define("ace/theme/terminal",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { @@ -76178,7 +77481,7 @@ dom.importCssString(exports.cssText, exports.cssClass); /***/ }), -/* 62 */ +/* 63 */ /***/ (function(module, exports) { ace.define("ace/theme/twilight",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { @@ -76293,7 +77596,7 @@ dom.importCssString(exports.cssText, exports.cssClass); /***/ }), -/* 63 */ +/* 64 */ /***/ (function(module, exports) { ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"], function(acequire, exports, module) { @@ -76387,7 +77690,7 @@ dom.importCssString(exports.cssText, exports.cssClass); /***/ }), -/* 64 */ +/* 65 */ /***/ (function(module, exports) { ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/dom","ace/lib/oop","ace/lib/keys","ace/lib/event","ace/search","ace/lib/useragent","ace/search_highlight","ace/commands/multi_select_commands","ace/mode/text","ace/multi_select"], function(acequire, exports, module) { @@ -81991,7 +83294,7 @@ dom.importCssString(".normal-mode .ace_cursor{\ /***/ }), -/* 65 */ +/* 66 */ /***/ (function(module, exports) { ace.define("ace/occur",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/edit_session","ace/search_highlight","ace/lib/dom"], function(acequire, exports, module) { @@ -83178,7 +84481,7 @@ exports.killRing = { /***/ }), -/* 66 */ +/* 67 */ /***/ (function(module, exports) { ace.define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"], function(acequire, exports, module) { @@ -85139,7 +86442,7 @@ acequire("../config").defineOptions(Editor.prototype, "editor", { /***/ }), -/* 67 */ +/* 68 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -85358,7 +86661,7 @@ let HelpTexts = { /***/ }), -/* 68 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100051,7 +101354,7 @@ let HelpTexts = { /***/ }), -/* 69 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process, global, setImmediate) {/* @preserve @@ -105677,10 +106980,10 @@ module.exports = ret; },{"./es5":13}]},{},[4])(4) }); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(48), __webpack_require__(40), __webpack_require__(70).setImmediate)) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(49), __webpack_require__(40), __webpack_require__(71).setImmediate)) /***/ }), -/* 70 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var apply = Function.prototype.apply; @@ -105733,7 +107036,7 @@ exports._unrefActive = exports.active = function(item) { }; // setimmediate attaches itself to the global object -__webpack_require__(71); +__webpack_require__(72); // On some exotic environments, it's not clear which object `setimmeidate` was // able to install onto. Search each possibility in the same order as the // `setimmediate` library. @@ -105747,7 +107050,7 @@ exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(40))) /***/ }), -/* 71 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { @@ -105937,10 +107240,10 @@ exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || attachTo.clearImmediate = clearImmediate; }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(40), __webpack_require__(48))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(40), __webpack_require__(49))) /***/ }), -/* 72 */ +/* 73 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -106021,14 +107324,16 @@ function purchaseRamForHomeComputer(cost) { /***/ }), -/* 73 */ +/* 74 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return factionInvitationBoxCreate; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_Faction_js__ = __webpack_require__(11); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_Player_js__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__HelperFunctions_js__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_engine_js__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__src_Player_js__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__HelperFunctions_js__ = __webpack_require__(2); + @@ -106057,20 +107362,33 @@ function factionInvitationSetMessage(msg) { //ram argument is in GB function factionInvitationBoxCreate(faction) { factionInvitationSetText("You have received a faction invitation from " + faction.name); - //TODO Faction invitation message + faction.alreadyInvited = true; + __WEBPACK_IMPORTED_MODULE_2__src_Player_js__["a" /* Player */].factionInvitations.push(faction.name); - var newYesButton = Object(__WEBPACK_IMPORTED_MODULE_2__HelperFunctions_js__["b" /* clearEventListeners */])("faction-invitation-box-yes"); + if (__WEBPACK_IMPORTED_MODULE_1__src_engine_js__["Engine"].currentPage === __WEBPACK_IMPORTED_MODULE_1__src_engine_js__["Engine"].Page.Factions) { + __WEBPACK_IMPORTED_MODULE_1__src_engine_js__["Engine"].loadFactionsContent(); + } + + var newYesButton = Object(__WEBPACK_IMPORTED_MODULE_3__HelperFunctions_js__["b" /* clearEventListeners */])("faction-invitation-box-yes"); newYesButton.addEventListener("click", function() { + //Remove from invited factions + var i = __WEBPACK_IMPORTED_MODULE_2__src_Player_js__["a" /* Player */].factionInvitations.findIndex((facName)=>{return facName === faction.name}); + if (i === -1) { + console.log("ERROR: Could not find faction in Player.factionInvitations"); + } else { + __WEBPACK_IMPORTED_MODULE_2__src_Player_js__["a" /* Player */].factionInvitations.splice(i, 1); + } Object(__WEBPACK_IMPORTED_MODULE_0__src_Faction_js__["h" /* joinFaction */])(faction); factionInvitationBoxClose(); + if (__WEBPACK_IMPORTED_MODULE_1__src_engine_js__["Engine"].currentPage === __WEBPACK_IMPORTED_MODULE_1__src_engine_js__["Engine"].Page.Factions) { + __WEBPACK_IMPORTED_MODULE_1__src_engine_js__["Engine"].loadFactionsContent(); + } return false; }); - var noButton = Object(__WEBPACK_IMPORTED_MODULE_2__HelperFunctions_js__["b" /* clearEventListeners */])("faction-invitation-box-no"); + var noButton = Object(__WEBPACK_IMPORTED_MODULE_3__HelperFunctions_js__["b" /* clearEventListeners */])("faction-invitation-box-no"); noButton.addEventListener("click", function() { factionInvitationBoxClose(); - faction.alreadyInvited = true; - __WEBPACK_IMPORTED_MODULE_1__src_Player_js__["a" /* Player */].factionInvitations.push(faction.name); return false; }); @@ -106081,13 +107399,13 @@ function factionInvitationBoxCreate(faction) { /***/ }), -/* 74 */ +/* 75 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return saveObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return loadGame; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Alias_js__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Alias_js__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Company_js__ = __webpack_require__(22); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Constants_js__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__engine_js__ = __webpack_require__(5); @@ -106566,7 +107884,7 @@ function loadImportedGame(saveObj, saveString) { } //Hacknet Nodes offline progress - var offlineProductionFromHacknetNodes = Object(__WEBPACK_IMPORTED_MODULE_6__HacknetNode_js__["c" /* processAllHacknetNodeEarnings */])(numCyclesOffline); + var offlineProductionFromHacknetNodes = Object(__WEBPACK_IMPORTED_MODULE_6__HacknetNode_js__["d" /* processAllHacknetNodeEarnings */])(numCyclesOffline); //Passive faction rep gain offline Object(__WEBPACK_IMPORTED_MODULE_4__Faction_js__["j" /* processPassiveFactionRepGain */])(numCyclesOffline); @@ -106695,818 +108013,63 @@ function openImportFileHandler(evt) { /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(9))) /***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { +/* 76 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NetscriptPort; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Settings_js__ = __webpack_require__(15); -var oop = acequire("../lib/oop"); -var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules; -var DocCommentHighlightRules = function() { - this.$rules = { - "start" : [ { - token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses - }, - DocCommentHighlightRules.getTagRule(), - { - defaultToken : "comment.doc", - caseInsensitive: true - }] - }; -}; - -oop.inherits(DocCommentHighlightRules, TextHighlightRules); - -DocCommentHighlightRules.getTagRule = function(start) { - return { - token : "comment.doc.tag.storage.type", - regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" - }; +function NetscriptPort() { + this.data = []; } -DocCommentHighlightRules.getStartRule = function(start) { - return { - token : "comment.doc", // doc comment - regex : "\\/\\*(?=\\*)", - next : start - }; -}; - -DocCommentHighlightRules.getEndRule = function (start) { - return { - token : "comment.doc", // closing comment - regex : "\\*\\/", - next : start - }; -}; - - -exports.DocCommentHighlightRules = DocCommentHighlightRules; - -}); - -ace.define("ace/mode/netscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(acequire, exports, module) { -"use strict"; - -var oop = acequire("../lib/oop"); -var DocCommentHighlightRules = acequire("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules; -var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"; - -var NetscriptHighlightRules = function(options) { - var keywordMapper = this.createKeywordMapper({ - "variable.language": - "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors - "Namespace|QName|XML|XMLList|" + // E4X - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors - "SyntaxError|TypeError|URIError|" + - "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions - "isNaN|parseFloat|parseInt|" + - "hack|sleep|grow|weaken|print|tprint|scan|nuke|brutessh|ftpcrack|" + //Netscript functions - "clearLog|disableLog|enableLog|" + - "relaysmtp|httpworm|sqlinject|run|exec|spawn|kill|killall|exit|" + - "scp|ls|hasRootAccess|" + - "getIp|getHackingMultipliers|getBitNodeMultipliers|getStats|isBusy|" + - "getHostname|getHackingLevel|getServerMoneyAvailable|getServerMaxMoney|" + - "getServerGrowth|getServerSecurityLevel|getServerBaseSecurityLevel|" + - "getServerMinSecurityLevel|" + - "getServerRequiredHackingLevel|getServerNumPortsRequired|getServerRam|" + - "serverExists|fileExists|isRunning|getNextHacknetNodeCost|" + - "purchaseHacknetNode|deleteServer|getPurchasedServers|" + - "purchaseServer|round|write|read|peek|clear|" + - "scriptRunning|scriptKill|getScriptRam|" + - "getHackTime|getGrowTime|getWeakenTime|getScriptIncome|getScriptExpGain|" + - "getTimeSinceLastAug|" + - "universityCourse|" + - "gymWorkout|travelToCity|purchaseTor|purchaseProgram|upgradeHomeRam|" + - "getUpgradeHomeRamCost|workForCompany|applyToCompany|getCompanyRep|" + - "stopAction|" + - "checkFactionInvitations|joinFaction|workForFaction|getFactionRep|" + - "createProgram|commitCrime|getCrimeChance|getOwnedAugmentations|" + - "getAugmentationsFromFaction|" + - "getAugmentationCost|purchaseAugmentation|" + - "installAugmentations|hacknetnodes|upgradeLevel|upgradeRam|upgradeCore|" + - "getLevelUpgradeCost|getRamUpgradeCost|getCoreUpgradeCost|" + - "getStockPrice|getStockPosition|buyStock|sellStock|shortStock|sellShort|" + - "placeOrder|cancelOrder|" + - "JSON|Math|" + // Other - "this|arguments|prototype|window|document" , // Pseudo - "keyword": - "const|yield|import|get|set|async|await|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); - var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; - - var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex - "u[0-9a-fA-F]{4}|" + // unicode - "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode - "[0-2][0-7]{0,2}|" + // oct - "3[0-7][0-7]?|" + // oct - "[4-7][0-7]?|" + //oct - ".)"; - - this.$rules = { - "no_regex" : [ - DocCommentHighlightRules.getStartRule("doc-start"), - comments("no_regex"), - { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, { - token : "constant.numeric", // hex - regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/ - }, { - token : "constant.numeric", // float - regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" - ], - regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" - ], - regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : [ - "text", "text", "storage.type", "text", "paren.lparen" - ], - regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" - }, { - token : "keyword", - regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" - }, { - token : ["support.constant"], - regex : /that\b/ - }, { - token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "punctuation.operator", - regex : /[.](?![.])/, - next : "property" - }, { - token : "keyword.operator", - regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, - next : "start" - }, { - token : "punctuation.operator", - regex : /[?:,;.]/, - next : "start" - }, { - token : "paren.lparen", - regex : /[\[({]/, - next : "start" - }, { - token : "paren.rparen", - regex : /[\])}]/ - }, { - token: "comment", - regex: /^#!.*$/ - } - ], - property: [{ - token : "text", - regex : "\\s+" - }, { - token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" - ], - regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", - next: "function_arguments" - }, { - token : "punctuation.operator", - regex : /[.](?![.])/ - }, { - token : "support.function", - regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ - }, { - token : "support.function.dom", - regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ - }, { - token : "support.constant", - regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ - }, { - token : "identifier", - regex : identifierRe - }, { - regex: "", - token: "empty", - next: "no_regex" - } - ], - "start": [ - DocCommentHighlightRules.getStartRule("doc-start"), - comments("start"), - { - token: "string.regexp", - regex: "\\/", - next: "regex" - }, { - token : "text", - regex : "\\s+|^$", - next : "start" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "regex": [ - { - token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" - }, { - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ - }, { - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" - } - ], - "regex_character_class": [ - { - token: "regexp.charclass.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" - }, { - token: "constant.language.escape", - regex: "]", - next: "regex" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "function_arguments": [ - { - token: "variable.parameter", - regex: identifierRe - }, { - token: "punctuation.operator", - regex: "[, ]+" - }, { - token: "punctuation.operator", - regex: "$" - }, { - token: "empty", - regex: "", - next: "no_regex" - } - ], - "qqstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" - } - ] - }; - - - if (!options || !options.noES6) { - this.$rules.no_regex.unshift({ - regex: "[{}]", onMatch: function(val, state, stack) { - this.next = val == "{" ? this.nextState : ""; - if (val == "{" && stack.length) { - stack.unshift("start", state); - } - else if (val == "}" && stack.length) { - stack.shift(); - this.next = stack.shift(); - if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1) - return "paren.quasi.end"; - } - return val == "{" ? "paren.lparen" : "paren.rparen"; - }, - nextState: "start" - }, { - token : "string.quasi.start", - regex : /`/, - push : [{ - token : "constant.language.escape", - regex : escapedRe - }, { - token : "paren.quasi.start", - regex : /\${/, - push : "start" - }, { - token : "string.quasi.end", - regex : /`/, - next : "pop" - }, { - defaultToken: "string.quasi" - }] - }); - - if (!options || options.jsx != false) - JSX.call(this); +NetscriptPort.prototype.write = function(data) { + this.data.push(data); + if (this.data.length > __WEBPACK_IMPORTED_MODULE_0__Settings_js__["a" /* Settings */].MaxPortCapacity) { + return this.data.shift(); } - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); - - this.normalizeRules(); -}; - -oop.inherits(NetscriptHighlightRules, TextHighlightRules); - -function JSX() { - var tagRegex = identifierRe.replace("\\d", "\\d\\-"); - var jsxTag = { - onMatch : function(val, state, stack) { - var offset = val.charAt(1) == "/" ? 2 : 1; - if (offset == 1) { - if (state != this.nextState) - stack.unshift(this.next, this.nextState, 0); - else - stack.unshift(this.next); - stack[2]++; - } else if (offset == 2) { - if (state == this.nextState) { - stack[1]--; - if (!stack[1] || stack[1] < 0) { - stack.shift(); - stack.shift(); - } - } - } - return [{ - type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", - value: val.slice(0, offset) - }, { - type: "meta.tag.tag-name.xml", - value: val.substr(offset) - }]; - }, - regex : "", - onMatch : function(value, currentState, stack) { - if (currentState == stack[0]) - stack.shift(); - if (value.length == 2) { - if (stack[0] == this.nextState) - stack[1]--; - if (!stack[1] || stack[1] < 0) { - stack.splice(0, 2); - } - } - this.next = stack[0] || "start"; - return [{type: this.token, value: value}]; - }, - nextState: "jsx" - }, - jsxJsRule, - comments("jsxAttributes"), - { - token : "entity.other.attribute-name.xml", - regex : tagRegex - }, { - token : "keyword.operator.attribute-equals.xml", - regex : "=" - }, { - token : "text.tag-whitespace.xml", - regex : "\\s+" - }, { - token : "string.attribute-value.xml", - regex : "'", - stateName : "jsx_attr_q", - push : [ - {token : "string.attribute-value.xml", regex: "'", next: "pop"}, - {include : "reference"}, - {defaultToken : "string.attribute-value.xml"} - ] - }, { - token : "string.attribute-value.xml", - regex : '"', - stateName : "jsx_attr_qq", - push : [ - {token : "string.attribute-value.xml", regex: '"', next: "pop"}, - {include : "reference"}, - {defaultToken : "string.attribute-value.xml"} - ] - }, - jsxTag - ]; - this.$rules.reference = [{ - token : "constant.language.escape.reference.xml", - regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" - }]; + return null; } -function comments(next) { - return [ - { - token : "comment", // multi line comment - regex : /\/\*/, - next: [ - DocCommentHighlightRules.getTagRule(), - {token : "comment", regex : "\\*\\/", next : next || "pop"}, - {defaultToken : "comment", caseInsensitive: true} - ] - }, { - token : "comment", - regex : "\\/\\/", - next: [ - DocCommentHighlightRules.getTagRule(), - {token : "comment", regex : "$|^", next : next || "pop"}, - {defaultToken : "comment", caseInsensitive: true} - ] - } - ]; -} -exports.NetscriptHighlightRules = NetscriptHighlightRules; -}); - -ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(acequire, exports, module) { -"use strict"; - -var Range = acequire("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) - return false; - - return /^\s*\}/.test(input); - }; - - this.autoOutdent = function(doc, row) { - var line = doc.getLine(row); - var match = line.match(/^(\s*\})/); - - if (!match) return 0; - - var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - - var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); - }; - - this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; - }; - -}).call(MatchingBraceOutdent.prototype); - -exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); - -ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(acequire, exports, module) { -"use strict"; - -var oop = acequire("../../lib/oop"); -var Range = acequire("../../range").Range; -var BaseFoldMode = acequire("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { - if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); +NetscriptPort.prototype.tryWrite = function(data) { + if (this.data.length >= __WEBPACK_IMPORTED_MODULE_0__Settings_js__["a" /* Settings */].MaxPortCapacity) { + return false; } -}; -oop.inherits(FoldMode, BaseFoldMode); + this.data.push(data); + return true; +} -(function() { +NetscriptPort.prototype.read = function() { + if (this.data.length === 0) { + return "NULL PORT DATA"; + } + return this.data.shift(); +} - this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; - this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; - this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; - this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; - this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; - this._getFoldWidgetBase = this.getFoldWidget; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); +NetscriptPort.prototype.peek = function() { + if (this.data.length === 0) { + return "NULL PORT DATA"; + } else { + var foo = this.data.slice(); + return foo[0]; + } +} - if (this.singleLineBlockCommentRe.test(line)) { - if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) - return ""; - } +NetscriptPort.prototype.full = function() { + return this.data.length == __WEBPACK_IMPORTED_MODULE_0__Settings_js__["a" /* Settings */].MaxPortCapacity; +} - var fw = this._getFoldWidgetBase(session, foldStyle, row); +NetscriptPort.prototype.empty = function() { + return this.data.length === 0; +} - if (!fw && this.startRegionRe.test(line)) - return "start"; // lineCommentRegionStart +NetscriptPort.prototype.clear = function() { + this.data.length = 0; +} - return fw; - }; - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { - var line = session.getLine(row); - - if (this.startRegionRe.test(line)) - return this.getCommentRegionBlock(session, line, row); - - var match = line.match(this.foldingStartMarker); - if (match) { - var i = match.index; - - if (match[1]) - return this.openingBracketBlock(session, match[1], row, i); - - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - - if (range && !range.isMultiLine()) { - if (forceMultiline) { - range = this.getSectionRange(session, row); - } else if (foldStyle != "all") - range = null; - } - - return range; - } - - if (foldStyle === "markbegin") - return; - - var match = line.match(this.foldingStopMarker); - if (match) { - var i = match.index + match[0].length; - - if (match[1]) - return this.closingBracketBlock(session, match[1], row, i); - - return session.getCommentFoldRange(row, i, -1); - } - }; - - this.getSectionRange = function(session, row) { - var line = session.getLine(row); - var startIndent = line.search(/\S/); - var startRow = row; - var startColumn = line.length; - row = row + 1; - var endRow = row; - var maxRow = session.getLength(); - while (++row < maxRow) { - line = session.getLine(row); - var indent = line.search(/\S/); - if (indent === -1) - continue; - if (startIndent > indent) - break; - var subRange = this.getFoldWidgetRange(session, "all", row); - - if (subRange) { - if (subRange.start.row <= startRow) { - break; - } else if (subRange.isMultiLine()) { - row = subRange.end.row; - } else if (startIndent == indent) { - break; - } - } - endRow = row; - } - - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); - }; - this.getCommentRegionBlock = function(session, line, row) { - var startColumn = line.search(/\s*$/); - var maxRow = session.getLength(); - var startRow = row; - - var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; - var depth = 1; - while (++row < maxRow) { - line = session.getLine(row); - var m = re.exec(line); - if (!m) continue; - if (m[1]) depth--; - else depth++; - - if (!depth) break; - } - - var endRow = row; - if (endRow > startRow) { - return new Range(startRow, startColumn, endRow, line.length); - } - }; - -}).call(FoldMode.prototype); - -}); - -ace.define("ace/mode/netscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/netscript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(acequire, exports, module) { -"use strict"; - -var oop = acequire("../lib/oop"); -var TextMode = acequire("./text").Mode; -var NetscriptHighlightRules = acequire("./netscript_highlight_rules").NetscriptHighlightRules; -var MatchingBraceOutdent = acequire("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = acequire("../worker/worker_client").WorkerClient; -var CstyleBehaviour = acequire("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = acequire("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = NetscriptHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); - if (match) { - indent += tab; - } - } else if (state == "doc-start") { - if (endState == "start" || endState == "no_regex") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], __webpack_require__(55), "JavaScriptWorker"); - worker.attachToDocument(session.getDocument()); - - worker.on("annotate", function(results) { - session.setAnnotations(results.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/netscript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); /***/ }) diff --git a/doc/build/doctrees/environment.pickle b/doc/build/doctrees/environment.pickle index a91ffcc2a..32ab60f14 100644 Binary files a/doc/build/doctrees/environment.pickle and b/doc/build/doctrees/environment.pickle differ diff --git a/doc/build/doctrees/index.doctree b/doc/build/doctrees/index.doctree index 4ebe9e23f..4a4672c65 100644 Binary files a/doc/build/doctrees/index.doctree and b/doc/build/doctrees/index.doctree differ diff --git a/doc/build/doctrees/netscript.doctree b/doc/build/doctrees/netscript.doctree index d4bd06dc4..810627cd6 100644 Binary files a/doc/build/doctrees/netscript.doctree and b/doc/build/doctrees/netscript.doctree differ diff --git a/doc/build/doctrees/netscriptadvancedfunctions.doctree b/doc/build/doctrees/netscriptadvancedfunctions.doctree index 6666f9448..463bee0e4 100644 Binary files a/doc/build/doctrees/netscriptadvancedfunctions.doctree and b/doc/build/doctrees/netscriptadvancedfunctions.doctree differ diff --git a/doc/build/doctrees/netscriptdatatypes.doctree b/doc/build/doctrees/netscriptdatatypes.doctree index bcaccaad8..f494afaca 100644 Binary files a/doc/build/doctrees/netscriptdatatypes.doctree and b/doc/build/doctrees/netscriptdatatypes.doctree differ diff --git a/doc/build/doctrees/netscriptfunctions.doctree b/doc/build/doctrees/netscriptfunctions.doctree index 6ebde9926..c28d21fbe 100644 Binary files a/doc/build/doctrees/netscriptfunctions.doctree and b/doc/build/doctrees/netscriptfunctions.doctree differ diff --git a/doc/build/doctrees/netscripthacknetnodeapi.doctree b/doc/build/doctrees/netscripthacknetnodeapi.doctree index cd49d3f8d..09a3b2cee 100644 Binary files a/doc/build/doctrees/netscripthacknetnodeapi.doctree and b/doc/build/doctrees/netscripthacknetnodeapi.doctree differ diff --git a/doc/build/doctrees/netscriptixapi.doctree b/doc/build/doctrees/netscriptixapi.doctree index 822d2b9cd..ebc49fdb5 100644 Binary files a/doc/build/doctrees/netscriptixapi.doctree and b/doc/build/doctrees/netscriptixapi.doctree differ diff --git a/doc/build/doctrees/netscriptloopsandconditionals.doctree b/doc/build/doctrees/netscriptloopsandconditionals.doctree index b8dc9699a..ca318bf89 100644 Binary files a/doc/build/doctrees/netscriptloopsandconditionals.doctree and b/doc/build/doctrees/netscriptloopsandconditionals.doctree differ diff --git a/doc/build/doctrees/netscriptmisc.doctree b/doc/build/doctrees/netscriptmisc.doctree index 664f9a037..be89f8c2b 100644 Binary files a/doc/build/doctrees/netscriptmisc.doctree and b/doc/build/doctrees/netscriptmisc.doctree differ diff --git a/doc/build/doctrees/netscriptoperators.doctree b/doc/build/doctrees/netscriptoperators.doctree index 9825cea04..51bf67baa 100644 Binary files a/doc/build/doctrees/netscriptoperators.doctree and b/doc/build/doctrees/netscriptoperators.doctree differ diff --git a/doc/build/doctrees/netscriptscriptarguments.doctree b/doc/build/doctrees/netscriptscriptarguments.doctree index a676e7a9c..910a719a2 100644 Binary files a/doc/build/doctrees/netscriptscriptarguments.doctree and b/doc/build/doctrees/netscriptscriptarguments.doctree differ diff --git a/doc/build/doctrees/netscriptsingularityfunctions.doctree b/doc/build/doctrees/netscriptsingularityfunctions.doctree index 2bcaad59f..7f09dc6a5 100644 Binary files a/doc/build/doctrees/netscriptsingularityfunctions.doctree and b/doc/build/doctrees/netscriptsingularityfunctions.doctree differ diff --git a/doc/build/html/_sources/netscripthacknetnodeapi.rst.txt b/doc/build/html/_sources/netscripthacknetnodeapi.rst.txt index 1f3755fe0..73c0860c1 100644 --- a/doc/build/html/_sources/netscripthacknetnodeapi.rst.txt +++ b/doc/build/html/_sources/netscripthacknetnodeapi.rst.txt @@ -25,27 +25,27 @@ a value to these. Note that these must be called on an element inside the *hacknetnodes* array, not the array itself. -.. js:function:: hacknetnodes[i].level +.. js:attribute:: hacknetnodes[i].level Returns the level of the corresponding Hacknet Node -.. js:function:: hacknetnodes[i].ram +.. js:attribute:: hacknetnodes[i].ram Returns the amount of RAM on the corresponding Hacknet Node -.. js:function:: hacknetnodes[i].cores +.. js:attribute:: hacknetnodes[i].cores Returns the number of cores on the corresponding Hacknet Node -.. js:function:: hacknetnodes[i].totalMoneyGenerated +.. js:attribute:: hacknetnodes[i].totalMoneyGenerated Returns the total amount of money that the corresponding Hacknet Node has earned -.. js:function:: hacknetnodes[i].onlineTimeSeconds +.. js:attribute:: hacknetnodes[i].onlineTimeSeconds Returns the total amount of time (in seconds) that the corresponding Hacknet Node has existed -.. js:function:: hacknetnodes[i].moneyGainRatePerSecond +.. js:attribute:: hacknetnodes[i].moneyGainRatePerSecond Returns the amount of income that the corresponding Hacknet Node earns @@ -57,7 +57,7 @@ The following is a list of supported functions/methods for a Hacknet Node object Note that these must be called on an element inside the *hacknetnodes* array, not the array itself. -.. js:function:: hacknetnodes[i].upgradeLevel(n); +.. js:method:: hacknetnodes[i].upgradeLevel(n) :param number n: Number of levels to upgrade. Must be positive. Rounded to nearest integer @@ -65,27 +65,27 @@ array itself. Hacknet Node's level is successfully upgraded *n* times or up to the max level (200), and false otherwise. -.. js:function:: hacknetnodes[i].upgradeRam() +.. js:method:: hacknetnodes[i].upgradeRam() Tries to upgrade the amount of RAM on the corresponding Hacknet Node. Returns true if the RAM is successfully upgraded and false otherwise. -.. js:function:: hacknetnodes[i].upgradeCore() +.. js:method:: hacknetnodes[i].upgradeCore() Tries to purchase an additional core for the corresponding Hacknet Node. Returns true if the additional core is successfully purchased, and false otherwise. -.. js:function:: hacknetnodes[i].getLevelUpgradeCost(n); +.. js:method:: hacknetnodes[i].getLevelUpgradeCost(n) :param number n: Number of levels to upgrade. Must be positive. Rounded to nearest integer Returns the cost of upgrading the specified Hacknet Node by *n* levels -.. js:function:: hacknetnodes[i].getRamUpgradeCost() +.. js:method:: hacknetnodes[i].getRamUpgradeCost() Returns the cost of upgrading the RAM of the specified Hacknet Node. Upgrading a Node's RAM doubles it. -.. js:function:: hacknetnodes[i].getCoreUpgradeCost() +.. js:method:: hacknetnodes[i].getCoreUpgradeCost() Returns the cost of upgrading the number of cores of the specified Hacknet Node. Upgrading a Node's number of cores adds one additional core. diff --git a/doc/build/html/_sources/netscriptmisc.rst.txt b/doc/build/html/_sources/netscriptmisc.rst.txt index edf960583..7c595762b 100644 --- a/doc/build/html/_sources/netscriptmisc.rst.txt +++ b/doc/build/html/_sources/netscriptmisc.rst.txt @@ -1,6 +1,135 @@ Netscript Miscellaneous ======================= +Netscript Ports +--------------- +Netscript ports are endpoints that can be used to communicate between scripts. +A port is implemented as a sort of serialized queue, where you can only write +and read one element at a time from the port. When you read data from a port, +the element that is read is removed from the port. + +The :js:func:`read`, :js:func:`write`, :js:func:`clear`, and :js:func:`peek` +Netscript functions can be used to interact with ports. + +Right now, there are only 20 ports for Netscript, denoted by the number 1 +through 20. When using the functions above, the ports are specified +by passing the number as the first argument. + +IMPORTANT: The data inside ports are not saved! This means if you close and +re-open the game, or reload the page then you will lose all of the data in +the ports! + +**Example Usage** + +Here's a brief example of how ports work. For the sake of simplicity we'll only deal with port 1. + +Let's assume Port 1 starts out empty (no data inside). We'll represent the port as such:: + + [] + +Now assume we ran the following simple script:: + + for (i = 0; i < 10; ++i) { + write(1, i); //Writes the value of i to port 1 + } + +After this script executes, our script will contain every number from 0 through 9, as so:: + + [0, 1, 2, 3, 4, 5, 6, 7 , 8, 9] + +Then, assume we run the following script:: + + for (i = 0; i < 3; ++i) { + print(read(1)); //Reads a value from port 1 and then prints it + } + +This script above will read the first three values from port 1 and then print them to the script's log. The log will end up looking like:: + + 0 + 1 + 2 + +And the data in port 1 will look like:: + + [3, 4, 5, 6, 7, 8, 9] + +**Port Handles** + +The :js:func:`getPortHandle` Netscript function can be used to get a handle to a Netscript Port. +This handle allows you to access several new port-related functions and the +port's underlying data structure, which is just a Javascript array. The functions are: + +.. js:method:: NetscriptPort.write(data) + + :param data: Data to write to the port + :returns: If the port is full, the item that is removed from the port is returned. + Otherwise, null is returned. + + Writes `data` to the port. Works the same as the Netscript function `write`. + +.. js:method:: NetscriptPort.tryWrite(data) + + :param data: Data to try to write to the port + :returns: True if the data is successfully written to the port, and false otherwise. + + Attempts to write `data` to the Netscript port. If the port is full, the data will + not be written. Otherwise, the data will be written normally. + +.. js::method:: NetscriptPort.read() + + :returns: The data read from the port. If the port is empty, "NULL PORT DATA" is returned + + Removes and returns the first element from the port. + Works the same as the Netscript function `read` + +.. js::method:: NetscriptPort.peek() + + :returns: The first element in the port, or "NULL PORT DATA" if the port is empty. + + Returns the first element in the port, but does not remove it. + Works the same as the Netscript function `peek` + +.. js:method:: NetscriptPort.full() + + :returns: True if the Netscript Port is full, and false otherwise + +.. js:method:: NetscriptPort.empty() + + :returns: True if the Netscript Port is empty, and false otherwise + +.. js:method:: NetscriptPort.clear() + + Clears all data from the port. Works the same as the Netscript function `clear` + +.. js:attribute:: NetscriptPort.data + + The Netscript port underlying data structure, which is just a Javascript array. All + valid Javascript Array methods can be called on this. + +Port Handle Example:: + + port = getPortHandle(5); + back = port.data.pop(); //Get and remove last element in port + + //Remove an element from the port + i = port.data.findIndex("foo"); + if (i != -1) { + port.data.slice(i, 1); + } + + //Wait for port data before reading + while(port.empty()) { + sleep(10000); + } + res = port.read(); + + //Wait for there to be room in a port before writing + while (!port.tryWrite(5)) { + sleep(5000); + } + + //Successfully wrote to port! + Comments -------- @@ -35,3 +164,13 @@ However, since the 'new' operator does not work in Netscript, only the Date modu Example:: time = Date.now(); + +Javascript Number Module +------------------------ + +The `Javascript Number module `_ is supported in Netscript. + +Example:: + + tprint(Number.isInteger(1)); //True + tprint(Number.isInteger(1.534059)); //False diff --git a/doc/build/html/genindex.html b/doc/build/html/genindex.html index 0d1f263e6..f75e70fb2 100644 --- a/doc/build/html/genindex.html +++ b/doc/build/html/genindex.html @@ -229,41 +229,19 @@
    -
  • hacknetnodes[i].onlineTimeSeconds() (hacknetnodes[i] method) +
  • hacknetnodes[i].onlineTimeSeconds (hacknetnodes[i] attribute)
  • -
  • hacknetnodes[i].ram() (hacknetnodes[i] method) +
  • hacknetnodes[i].ram (hacknetnodes[i] attribute)
  • -
  • hacknetnodes[i].totalMoneyGenerated() (hacknetnodes[i] method) -
  • -
  • hacknetnodes[i].upgradeCore() (hacknetnodes[i] method) -
  • -
  • - hacknetnodes[i].upgradeLevel(n) - -
  • -
  • hacknetnodes[i].upgradeRam() (hacknetnodes[i] method) +
  • hacknetnodes[i].totalMoneyGenerated (hacknetnodes[i] attribute)
  • hasRootAccess() (built-in function)
  • @@ -316,6 +294,10 @@

    N

    +
    • nuke() (built-in function)
    • diff --git a/doc/build/html/index.html b/doc/build/html/index.html index 460778558..22d0bf0c7 100644 --- a/doc/build/html/index.html +++ b/doc/build/html/index.html @@ -196,9 +196,11 @@ secrets that you've been searching for.

  • Miscellaneous
  • diff --git a/doc/build/html/netscript.html b/doc/build/html/netscript.html index d98bd8958..9ea7ea1d3 100644 --- a/doc/build/html/netscript.html +++ b/doc/build/html/netscript.html @@ -197,9 +197,11 @@ to reach out to the developer!

  • Miscellaneous
  • diff --git a/doc/build/html/netscriptadvancedfunctions.html b/doc/build/html/netscriptadvancedfunctions.html index c512aefed..d80d2ca0b 100644 --- a/doc/build/html/netscriptadvancedfunctions.html +++ b/doc/build/html/netscriptadvancedfunctions.html @@ -122,6 +122,7 @@ will only give 10% of the money you would have received in BitNode-1. The object
  • Hacknet Node API
  • Trade Information eXchange (TIX) API
  • Singularity Functions
  • +
  • Miscellaneous
  • diff --git a/doc/build/html/netscriptdatatypes.html b/doc/build/html/netscriptdatatypes.html index fb8ef74ee..be7655a7e 100644 --- a/doc/build/html/netscriptdatatypes.html +++ b/doc/build/html/netscriptdatatypes.html @@ -112,6 +112,7 @@ can also change. For example, if a variable initially holds a number, it can lat
  • Hacknet Node API
  • Trade Information eXchange (TIX) API
  • Singularity Functions
  • +
  • Miscellaneous
  • diff --git a/doc/build/html/netscripthacknetnodeapi.html b/doc/build/html/netscripthacknetnodeapi.html index dafe071cf..193d0356b 100644 --- a/doc/build/html/netscripthacknetnodeapi.html +++ b/doc/build/html/netscripthacknetnodeapi.html @@ -72,39 +72,39 @@ accessed using hacknetnodes[0]. The fourth Hacknet Node you purchase wi

    The following is a list of member variables for a Hacknet Node object. These variables are read-only, which means you cannot assign a value to these.

    Note that these must be called on an element inside the hacknetnodes array, not the array itself.

    -
    +
    -hacknetnodes[i].level()
    +hacknetnodes[i].level

    Returns the level of the corresponding Hacknet Node

    -
    +
    -hacknetnodes[i].ram()
    +hacknetnodes[i].ram

    Returns the amount of RAM on the corresponding Hacknet Node

    -
    +
    -hacknetnodes[i].cores()
    +hacknetnodes[i].cores

    Returns the number of cores on the corresponding Hacknet Node

    -
    +
    -hacknetnodes[i].totalMoneyGenerated()
    +hacknetnodes[i].totalMoneyGenerated

    Returns the total amount of money that the corresponding Hacknet Node has earned

    -
    +
    -hacknetnodes[i].onlineTimeSeconds()
    +hacknetnodes[i].onlineTimeSeconds

    Returns the total amount of time (in seconds) that the corresponding Hacknet Node has existed

    -
    +
    -hacknetnodes[i].moneyGainRatePerSecond()
    +hacknetnodes[i].moneyGainRatePerSecond

    Returns the amount of income that the corresponding Hacknet Node earns

    @@ -114,9 +114,9 @@ a value to these.

    The following is a list of supported functions/methods for a Hacknet Node object.

    Note that these must be called on an element inside the hacknetnodes array, not the array itself.

    -
    -
    -hacknetnodes[i].upgradeLevel(n);()
    +
    +
    +hacknetnodes[i].upgradeLevel(n)
    @@ -133,23 +133,23 @@ Hacknet Node's level is successfully upgraded n times or up to the max otherwise.

    -
    +
    hacknetnodes[i].upgradeRam()

    Tries to upgrade the amount of RAM on the corresponding Hacknet Node. Returns true if the RAM is successfully upgraded and false otherwise.

    -
    +
    hacknetnodes[i].upgradeCore()

    Tries to purchase an additional core for the corresponding Hacknet Node. Returns true if the additional core is successfully purchased, and false otherwise.

    -
    -
    -hacknetnodes[i].getLevelUpgradeCost(n);()
    +
    +
    +hacknetnodes[i].getLevelUpgradeCost(n)
    @@ -164,13 +164,13 @@ additional core is successfully purchased, and false otherwise.

    Returns the cost of upgrading the specified Hacknet Node by n levels

    -
    +
    hacknetnodes[i].getRamUpgradeCost()

    Returns the cost of upgrading the RAM of the specified Hacknet Node. Upgrading a Node's RAM doubles it.

    -
    +
    hacknetnodes[i].getCoreUpgradeCost()

    Returns the cost of upgrading the number of cores of the specified Hacknet Node. Upgrading a Node's @@ -241,6 +241,7 @@ Nodes to a level of at least 75, RAM to at least 8GB, and number of cores to at

  • Trade Information eXchange (TIX) API
  • Singularity Functions
  • +
  • Miscellaneous
  • diff --git a/doc/build/html/netscriptixapi.html b/doc/build/html/netscriptixapi.html index 2bb9f0c5d..babfd261c 100644 --- a/doc/build/html/netscriptixapi.html +++ b/doc/build/html/netscriptixapi.html @@ -326,6 +326,7 @@ NOT case-sensitive.
  • Singularity Functions
  • +
  • Miscellaneous
  • diff --git a/doc/build/html/netscriptmisc.html b/doc/build/html/netscriptmisc.html index cfc34363c..25a9940af 100644 --- a/doc/build/html/netscriptmisc.html +++ b/doc/build/html/netscriptmisc.html @@ -50,6 +50,162 @@

    Netscript Miscellaneous

    +
    +

    Netscript Ports

    +

    Netscript ports are endpoints that can be used to communicate between scripts. +A port is implemented as a sort of serialized queue, where you can only write +and read one element at a time from the port. When you read data from a port, +the element that is read is removed from the port.

    +

    The read(), write(), clear(), and peek() +Netscript functions can be used to interact with ports.

    +

    Right now, there are only 20 ports for Netscript, denoted by the number 1 +through 20. When using the functions above, the ports are specified +by passing the number as the first argument.

    +

    IMPORTANT: The data inside ports are not saved! This means if you close and +re-open the game, or reload the page then you will lose all of the data in +the ports!

    +

    Example Usage

    +

    Here's a brief example of how ports work. For the sake of simplicity we'll only deal with port 1.

    +

    Let's assume Port 1 starts out empty (no data inside). We'll represent the port as such:

    +
    []
    +
    +
    +

    Now assume we ran the following simple script:

    +
    for (i = 0; i < 10; ++i) {
    +    write(1, i); //Writes the value of i to port 1
    +}
    +
    +
    +

    After this script executes, our script will contain every number from 0 through 9, as so:

    +
    [0, 1, 2, 3, 4, 5, 6, 7 , 8, 9]
    +
    +
    +

    Then, assume we run the following script:

    +
    for (i = 0; i < 3; ++i) {
    +    print(read(1)); //Reads a value from port 1 and then prints it
    +}
    +
    +
    +

    This script above will read the first three values from port 1 and then print them to the script's log. The log will end up looking like:

    +
    0
    +1
    +2
    +
    +
    +

    And the data in port 1 will look like:

    +
    [3, 4, 5, 6, 7, 8, 9]
    +
    +
    +

    Port Handles

    +

    The getPortHandle() Netscript function can be used to get a handle to a Netscript Port. +This handle allows you to access several new port-related functions and the +port's underlying data structure, which is just a Javascript array. The functions are:

    +
    +
    +NetscriptPort.write(data)
    +
    +++ + + + + + +
    Arguments:
      +
    • data -- Data to write to the port
    • +
    +
    Returns:

    If the port is full, the item that is removed from the port is returned. +Otherwise, null is returned.

    +
    +

    Writes data to the port. Works the same as the Netscript function write.

    +
    + +
    +
    +NetscriptPort.tryWrite(data)
    +
    +++ + + + + + +
    Arguments:
      +
    • data -- Data to try to write to the port
    • +
    +
    Returns:

    True if the data is successfully written to the port, and false otherwise.

    +
    +

    Attempts to write data to the Netscript port. If the port is full, the data will +not be written. Otherwise, the data will be written normally.

    +
    + +
    +
    +NetscriptPort.full()
    +
    +++ + + + +
    Returns:True if the Netscript Port is full, and false otherwise
    +
    + +
    +
    +NetscriptPort.empty()
    +
    +++ + + + +
    Returns:True if the Netscript Port is empty, and false otherwise
    +
    + +
    +
    +NetscriptPort.clear()
    +

    Clears all data from the port. Works the same as the Netscript function clear

    +
    + +
    +
    +NetscriptPort.data
    +

    The Netscript port underlying data structure, which is just a Javascript array. All +valid Javascript Array methods can be called on this.

    +
    + +

    Port Handle Example:

    +
    port = getPortHandle(5);
    +back = port.data.pop(); //Get and remove last element in port
    +
    +//Remove an element from the port
    +i = port.data.findIndex("foo");
    +if (i != -1) {
    +    port.data.slice(i, 1);
    +}
    +
    +//Wait for port data before reading
    +while(port.empty()) {
    +    sleep(10000);
    +}
    +res = port.read();
    +
    +//Wait for there to be room in a port before writing
    +while (!port.tryWrite(5)) {
    +    sleep(5000);
    +}
    +
    +//Successfully wrote to port!
    +
    +
    +

    Comments

    Netscript supports comments using the same syntax as Javascript comments. @@ -85,6 +241,15 @@ However, since the 'new' operator does not work in Netscript, only the Date modu

    +
    +

    Javascript Number Module

    +

    The Javascript Number module is supported in Netscript.

    +

    Example:

    +
    tprint(Number.isInteger(1));        //True
    +tprint(Number.isInteger(1.534059)); //False
    +
    +
    +
    @@ -107,9 +272,11 @@ However, since the 'new' operator does not work in Netscript, only the Date modu
  • Trade Information eXchange (TIX) API
  • Singularity Functions
  • Miscellaneous
  • diff --git a/doc/build/html/netscriptoperators.html b/doc/build/html/netscriptoperators.html index 03bfda8bc..fb8d7f7d8 100644 --- a/doc/build/html/netscriptoperators.html +++ b/doc/build/html/netscriptoperators.html @@ -209,6 +209,7 @@ change the value of their operands. For example:

  • Hacknet Node API
  • Trade Information eXchange (TIX) API
  • Singularity Functions
  • +
  • Miscellaneous
  • diff --git a/doc/build/html/netscriptscriptarguments.html b/doc/build/html/netscriptscriptarguments.html index a44a72298..4b4252976 100644 --- a/doc/build/html/netscriptscriptarguments.html +++ b/doc/build/html/netscriptscriptarguments.html @@ -87,6 +87,7 @@ script specified in the first argument with the amount of threads specified in t
  • Hacknet Node API
  • Trade Information eXchange (TIX) API
  • Singularity Functions
  • +
  • Miscellaneous
  • diff --git a/doc/build/html/objects.inv b/doc/build/html/objects.inv index 0261f5b6c..09ee31d2a 100644 Binary files a/doc/build/html/objects.inv and b/doc/build/html/objects.inv differ diff --git a/doc/build/html/searchindex.js b/doc/build/html/searchindex.js index a7eda5804..9c3e67c52 100644 --- a/doc/build/html/searchindex.js +++ b/doc/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index","netscript","netscriptadvancedfunctions","netscriptdatatypes","netscriptfunctions","netscripthacknetnodeapi","netscriptixapi","netscriptloopsandconditionals","netscriptmisc","netscriptoperators","netscriptscriptarguments","netscriptsingularityfunctions"],envversion:53,filenames:["index.rst","netscript.rst","netscriptadvancedfunctions.rst","netscriptdatatypes.rst","netscriptfunctions.rst","netscripthacknetnodeapi.rst","netscriptixapi.rst","netscriptloopsandconditionals.rst","netscriptmisc.rst","netscriptoperators.rst","netscriptscriptarguments.rst","netscriptsingularityfunctions.rst"],objects:{"":{applyToCompany:[11,0,1,""],buyStock:[6,0,1,""],cancelOrder:[6,0,1,""],checkFactionInvitations:[11,0,1,""],clearLog:[4,0,1,""],createProgram:[11,0,1,""],deleteServer:[4,0,1,""],disableLog:[4,0,1,""],enableLog:[4,0,1,""],fileExists:[4,0,1,""],getAugmentationCost:[11,0,1,""],getAugmentationsFromFaction:[11,0,1,""],getBitNodeMultipliers:[2,0,1,""],getCompanyRep:[11,0,1,""],getCrimeChance:[11,0,1,""],getFactionRep:[11,0,1,""],getGrowTime:[4,0,1,""],getHackTime:[4,0,1,""],getHackingLevel:[4,0,1,""],getHackingMultipliers:[4,0,1,""],getHostname:[4,0,1,""],getNextHacknetNodeCost:[4,0,1,""],getOwnedAugmentations:[11,0,1,""],getPurchasedServers:[4,0,1,""],getScriptExpGain:[4,0,1,""],getScriptIncome:[4,0,1,""],getScriptRam:[4,0,1,""],getServerBaseSecurityLevel:[4,0,1,""],getServerGrowth:[4,0,1,""],getServerMaxMoney:[4,0,1,""],getServerMinSecurityLevel:[4,0,1,""],getServerMoneyAvailable:[4,0,1,""],getServerNumPortsRequired:[4,0,1,""],getServerRam:[4,0,1,""],getServerRequiredHackingLevel:[4,0,1,""],getServerSecurityLevel:[4,0,1,""],getStats:[11,0,1,""],getStockPosition:[6,0,1,""],getStockPrice:[6,0,1,""],getTimeSinceLastAug:[4,0,1,""],getUpgradeHomeRamCost:[11,0,1,""],getWeakenTime:[4,0,1,""],gymWorkout:[11,0,1,""],hasRootAccess:[4,0,1,""],installAugmentations:[11,0,1,""],isBusy:[11,0,1,""],isRunning:[4,0,1,""],joinFaction:[11,0,1,""],placeOrder:[6,0,1,""],purchaseAugmentation:[11,0,1,""],purchaseHacknetNode:[4,0,1,""],purchaseProgram:[11,0,1,""],purchaseServer:[4,0,1,""],purchaseTor:[11,0,1,""],scriptKill:[4,0,1,""],scriptRunning:[4,0,1,""],sellShort:[6,0,1,""],sellStock:[6,0,1,""],serverExists:[4,0,1,""],shortStock:[6,0,1,""],stopAction:[11,0,1,""],travelToCity:[11,0,1,""],universityCourse:[11,0,1,""],upgradeHomeRam:[11,0,1,""],workForCompany:[11,0,1,""],workForFaction:[11,0,1,""]},"hacknetnodes[i]":{"getLevelUpgradeCost(n);":[5,0,1,""],"upgradeLevel(n);":[5,0,1,""],cores:[5,0,1,""],getCoreUpgradeCost:[5,0,1,""],getRamUpgradeCost:[5,0,1,""],level:[5,0,1,""],moneyGainRatePerSecond:[5,0,1,""],onlineTimeSeconds:[5,0,1,""],ram:[5,0,1,""],totalMoneyGenerated:[5,0,1,""],upgradeCore:[5,0,1,""],upgradeRam:[5,0,1,""]}},objnames:{"0":["js","function","JavaScript function"]},objtypes:{"0":"js:function"},terms:{"8gb":5,"boolean":[3,4,11],"break":10,"case":[4,6,11],"class":11,"default":[4,11],"float":3,"function":[0,1,3,5,6,7,8],"long":6,"new":[4,5,8,11],"null":4,"return":[2,4,5,6,9,11],"short":6,"static":8,"true":[3,4,5,6,9,11],"try":[4,10,11],"var":7,"while":[4,5,7,11],AND:9,Adding:3,For:[2,3,4,5,7,9,10],IPs:4,NOT:[4,6,9,11],Not:11,One:11,The:[0,2,3,4,5,6,7,8,10,11],Their:3,Then:5,These:[2,4,5,11],Use:4,Will:[4,6],Yes:4,abil:6,abl:11,about:[3,4,8],abov:[3,4,9],accept:11,access:[3,4,5,6,10,11],action:11,activ:4,actual:[4,6,8,11],add:5,added:4,addit:[4,5,9,11],address:4,advanc:[0,1],aevum:11,affect:4,afford:4,after:[3,4,6,11],agenc:11,agent:11,agi:11,agil:11,aid:0,aka:11,algorithm:[6,11],all:[3,4,5,6,11],allow:[6,11],almost:1,alphabet:4,alphanumer:3,alreadi:[4,11],also:[3,4,6,10,11],alwai:[],amount:[4,5,6,10,11],ani:[0,1,3,4,11],anoth:[4,10],anyth:4,anywher:4,api:[0,1],appear:4,append:4,appli:[4,11],applytocompani:[0,1],arg:[4,10],argument:[0,1,4,5,6,11],around:[0,11],arrai:[3,4,5,6,10,11],aspect:11,assign:[5,9],attack:4,attempt:6,augment:[4,6,11],augmentationmoneycost:2,augmentationrepcost:2,augnam:11,autolink:11,autom:[5,6],automat:[4,6,11],avail:[3,4,6,7,11],averag:6,avgpx:6,avgpxshort:6,base:[4,9],basic:[0,1],becaus:[2,4],becom:2,been:0,being:4,below:4,best:10,beta:0,between:[2,4],billion:6,binari:[0,1],bitburn:1,bitnod:[2,11],both:4,box:4,brutessh:[0,1,11],bui:[6,11],build:6,busi:11,buystock:[0,1],calcul:6,call:[0,4,5,10,11],callback:11,can:[0,3,4,5,6,7,8,10,11],cancel:[6,11],cancelord:[0,1],cannot:[4,5],capabl:3,capit:6,caus:4,caveat:7,cbscript:11,certain:[4,6],chanc:[4,11],chang:[2,3,4,9],charact:3,charisma:11,check:[4,7,11],checkfactioninvit:[0,1],chongq:11,citi:11,citynam:11,classgymexpgain:2,clear:[0,1],clearlog:[0,1],click:4,code:[4,6,7,8,9,10],command:[3,4,11],comment:[0,1,9],commiss:6,commit:[2,11],commitcrim:[0,1],commun:6,compani:[6,11],companynam:11,companyworkexpgain:2,companyworkmonei:2,complet:4,comput:[4,11],condit:[0,1],confirm:0,constantli:4,constrain:4,consult:11,contain:[2,3,4,11],content:0,continu:11,contract:11,control:11,convert:4,copi:4,core:5,correct:11,correspond:5,cost:[4,5,6,11],count:4,cours:11,coursenam:11,creat:[4,6,11],createprogram:[0,1],crime:[2,11],crimeexpgain:2,crimemonei:2,crush:11,current:[0,2,4,6,11],cyberpunk:0,dark:[0,11],data:[0,1,4,11],date:[0,1],decim:11,declar:[3,4,7],decreas:4,decrement:9,deepscanv1:11,deepscanv2:11,def:11,defens:11,defin:[0,1],delai:4,delet:4,deleteserv:[0,1],denot:4,depend:4,describ:4,destin:4,detail:4,determin:4,develop:[0,1],dex:11,dexter:11,dialog:4,differ:[2,3,4],disabl:4,disablelog:[0,1],divis:9,document:[4,7,8,11],doe:[1,4,6,8,9],doing:[5,10],don:[8,11],doubl:[3,5],due:4,dystopian:0,each:[5,6,11],earli:0,earn:[4,5,11],ecp:6,effect:4,either:[3,4],element:[4,5,6,10,11],els:[7,11],embark:0,emploi:11,employe:11,empti:4,enabl:4,enablelog:[0,1],encapsul:3,end:[4,5,11],engin:11,enough:[4,6],equal:9,equival:[3,4],error:4,etc:[3,4,10,11],evalu:8,even:[4,6,8,9],everi:[4,6,11],exampl:[0,1,2,3,4,6,7,8,9,10,11],exce:6,exceed:4,except:4,exchang:[0,1],exe:[4,11],exec:[0,1],execut:[4,6,8],exist:[4,5,7],exit:[0,1],experi:[4,11],explain:8,extens:[4,11],facnam:11,faction:11,factionnam:11,factionpassiverepgain:2,factionworkexpgain:2,factionworkrepgain:2,fail:[4,11],failur:4,fairlyn:11,fals:[3,4,5,6,9,11],featur:1,fee:6,feel:1,field:11,fieldwork:11,file:[2,4,11],fileexist:[0,1],filenam:4,fill:4,find:4,fine:4,finish:11,first:[3,4,5,6,10,11],fisg:6,fit:11,fix:4,floor:8,follow:[2,3,4,5,7,11],foo1:4,foo2:4,foo3:4,foo:4,foodnstuff:[4,7,8],form:[2,4],four:[5,6],fourth:[5,6],free:1,from:[4,6,10,11],ftpcrack:[0,1,11],fulli:3,futur:[2,4],gain:[0,4,11],game:[0,2,4,6,10,11],gener:[4,9,10],get:[4,8,10,11],getaugmentationcost:[0,1],getaugmentationsfromfact:[0,1],getbitnodemultipli:[0,1],getcompanyrep:[0,1],getcoreupgradecost:5,getcrimech:[0,1],getfactionrep:[0,1],getgrowtim:[0,1],gethackinglevel:[0,1],gethackingmultipli:[0,1],gethacktim:[0,1],gethostnam:[0,1],getlevelupgradecost:5,getnexthacknetnodecost:[0,1],getownedaugment:[0,1],getpurchasedserv:[0,1],getramupgradecost:5,getscriptexpgain:[0,1],getscriptincom:[0,1],getscriptram:[0,1],getserverbasesecuritylevel:[0,1],getservergrowth:[0,1],getservermaxmonei:[0,1],getserverminsecuritylevel:[0,1],getservermoneyavail:[0,1,7],getservernumportsrequir:[0,1],getserverram:[0,1,8],getserverrequiredhackinglevel:[0,1],getserversecuritylevel:[0,1],getstat:[0,1],getstockposit:[0,1],getstockpric:[0,1],gettimesincelastaug:[0,1],getupgradehomeramcost:[0,1],getweakentim:[0,1],give:[2,4,11],given:[4,6,11],global:4,greater:9,grep:4,grow:[0,1,7],grown:7,growth:4,gym:11,gymnam:11,gymworkout:[0,1],hack:[0,1,7,11],hacker:0,hackexpgain:2,hackingcontract:11,hacknet:[0,1,4],hacknetnod:[0,1],hacknetnodemonei:2,halt:4,has:[1,2,4,5,11],hasrootaccess:[0,1],have:[1,2,4,5,6,11],helio:4,here:[0,3,4,6,7,11],higher:4,hold:3,home:[4,11],hope:0,hostnam:4,how:[3,4,7],howev:[4,7,8],httpworm:[0,1,11],hyphen:3,ident:1,identifi:4,immedi:[4,6,11],implement:1,improv:1,includ:[3,4,11],incom:[4,5],increas:4,increment:[0,9],index:[0,4,5],indic:[4,11],inequ:9,inform:[0,1,4],initi:3,input:11,insid:[4,5],instal:[4,6,11],installaugment:[0,1],instanc:4,instead:[2,4],institut:11,instrins:4,integ:[2,3,4,5,6],intellig:11,invalid:[4,11],invit:11,iron:11,isbusi:[0,1],ishima:11,isrun:[0,1],issu:11,iter:[5,7],its:[4,6,8],itself:5,javascript:[0,1,3,4,7],job:11,joesgun:4,join:[3,11],joinfact:[0,1],jump3r:0,just:4,keyword:7,kill:[0,1],killal:[0,1],know:8,label:3,languag:[1,3],last:4,later:[2,3,6,11],lead:0,leadership:11,least:[4,5],length:[4,5,10],lenient:11,less:9,let:[6,7,10],letter:[3,6],level:[4,5,11],like:[4,10],limit:[4,6],limitbui:6,limitsel:6,line:8,link:4,list:[5,11],lit:4,literatur:4,local:4,locat:[4,11],log:[4,5],logic:9,look:10,loop:[0,1],lot:11,lower:4,made:6,make:[4,10],manag:11,mani:[1,3,11],manual:11,manualhackmonei:2,map:5,market:6,math:[0,1],max:5,maximum:4,mayb:8,mean:[0,1,2,3,4,5,11],member:[0,1,3,11],memori:4,messag:[0,4],method:[0,1,3],middl:11,millenium:11,millisecond:4,minimum:4,minut:11,miscellan:[0,1],mode:4,modifi:10,modul:[0,1],modulo:9,monei:[0,2,4,5,6,7,11],moneygainratepersecond:5,more:[3,4,7],most:3,msg:4,much:7,mult:[2,4],multi:8,multipl:[4,9],multipli:[2,4,11],must:[3,4,5,6,11],mysteri:0,name:[3,4,5,6,9,10,11],nearest:[4,5,6],necessari:0,need:4,negat:9,net:6,netscript:0,network:11,newli:4,next:4,node:[0,1,4],none:[4,5],normal:[10,11],notabl:4,note:[4,5,11],now:[0,8],nuke:[0,1],number:[3,4,5,6,9,10],numer:[3,6,9],numthread:[4,8],object:[2,3,4,5,11],obtain:4,obvious:11,offlin:4,omit:4,one:[4,5,7,11],onli:[2,4,5,6,8,9,11],onlin:4,onlinetimesecond:5,onto:3,open:[4,11],oper:[0,1,8,10],operand:9,option:[4,11],order:[2,4,6,11],origin:2,other:[4,8,11],otherwis:[4,5,6,7,11],oustand:[6,11],out:[1,4,11],output:4,outsid:[4,11],over:4,overwrit:4,own:[0,1,6],page:[0,2,4,11],paramet:4,pars:8,part:11,particular:11,pass:[4,10,11],peek:[0,1],percentag:4,perform:11,place:6,placeord:[0,1],plai:0,plan:10,player:[0,4,5,6,10,11],pop:3,port:4,pos:6,posit:[3,5,6,11],possibl:10,power:[0,4],powerhous:11,pre:9,prevent:10,price:6,primit:3,print:[0,1,2,5,8,11],process:4,produc:9,profit:6,program:[1,4,11],programnam:11,promot:11,prompt:[0,1],properti:11,protocol:6,provid:[5,6],pserv:4,purchas:[4,5,6,11],purchaseaugment:[0,1],purchasehacknetnod:[0,1,5],purchaseprogram:[0,1],purchaseserv:[0,1],purchasetor:[0,1],purpos:[3,4],put:[2,9],quest:0,queue:4,quickli:4,quot:3,rais:4,ram:[4,5,11],ramus:4,ran:4,rate:4,reach:1,read:[0,1,3,5],reason:4,receiv:[2,11],refer:[3,7],referenc:3,reflect:6,regardless:4,relat:4,relaysmtp:[0,1,11],relev:2,rememb:[4,6],remov:4,repres:[2,3,4,6],reput:11,request:1,requir:[2,4,9,11],res:[4,11],reset:[4,6,11],resolv:4,rest:3,restart:11,result:[4,9],retain:6,revert:4,role:0,root:4,rothman:[4,11],round:[4,5,6],router:11,rpg:0,run:[0,1,2,7,9,10,11],runtim:4,sai:10,sale:6,same:[4,7,8,11],scan:[0,1],scienc:11,scope:4,scp:[0,1],script:[0,1,4,5,6,11],scripthackmonei:2,scriptkil:[0,1],scriptnam:4,scriptrun:[0,1],search:[0,4],second:[3,4,5,6,10,11],secret:0,section:[1,4],sector:11,secur:[4,11],securitywork:11,see:[4,5,7],select:4,sell:6,sellshort:[0,1],sellstock:[0,1],sensit:[4,6,11],separ:[2,4],sequenc:[3,6],serial:4,server:[4,7],serverexist:[0,1],servergrowthr:2,servermaxmonei:2,serverprofil:11,serverstartingmonei:2,serverstartingsecur:2,serverweakenr:2,set:[4,11],share:6,sharesshort:6,she:0,shortstock:[0,1],should:[4,7,11],show:[3,4,7],signatur:4,signific:4,similar:4,simpl:7,simplest:4,simpli:[1,3],sinc:[4,8],singl:[3,4,9],singular:[0,1],skill:4,sleep:[0,1,5,11],small:11,snap:11,softwar:11,sold:6,some:[4,7,8,9,11],some_valu:4,someth:0,sort:4,sourc:[2,4,11],spawn:[0,1],special:[3,5,10,11],specif:4,specifi:[4,5,6,10,11],speed:4,splice:3,spoiler:[2,11],sprintf:[0,1],sqlinject:[0,1,11],stage:0,stai:4,start:[3,4,11],stat:11,statement:7,statist:6,steal:4,still:4,stock:6,stolen:4,stop:[4,6,11],stopact:[0,1],stopbui:6,stopsel:6,store:3,str:11,strategi:6,strength:11,strict:9,string:[3,4,6,11],structur:[2,4],strucur:11,studi:11,subject:2,subset:1,substr:4,subtract:9,success:[4,6,11],successfulli:[4,5,6,11],suggest:1,sum:4,summit:11,support:[3,5,6,8],suspend:4,suspicion:0,sym:6,symbol:6,syntax:[1,4,8],system:6,take:[0,4,11],target:4,technolog:11,templat:4,ten:7,term:11,termin:[4,11],test:4,text:[3,4],than:[4,7,9],thei:[1,2,4],them:11,theme:0,thi:[0,1,2,3,4,5,6,8,9,10,11],third:[4,6],those:[4,5],though:[4,8],thought:3,thread:[4,10,11],three:[3,4],through:[4,5,11],time:[4,5,7,8,11],tini:1,tix:[0,1],tokyo:11,tolowercas:3,tor:11,total:[4,5],totalmoneygener:5,totalram:4,tprint:[0,1],trade:[0,1],train:11,transact:6,travel:11,traveltoc:[0,1],travers:7,tri:[4,5],two:[4,6,9,10,11],txt:4,type:[0,1,4,6,11],typic:4,unari:[0,1],uncov:0,underli:4,underscor:3,uni:4,uniqu:4,univeristi:11,univers:11,universitycours:[0,1],universitynam:11,unknown:0,unlock:[6,11],until:[4,5,11],untyp:3,updat:11,upgrad:[5,11],upgradecor:5,upgradehomeram:[0,1],upgradelevel:5,upgraderam:5,usag:4,use:[4,6,7,11],used:[1,3,4,5,6,8,11],uses:7,using:[4,5,6,7,8,10,11],usual:11,utc:8,valid:4,valu:[2,3,4,5,6,9,11],vari:4,variabl:[0,1,4,7,9],visit:[6,11],volhaven:11,vsprintf:[0,1],wai:[4,5,8,11],waiter:11,want:[5,10,11],warn:[9,10,11],weaken:[0,1],web:11,well:3,were:[4,11],wese:6,what:[4,5,11],whatev:11,when:[0,1,4,7,11],where:[0,4],whether:[4,6,11],which:[3,4,5,6,11],whitespac:4,without:4,word:4,work:[4,6,8,9,11],workforcompani:[0,1],workforfact:[0,1],worktyp:11,world:[0,1,6],would:[2,9,10,11],write:[0,1,5,6],written:[1,4],wrong:0,wse:6,yet:[4,11],you:[0,1,2,3,4,5,6,7,9,11],your:[0,1,5,6,11],yourself:5,zero:4},titles:["Welcome to Bitburner's documentation!","Netscript Documentation","Netscript Advanced Functions","Netscript Data Types and Variables","Netscript Basic Functions","Netscript Hacknet Node API","Netscript Trade Information eXchange (TIX) API","Netscript Loops and Conditionals","Netscript Miscellaneous","Netscript Operators","Netscript Script Arguments","Netscript Singularity Functions"],titleterms:{"function":[2,4,11],advanc:2,api:[5,6],applytocompani:11,argument:10,basic:4,binari:9,bitburn:0,brutessh:4,buystock:6,cancelord:6,checkfactioninvit:11,clear:4,clearlog:4,comment:8,commitcrim:11,condit:7,createprogram:11,data:3,date:8,defin:4,deleteserv:4,disablelog:4,document:[0,1],enablelog:4,exampl:5,exchang:6,exec:4,exit:4,fileexist:4,ftpcrack:4,getaugmentationcost:11,getaugmentationsfromfact:11,getbitnodemultipli:2,getcompanyrep:11,getcrimech:11,getfactionrep:11,getgrowtim:4,gethackinglevel:4,gethackingmultipli:4,gethacktim:4,gethostnam:4,getnexthacknetnodecost:4,getownedaugment:11,getpurchasedserv:4,getscriptexpgain:4,getscriptincom:4,getscriptram:4,getserverbasesecuritylevel:4,getservergrowth:4,getservermaxmonei:4,getserverminsecuritylevel:4,getservermoneyavail:4,getservernumportsrequir:4,getserverram:4,getserverrequiredhackinglevel:4,getserversecuritylevel:4,getstat:11,getstockposit:6,getstockpric:6,gettimesincelastaug:4,getupgradehomeramcost:11,getweakentim:4,grow:4,gymworkout:11,hack:4,hacknet:5,hacknetnod:5,hasrootaccess:4,httpworm:4,indic:0,inform:6,installaugment:11,isbusi:11,isrun:4,javascript:8,joinfact:11,kill:4,killal:4,loop:7,math:8,member:5,method:5,miscellan:8,modul:8,netscript:[1,2,3,4,5,6,7,8,9,10,11],node:5,nuke:4,oper:9,own:4,peek:4,placeord:6,print:4,prompt:4,purchaseaugment:11,purchasehacknetnod:4,purchaseprogram:11,purchaseserv:4,purchasetor:11,read:4,relaysmtp:4,round:[],run:4,scan:4,scp:4,script:10,scriptkil:4,scriptrun:4,sellshort:6,sellstock:6,serverexist:4,shortstock:6,singular:11,sleep:4,spawn:4,sprintf:4,sqlinject:4,stopact:11,tabl:0,tix:6,tprint:4,trade:6,traveltoc:11,type:3,unari:9,universitycours:11,upgradehomeram:11,variabl:[3,5],vsprintf:4,weaken:4,welcom:0,what:0,workforcompani:11,workforfact:11,write:4,your:4}}) \ No newline at end of file +Search.setIndex({docnames:["index","netscript","netscriptadvancedfunctions","netscriptdatatypes","netscriptfunctions","netscripthacknetnodeapi","netscriptixapi","netscriptloopsandconditionals","netscriptmisc","netscriptoperators","netscriptscriptarguments","netscriptsingularityfunctions"],envversion:53,filenames:["index.rst","netscript.rst","netscriptadvancedfunctions.rst","netscriptdatatypes.rst","netscriptfunctions.rst","netscripthacknetnodeapi.rst","netscriptixapi.rst","netscriptloopsandconditionals.rst","netscriptmisc.rst","netscriptoperators.rst","netscriptscriptarguments.rst","netscriptsingularityfunctions.rst"],objects:{"":{applyToCompany:[11,2,1,""],buyStock:[6,2,1,""],cancelOrder:[6,2,1,""],checkFactionInvitations:[11,2,1,""],clearLog:[4,2,1,""],createProgram:[11,2,1,""],deleteServer:[4,2,1,""],disableLog:[4,2,1,""],enableLog:[4,2,1,""],fileExists:[4,2,1,""],getAugmentationCost:[11,2,1,""],getAugmentationsFromFaction:[11,2,1,""],getBitNodeMultipliers:[2,2,1,""],getCompanyRep:[11,2,1,""],getCrimeChance:[11,2,1,""],getFactionRep:[11,2,1,""],getGrowTime:[4,2,1,""],getHackTime:[4,2,1,""],getHackingLevel:[4,2,1,""],getHackingMultipliers:[4,2,1,""],getHostname:[4,2,1,""],getNextHacknetNodeCost:[4,2,1,""],getOwnedAugmentations:[11,2,1,""],getPurchasedServers:[4,2,1,""],getScriptExpGain:[4,2,1,""],getScriptIncome:[4,2,1,""],getScriptRam:[4,2,1,""],getServerBaseSecurityLevel:[4,2,1,""],getServerGrowth:[4,2,1,""],getServerMaxMoney:[4,2,1,""],getServerMinSecurityLevel:[4,2,1,""],getServerMoneyAvailable:[4,2,1,""],getServerNumPortsRequired:[4,2,1,""],getServerRam:[4,2,1,""],getServerRequiredHackingLevel:[4,2,1,""],getServerSecurityLevel:[4,2,1,""],getStats:[11,2,1,""],getStockPosition:[6,2,1,""],getStockPrice:[6,2,1,""],getTimeSinceLastAug:[4,2,1,""],getUpgradeHomeRamCost:[11,2,1,""],getWeakenTime:[4,2,1,""],gymWorkout:[11,2,1,""],hasRootAccess:[4,2,1,""],installAugmentations:[11,2,1,""],isBusy:[11,2,1,""],isRunning:[4,2,1,""],joinFaction:[11,2,1,""],placeOrder:[6,2,1,""],purchaseAugmentation:[11,2,1,""],purchaseHacknetNode:[4,2,1,""],purchaseProgram:[11,2,1,""],purchaseServer:[4,2,1,""],purchaseTor:[11,2,1,""],scriptKill:[4,2,1,""],scriptRunning:[4,2,1,""],sellShort:[6,2,1,""],sellStock:[6,2,1,""],serverExists:[4,2,1,""],shortStock:[6,2,1,""],stopAction:[11,2,1,""],travelToCity:[11,2,1,""],universityCourse:[11,2,1,""],upgradeHomeRam:[11,2,1,""],workForCompany:[11,2,1,""],workForFaction:[11,2,1,""]},"hacknetnodes[i]":{cores:[5,1,1,""],getCoreUpgradeCost:[5,0,1,""],getLevelUpgradeCost:[5,0,1,""],getRamUpgradeCost:[5,0,1,""],level:[5,1,1,""],moneyGainRatePerSecond:[5,1,1,""],onlineTimeSeconds:[5,1,1,""],ram:[5,1,1,""],totalMoneyGenerated:[5,1,1,""],upgradeCore:[5,0,1,""],upgradeLevel:[5,0,1,""],upgradeRam:[5,0,1,""]},NetscriptPort:{clear:[8,0,1,""],data:[8,1,1,""],empty:[8,0,1,""],full:[8,0,1,""],tryWrite:[8,0,1,""],write:[8,0,1,""]}},objnames:{"0":["js","method","JavaScript method"],"1":["js","attribute","JavaScript attribute"],"2":["js","function","JavaScript function"]},objtypes:{"0":"js:method","1":"js:attribute","2":"js:function"},terms:{"8gb":5,"boolean":[3,4,11],"break":10,"case":[4,6,11],"class":11,"default":[4,11],"float":3,"function":[0,1,3,5,6,7,8],"import":8,"long":6,"new":[4,5,8,11],"null":[4,8],"return":[2,4,5,6,8,9,11],"short":6,"static":8,"true":[3,4,5,6,8,9,11],"try":[4,8,10,11],"var":7,"while":[4,5,7,8,11],AND:9,Adding:3,And:8,For:[2,3,4,5,7,8,9,10],IPs:4,NOT:[4,6,9,11],Not:11,One:11,The:[0,2,3,4,5,6,7,8,10,11],Their:3,Then:[5,8],These:[2,4,5,11],Use:4,Will:[4,6],Yes:4,abil:6,abl:11,about:[3,4,8],abov:[3,4,8,9],accept:11,access:[3,4,5,6,8,10,11],action:11,activ:4,actual:[4,6,8,11],add:5,added:4,addit:[4,5,9,11],address:4,advanc:[0,1],aevum:11,affect:4,afford:4,after:[3,4,6,8,11],agenc:11,agent:11,agi:11,agil:11,aid:0,aka:11,algorithm:[6,11],all:[3,4,5,6,8,11],allow:[6,8,11],almost:1,alphabet:4,alphanumer:3,alreadi:[4,11],also:[3,4,6,10,11],alwai:[],amount:[4,5,6,10,11],ani:[0,1,3,4,11],anoth:[4,10],anyth:4,anywher:4,api:[0,1],appear:4,append:4,appli:[4,11],applytocompani:[0,1],arg:[4,10],argument:[0,1,4,5,6,8,11],around:[0,11],arrai:[3,4,5,6,8,10,11],aspect:11,assign:[5,9],assum:8,attack:4,attempt:[6,8],augment:[4,6,11],augmentationmoneycost:2,augmentationrepcost:2,augnam:11,autolink:11,autom:[5,6],automat:[4,6,11],avail:[3,4,6,7,11],averag:6,avgpx:6,avgpxshort:6,back:8,base:[4,9],basic:[0,1],becaus:[2,4],becom:2,been:0,befor:8,being:4,below:4,best:10,beta:0,between:[2,4,8],billion:6,binari:[0,1],bitburn:1,bitnod:[2,11],both:4,box:4,brief:8,brutessh:[0,1,11],bui:[6,11],build:6,busi:11,buystock:[0,1],calcul:6,call:[0,4,5,8,10,11],callback:11,can:[0,3,4,5,6,7,8,10,11],cancel:[6,11],cancelord:[0,1],cannot:[4,5],capabl:3,capit:6,caus:4,caveat:7,cbscript:11,certain:[4,6],chanc:[4,11],chang:[2,3,4,9],charact:3,charisma:11,check:[4,7,11],checkfactioninvit:[0,1],chongq:11,citi:11,citynam:11,classgymexpgain:2,clear:[0,1,8],clearlog:[0,1],click:4,close:8,code:[4,6,7,8,9,10],command:[3,4,11],comment:[0,1,9],commiss:6,commit:[2,11],commitcrim:[0,1],commun:[6,8],compani:[6,11],companynam:11,companyworkexpgain:2,companyworkmonei:2,complet:4,comput:[4,11],condit:[0,1],confirm:0,constantli:4,constrain:4,consult:11,contain:[2,3,4,8,11],content:0,continu:11,contract:11,control:11,convert:4,copi:4,core:5,correct:11,correspond:5,cost:[4,5,6,11],count:4,cours:11,coursenam:11,creat:[4,6,11],createprogram:[0,1],crime:[2,11],crimeexpgain:2,crimemonei:2,crush:11,current:[0,2,4,6,11],cyberpunk:0,dark:[0,11],data:[0,1,4,8,11],date:[0,1],deal:8,decim:11,declar:[3,4,7],decreas:4,decrement:9,deepscanv1:11,deepscanv2:11,def:11,defens:11,defin:[0,1],delai:4,delet:4,deleteserv:[0,1],denot:[4,8],depend:4,describ:4,destin:4,detail:4,determin:4,develop:[0,1],dex:11,dexter:11,dialog:4,differ:[2,3,4],disabl:4,disablelog:[0,1],divis:9,document:[4,7,8,11],doe:[1,4,6,8,9],doing:[5,10],don:[8,11],doubl:[3,5],due:4,dystopian:0,each:[5,6,11],earli:0,earn:[4,5,11],ecp:6,effect:4,either:[3,4],element:[4,5,6,8,10,11],els:[7,11],embark:0,emploi:11,employe:11,empti:[4,8],enabl:4,enablelog:[0,1],encapsul:3,end:[4,5,8,11],endpoint:8,engin:11,enough:[4,6],equal:9,equival:[3,4],error:4,etc:[3,4,10,11],evalu:8,even:[4,6,8,9],everi:[4,6,8,11],exampl:[0,1,2,3,4,6,7,8,9,10,11],exce:6,exceed:4,except:4,exchang:[0,1],exe:[4,11],exec:[0,1],execut:[4,6,8],exist:[4,5,7],exit:[0,1],experi:[4,11],explain:8,extens:[4,11],facnam:11,faction:11,factionnam:11,factionpassiverepgain:2,factionworkexpgain:2,factionworkrepgain:2,fail:[4,11],failur:4,fairlyn:11,fals:[3,4,5,6,8,9,11],featur:1,fee:6,feel:1,field:11,fieldwork:11,file:[2,4,11],fileexist:[0,1],filenam:4,fill:4,find:4,findindex:8,fine:4,finish:11,first:[3,4,5,6,8,10,11],fisg:6,fit:11,fix:4,floor:8,follow:[2,3,4,5,7,8,11],foo1:4,foo2:4,foo3:4,foo:[4,8],foodnstuff:[4,7,8],form:[2,4],four:[5,6],fourth:[5,6],free:1,from:[4,6,8,10,11],ftpcrack:[0,1,11],full:8,fulli:3,futur:[2,4],gain:[0,4,11],game:[0,2,4,6,8,10,11],gener:[4,9,10],get:[4,8,10,11],getaugmentationcost:[0,1],getaugmentationsfromfact:[0,1],getbitnodemultipli:[0,1],getcompanyrep:[0,1],getcoreupgradecost:5,getcrimech:[0,1],getfactionrep:[0,1],getgrowtim:[0,1],gethackinglevel:[0,1],gethackingmultipli:[0,1],gethacktim:[0,1],gethostnam:[0,1],getlevelupgradecost:5,getnexthacknetnodecost:[0,1],getownedaugment:[0,1],getporthandl:8,getpurchasedserv:[0,1],getramupgradecost:5,getscriptexpgain:[0,1],getscriptincom:[0,1],getscriptram:[0,1],getserverbasesecuritylevel:[0,1],getservergrowth:[0,1],getservermaxmonei:[0,1],getserverminsecuritylevel:[0,1],getservermoneyavail:[0,1,7],getservernumportsrequir:[0,1],getserverram:[0,1,8],getserverrequiredhackinglevel:[0,1],getserversecuritylevel:[0,1],getstat:[0,1],getstockposit:[0,1],getstockpric:[0,1],gettimesincelastaug:[0,1],getupgradehomeramcost:[0,1],getweakentim:[0,1],give:[2,4,11],given:[4,6,11],global:4,greater:9,grep:4,grow:[0,1,7],grown:7,growth:4,gym:11,gymnam:11,gymworkout:[0,1],hack:[0,1,7,11],hacker:0,hackexpgain:2,hackingcontract:11,hacknet:[0,1,4],hacknetnod:[0,1],hacknetnodemonei:2,halt:4,handl:8,has:[1,2,4,5,11],hasrootaccess:[0,1],have:[1,2,4,5,6,11],helio:4,here:[0,3,4,6,7,8,11],higher:4,hold:3,home:[4,11],hope:0,hostnam:4,how:[3,4,7,8],howev:[4,7,8],httpworm:[0,1,11],hyphen:3,ident:1,identifi:4,immedi:[4,6,11],implement:[1,8],improv:1,includ:[3,4,11],incom:[4,5],increas:4,increment:[0,9],index:[0,4,5],indic:[4,11],inequ:9,inform:[0,1,4],initi:3,input:11,insid:[4,5,8],instal:[4,6,11],installaugment:[0,1],instanc:4,instead:[2,4],institut:11,instrins:4,integ:[2,3,4,5,6],intellig:11,interact:8,invalid:[4,11],invit:11,iron:11,isbusi:[0,1],ishima:11,isinteg:8,isrun:[0,1],issu:11,item:8,iter:[5,7],its:[4,6,8],itself:5,javascript:[0,1,3,4,7],job:11,joesgun:4,join:[3,11],joinfact:[0,1],jump3r:0,just:[4,8],keyword:7,kill:[0,1],killal:[0,1],know:8,label:3,languag:[1,3],last:[4,8],later:[2,3,6,11],lead:0,leadership:11,least:[4,5],length:[4,5,10],lenient:11,less:9,let:[6,7,8,10],letter:[3,6],level:[4,5,11],like:[4,8,10],limit:[4,6],limitbui:6,limitsel:6,line:8,link:4,list:[5,11],lit:4,literatur:4,local:4,locat:[4,11],log:[4,5,8],logic:9,look:[8,10],loop:[0,1],lose:8,lot:11,lower:4,made:6,make:[4,10],manag:11,mani:[1,3,11],manual:11,manualhackmonei:2,map:5,market:6,math:[0,1],max:5,maximum:4,mayb:8,mean:[0,1,2,3,4,5,8,11],member:[0,1,3,11],memori:4,messag:[0,4],method:[0,1,3,8],middl:11,millenium:11,millisecond:4,minimum:4,minut:11,miscellan:[0,1],mode:4,modifi:10,modul:[0,1],modulo:9,monei:[0,2,4,5,6,7,11],moneygainratepersecond:5,more:[3,4,7],most:3,msg:4,much:7,mult:[2,4],multi:8,multipl:[4,9],multipli:[2,4,11],must:[3,4,5,6,11],mysteri:0,name:[3,4,5,6,9,10,11],nearest:[4,5,6],necessari:0,need:4,negat:9,net:6,netscript:0,netscriptport:8,network:11,newli:4,next:4,node:[0,1,4],none:[4,5],normal:[8,10,11],notabl:4,note:[4,5,11],now:[0,8],nuke:[0,1],number:[0,1,3,4,5,6,9,10],numer:[3,6,9],numthread:[4,8],object:[2,3,4,5,11],obtain:4,obvious:11,offlin:4,omit:4,one:[4,5,7,8,11],onli:[2,4,5,6,8,9,11],onlin:4,onlinetimesecond:5,onto:3,open:[4,8,11],oper:[0,1,8,10],operand:9,option:[4,11],order:[2,4,6,11],origin:2,other:[4,8,11],otherwis:[4,5,6,7,8,11],our:8,oustand:[6,11],out:[1,4,8,11],output:4,outsid:[4,11],over:4,overwrit:4,own:[0,1,6],page:[0,2,4,8,11],param:[],paramet:4,pars:8,part:11,particular:11,pass:[4,8,10,11],peek:[0,1,8],percentag:4,perform:11,place:6,placeord:[0,1],plai:0,plan:10,player:[0,4,5,6,10,11],pop:[3,8],port:[0,1,4],pos:6,posit:[3,5,6,11],possibl:10,power:[0,4],powerhous:11,pre:9,prevent:10,price:6,primit:3,print:[0,1,2,5,8,11],process:4,produc:9,profit:6,program:[1,4,11],programnam:11,promot:11,prompt:[0,1],properti:11,protocol:6,provid:[5,6],pserv:4,purchas:[4,5,6,11],purchaseaugment:[0,1],purchasehacknetnod:[0,1,5],purchaseprogram:[0,1],purchaseserv:[0,1],purchasetor:[0,1],purpos:[3,4],put:[2,9],quest:0,queue:[4,8],quickli:4,quot:3,rais:4,ram:[4,5,11],ramus:4,ran:[4,8],rate:4,reach:1,read:[0,1,3,5,8],reason:4,receiv:[2,11],refer:[3,7],referenc:3,reflect:6,regardless:4,relat:[4,8],relaysmtp:[0,1,11],relev:2,reload:8,rememb:[4,6],remov:[4,8],repres:[2,3,4,6,8],reput:11,request:1,requir:[2,4,9,11],res:[4,8,11],reset:[4,6,11],resolv:4,rest:3,restart:11,result:[4,9],retain:6,revert:4,right:8,role:0,room:8,root:4,rothman:[4,11],round:[4,5,6],router:11,rpg:0,run:[0,1,2,7,8,9,10,11],runtim:4,sai:10,sake:8,sale:6,same:[4,7,8,11],save:8,scan:[0,1],scienc:11,scope:4,scp:[0,1],script:[0,1,4,5,6,8,11],scripthackmonei:2,scriptkil:[0,1],scriptnam:4,scriptrun:[0,1],search:[0,4],second:[3,4,5,6,10,11],secret:0,section:[1,4],sector:11,secur:[4,11],securitywork:11,see:[4,5,7],select:4,sell:6,sellshort:[0,1],sellstock:[0,1],sensit:[4,6,11],separ:[2,4],sequenc:[3,6],serial:[4,8],server:[4,7],serverexist:[0,1],servergrowthr:2,servermaxmonei:2,serverprofil:11,serverstartingmonei:2,serverstartingsecur:2,serverweakenr:2,set:[4,11],sever:8,share:6,sharesshort:6,she:0,shortstock:[0,1],should:[4,7,11],show:[3,4,7],signatur:4,signific:4,similar:4,simpl:[7,8],simplest:4,simpli:[1,3],simplic:8,sinc:[4,8],singl:[3,4,9],singular:[0,1],skill:4,sleep:[0,1,5,8,11],slice:8,small:11,snap:11,softwar:11,sold:6,some:[4,7,8,9,11],some_valu:4,someth:0,sort:[4,8],sourc:[2,4,11],spawn:[0,1],special:[3,5,10,11],specif:4,specifi:[4,5,6,8,10,11],speed:4,splice:3,spoiler:[2,11],sprintf:[0,1],sqlinject:[0,1,11],stage:0,stai:4,start:[3,4,8,11],stat:11,statement:7,statist:6,steal:4,still:4,stock:6,stolen:4,stop:[4,6,11],stopact:[0,1],stopbui:6,stopsel:6,store:3,str:11,strategi:6,strength:11,strict:9,string:[3,4,6,11],structur:[2,4,8],strucur:11,studi:11,subject:2,subset:1,substr:4,subtract:9,success:[4,6,11],successfulli:[4,5,6,8,11],suggest:1,sum:4,summit:11,support:[3,5,6,8],suspend:4,suspicion:0,sym:6,symbol:6,syntax:[1,4,8],system:6,take:[0,4,11],target:4,technolog:11,templat:4,ten:7,term:11,termin:[4,11],test:4,text:[3,4],than:[4,7,9],thei:[1,2,4],them:[8,11],theme:0,thi:[0,1,2,3,4,5,6,8,9,10,11],third:[4,6],those:[4,5],though:[4,8],thought:3,thread:[4,10,11],three:[3,4,8],through:[4,5,8,11],time:[4,5,7,8,11],tini:1,tix:[0,1],tokyo:11,tolowercas:3,tor:11,total:[4,5],totalmoneygener:5,totalram:4,tprint:[0,1,8],trade:[0,1],train:11,transact:6,travel:11,traveltoc:[0,1],travers:7,tri:[4,5],trywrit:8,two:[4,6,9,10,11],txt:4,type:[0,1,4,6,11],typic:4,unari:[0,1],uncov:0,underli:[4,8],underscor:3,uni:4,uniqu:4,univeristi:11,univers:11,universitycours:[0,1],universitynam:11,unknown:0,unlock:[6,11],until:[4,5,11],untyp:3,updat:11,upgrad:[5,11],upgradecor:5,upgradehomeram:[0,1],upgradelevel:5,upgraderam:5,usag:[4,8],use:[4,6,7,11],used:[1,3,4,5,6,8,11],uses:7,using:[4,5,6,7,8,10,11],usual:11,utc:8,valid:[4,8],valu:[2,3,4,5,6,8,9,11],vari:4,variabl:[0,1,4,7,9],visit:[6,11],volhaven:11,vsprintf:[0,1],wai:[4,5,8,11],wait:8,waiter:11,want:[5,10,11],warn:[9,10,11],weaken:[0,1],web:11,well:3,were:[4,11],wese:6,what:[4,5,11],whatev:11,when:[0,1,4,7,8,11],where:[0,4,8],whether:[4,6,11],which:[3,4,5,6,8,11],whitespac:4,without:4,word:4,work:[4,6,8,9,11],workforcompani:[0,1],workforfact:[0,1],worktyp:11,world:[0,1,6],would:[2,9,10,11],write:[0,1,5,6,8],written:[1,4,8],wrong:0,wrote:8,wse:6,yet:[4,11],you:[0,1,2,3,4,5,6,7,8,9,11],your:[0,1,5,6,11],yourself:5,zero:4},titles:["Welcome to Bitburner's documentation!","Netscript Documentation","Netscript Advanced Functions","Netscript Data Types and Variables","Netscript Basic Functions","Netscript Hacknet Node API","Netscript Trade Information eXchange (TIX) API","Netscript Loops and Conditionals","Netscript Miscellaneous","Netscript Operators","Netscript Script Arguments","Netscript Singularity Functions"],titleterms:{"function":[2,4,11],advanc:2,api:[5,6],applytocompani:11,argument:10,basic:4,binari:9,bitburn:0,brutessh:4,buystock:6,cancelord:6,checkfactioninvit:11,clear:4,clearlog:4,comment:8,commitcrim:11,condit:7,createprogram:11,data:3,date:8,defin:4,deleteserv:4,disablelog:4,document:[0,1],enablelog:4,exampl:5,exchang:6,exec:4,exit:4,fileexist:4,ftpcrack:4,getaugmentationcost:11,getaugmentationsfromfact:11,getbitnodemultipli:2,getcompanyrep:11,getcrimech:11,getfactionrep:11,getgrowtim:4,gethackinglevel:4,gethackingmultipli:4,gethacktim:4,gethostnam:4,getnexthacknetnodecost:4,getownedaugment:11,getpurchasedserv:4,getscriptexpgain:4,getscriptincom:4,getscriptram:4,getserverbasesecuritylevel:4,getservergrowth:4,getservermaxmonei:4,getserverminsecuritylevel:4,getservermoneyavail:4,getservernumportsrequir:4,getserverram:4,getserverrequiredhackinglevel:4,getserversecuritylevel:4,getstat:11,getstockposit:6,getstockpric:6,gettimesincelastaug:4,getupgradehomeramcost:11,getweakentim:4,grow:4,gymworkout:11,hack:4,hacknet:5,hacknetnod:5,handl:[],hasrootaccess:4,httpworm:4,indic:0,inform:6,installaugment:11,isbusi:11,isrun:4,javascript:8,joinfact:11,kill:4,killal:4,loop:7,math:8,member:5,method:5,miscellan:8,modul:8,netscript:[1,2,3,4,5,6,7,8,9,10,11],node:5,nuke:4,number:8,oper:9,own:4,peek:4,placeord:6,port:8,print:4,prompt:4,purchaseaugment:11,purchasehacknetnod:4,purchaseprogram:11,purchaseserv:4,purchasetor:11,read:4,relaysmtp:4,round:[],run:4,scan:4,scp:4,script:10,scriptkil:4,scriptrun:4,sellshort:6,sellstock:6,serverexist:4,shortstock:6,singular:11,sleep:4,spawn:4,sprintf:4,sqlinject:4,stopact:11,tabl:0,tix:6,tprint:4,trade:6,traveltoc:11,type:3,unari:9,universitycours:11,upgradehomeram:11,usag:[],variabl:[3,5],vsprintf:4,weaken:4,welcom:0,what:0,workforcompani:11,workforfact:11,write:4,your:4}}) \ No newline at end of file diff --git a/doc/source/netscripthacknetnodeapi.rst b/doc/source/netscripthacknetnodeapi.rst index 1f3755fe0..73c0860c1 100644 --- a/doc/source/netscripthacknetnodeapi.rst +++ b/doc/source/netscripthacknetnodeapi.rst @@ -25,27 +25,27 @@ a value to these. Note that these must be called on an element inside the *hacknetnodes* array, not the array itself. -.. js:function:: hacknetnodes[i].level +.. js:attribute:: hacknetnodes[i].level Returns the level of the corresponding Hacknet Node -.. js:function:: hacknetnodes[i].ram +.. js:attribute:: hacknetnodes[i].ram Returns the amount of RAM on the corresponding Hacknet Node -.. js:function:: hacknetnodes[i].cores +.. js:attribute:: hacknetnodes[i].cores Returns the number of cores on the corresponding Hacknet Node -.. js:function:: hacknetnodes[i].totalMoneyGenerated +.. js:attribute:: hacknetnodes[i].totalMoneyGenerated Returns the total amount of money that the corresponding Hacknet Node has earned -.. js:function:: hacknetnodes[i].onlineTimeSeconds +.. js:attribute:: hacknetnodes[i].onlineTimeSeconds Returns the total amount of time (in seconds) that the corresponding Hacknet Node has existed -.. js:function:: hacknetnodes[i].moneyGainRatePerSecond +.. js:attribute:: hacknetnodes[i].moneyGainRatePerSecond Returns the amount of income that the corresponding Hacknet Node earns @@ -57,7 +57,7 @@ The following is a list of supported functions/methods for a Hacknet Node object Note that these must be called on an element inside the *hacknetnodes* array, not the array itself. -.. js:function:: hacknetnodes[i].upgradeLevel(n); +.. js:method:: hacknetnodes[i].upgradeLevel(n) :param number n: Number of levels to upgrade. Must be positive. Rounded to nearest integer @@ -65,27 +65,27 @@ array itself. Hacknet Node's level is successfully upgraded *n* times or up to the max level (200), and false otherwise. -.. js:function:: hacknetnodes[i].upgradeRam() +.. js:method:: hacknetnodes[i].upgradeRam() Tries to upgrade the amount of RAM on the corresponding Hacknet Node. Returns true if the RAM is successfully upgraded and false otherwise. -.. js:function:: hacknetnodes[i].upgradeCore() +.. js:method:: hacknetnodes[i].upgradeCore() Tries to purchase an additional core for the corresponding Hacknet Node. Returns true if the additional core is successfully purchased, and false otherwise. -.. js:function:: hacknetnodes[i].getLevelUpgradeCost(n); +.. js:method:: hacknetnodes[i].getLevelUpgradeCost(n) :param number n: Number of levels to upgrade. Must be positive. Rounded to nearest integer Returns the cost of upgrading the specified Hacknet Node by *n* levels -.. js:function:: hacknetnodes[i].getRamUpgradeCost() +.. js:method:: hacknetnodes[i].getRamUpgradeCost() Returns the cost of upgrading the RAM of the specified Hacknet Node. Upgrading a Node's RAM doubles it. -.. js:function:: hacknetnodes[i].getCoreUpgradeCost() +.. js:method:: hacknetnodes[i].getCoreUpgradeCost() Returns the cost of upgrading the number of cores of the specified Hacknet Node. Upgrading a Node's number of cores adds one additional core. diff --git a/doc/source/netscriptmisc.rst b/doc/source/netscriptmisc.rst index edf960583..7c595762b 100644 --- a/doc/source/netscriptmisc.rst +++ b/doc/source/netscriptmisc.rst @@ -1,6 +1,135 @@ Netscript Miscellaneous ======================= +Netscript Ports +--------------- +Netscript ports are endpoints that can be used to communicate between scripts. +A port is implemented as a sort of serialized queue, where you can only write +and read one element at a time from the port. When you read data from a port, +the element that is read is removed from the port. + +The :js:func:`read`, :js:func:`write`, :js:func:`clear`, and :js:func:`peek` +Netscript functions can be used to interact with ports. + +Right now, there are only 20 ports for Netscript, denoted by the number 1 +through 20. When using the functions above, the ports are specified +by passing the number as the first argument. + +IMPORTANT: The data inside ports are not saved! This means if you close and +re-open the game, or reload the page then you will lose all of the data in +the ports! + +**Example Usage** + +Here's a brief example of how ports work. For the sake of simplicity we'll only deal with port 1. + +Let's assume Port 1 starts out empty (no data inside). We'll represent the port as such:: + + [] + +Now assume we ran the following simple script:: + + for (i = 0; i < 10; ++i) { + write(1, i); //Writes the value of i to port 1 + } + +After this script executes, our script will contain every number from 0 through 9, as so:: + + [0, 1, 2, 3, 4, 5, 6, 7 , 8, 9] + +Then, assume we run the following script:: + + for (i = 0; i < 3; ++i) { + print(read(1)); //Reads a value from port 1 and then prints it + } + +This script above will read the first three values from port 1 and then print them to the script's log. The log will end up looking like:: + + 0 + 1 + 2 + +And the data in port 1 will look like:: + + [3, 4, 5, 6, 7, 8, 9] + +**Port Handles** + +The :js:func:`getPortHandle` Netscript function can be used to get a handle to a Netscript Port. +This handle allows you to access several new port-related functions and the +port's underlying data structure, which is just a Javascript array. The functions are: + +.. js:method:: NetscriptPort.write(data) + + :param data: Data to write to the port + :returns: If the port is full, the item that is removed from the port is returned. + Otherwise, null is returned. + + Writes `data` to the port. Works the same as the Netscript function `write`. + +.. js:method:: NetscriptPort.tryWrite(data) + + :param data: Data to try to write to the port + :returns: True if the data is successfully written to the port, and false otherwise. + + Attempts to write `data` to the Netscript port. If the port is full, the data will + not be written. Otherwise, the data will be written normally. + +.. js::method:: NetscriptPort.read() + + :returns: The data read from the port. If the port is empty, "NULL PORT DATA" is returned + + Removes and returns the first element from the port. + Works the same as the Netscript function `read` + +.. js::method:: NetscriptPort.peek() + + :returns: The first element in the port, or "NULL PORT DATA" if the port is empty. + + Returns the first element in the port, but does not remove it. + Works the same as the Netscript function `peek` + +.. js:method:: NetscriptPort.full() + + :returns: True if the Netscript Port is full, and false otherwise + +.. js:method:: NetscriptPort.empty() + + :returns: True if the Netscript Port is empty, and false otherwise + +.. js:method:: NetscriptPort.clear() + + Clears all data from the port. Works the same as the Netscript function `clear` + +.. js:attribute:: NetscriptPort.data + + The Netscript port underlying data structure, which is just a Javascript array. All + valid Javascript Array methods can be called on this. + +Port Handle Example:: + + port = getPortHandle(5); + back = port.data.pop(); //Get and remove last element in port + + //Remove an element from the port + i = port.data.findIndex("foo"); + if (i != -1) { + port.data.slice(i, 1); + } + + //Wait for port data before reading + while(port.empty()) { + sleep(10000); + } + res = port.read(); + + //Wait for there to be room in a port before writing + while (!port.tryWrite(5)) { + sleep(5000); + } + + //Successfully wrote to port! + Comments -------- @@ -35,3 +164,13 @@ However, since the 'new' operator does not work in Netscript, only the Date modu Example:: time = Date.now(); + +Javascript Number Module +------------------------ + +The `Javascript Number module `_ is supported in Netscript. + +Example:: + + tprint(Number.isInteger(1)); //True + tprint(Number.isInteger(1.534059)); //False diff --git a/netscript_tests/tb_basic.script b/netscript_tests/tb_basic.script new file mode 100644 index 000000000..b2946cbea --- /dev/null +++ b/netscript_tests/tb_basic.script @@ -0,0 +1,140 @@ +function test(name, val) { + if (val) { + tprint("Test " + name + ": OK"); + } else { + tprint("Test " + name + ": FAILED"); + //A failed test prints failure to results text file + write("tb_results.txt", "FAIL"); + } +} + +test("run", (args.length === 1 && args[0] === "OK")); + +//Arithmetic +test("arith1", 0 * 10 === 0); +test("arith2", 0 + 1 === 1); +test("arith3", 10 / 5 === 2); +test("arith4", 6-3 === 3); +test("arith5", 14 % 10 === 4); +test("arith6", 5 === 24 / 6 + 1); +test("arith7", 6 === 2 * 3); + +//Logical operators +test("logic1", true && true); +test("logic2", !(true && false)); +test("logic3", true || false); +test("logic4", !(false || false)); +test("logic5", 1 < 3); +test("logic6", !(3 < 1)); +test("logic7", 5 >= 5); +test("logic8", !(5 <= 4)); +test("logic9", true == true); +test("logic10", true === true); +test("logic11", !(0 != 0)); + +//Assignment +i = 5; +test("asgn1", i == 5); +i = 0; +test("asgn2", i === 0); +test("asgn3", 10 === (i = 10)); +test("asgn4", i === 10); + + +//Basic array functionality +testArr = [1, 2, 3, 4, 5, "str1", "str2", "str3"]; +test("arr1", testArr[0] == 1); +test("arr2", testArr[1] === 2); +test("arr3", testArr[5] === "str1"); +test("arr4", testArr[7] === "str3"); + +x = 1; +y = 2; +z = 3; +testArr = []; +testArr.push(x); +testArr.push(y); +testArr.push(z); +test("arr5", testArr.length === 3); +test("arr6", 1 === testArr[0]); +test("arr7", 3 === testArr[2]); + +x = 10; +y = 10; +z = 10; +test("arr8", testArr.toString() === "1,2,3"); + +testArr.push(4); +testArr.push("some str"); +test("arr9", "1,2,3,4,some str" === testArr.toString()); +testArr.pop(); +test("arr10", "1,2,3,4" === testArr.toString()); +testArr.shift(); +test("arr11", "2,3,4" === testArr.toString()); +testArr.unshift(1); +test("arr12", "1,2,3,4" === testArr.toString()); + +testArr[0] = 10; +foo = 1; +testArr[foo] = 11; +foo = 2; +testArr[foo] = 12; +foo = 3; +testArr[foo] = 13; +test("arr13", "10,11,12,13" === testArr.join()); +testArr.splice(testArr.length, 2, 14, 15); +test("arr14", testArr.length === 6); +test("arr15", testArr.join() == "10,11,12,13,14,15"); + +//Short circuiting Logical Operators +results = []; +res = false || results.push("OK") +res = (0 < -5) || results.push("OK") +res = true && results.push("OK") +res = (1 > 0) && results.push("OK") +res = 5 && results.push("OK") + +test("shortcircuit1", results.length === 5); +for (i = 0; i < results.length; ++i) { + test("shortcircuit" + (2 + i), results[i] === "OK"); +} + +res = true || tprint('1'); +res = (true && true) || tprint('2'); +res = 1 > 0 || tprint('3'); +res = false && tprint('4'); +res = 1 < 0 && tprint('5'); +test("shortcircuit7", results.length === 5); + +//Conditional Statements +results = []; +i = 1; +if (i == 0) { + results.push("FAIL"); +} else if (i == 2) { + results.push("FAIL"); +} else if (i == 1) { + results.push("OK"); +} else { + results.push("FAIL"); +} + +i = 5; +if (i == 0) { + results.push("FAIL"); +} else if (i == 2) { + results.push("FAIL"); +} else if (i == 1) { + results.push("FAIL"); +} else { + results.push("OK"); +} + +test("conditional1", results.length === 2); +test("conditional2", results[0] === "OK"); +test("conditional3", results[1] === "OK"); + +run("tb_multiarray.script", 1, "OK"); +exec("tb_ports.script", "home", 1, "OK"); + +write("tb_results.txt", ",tb_basic"); \ No newline at end of file diff --git a/netscript_tests/tb_foo.script b/netscript_tests/tb_foo.script new file mode 100644 index 000000000..f7fe9eb4a --- /dev/null +++ b/netscript_tests/tb_foo.script @@ -0,0 +1,4 @@ +while(true) { + print("hi"); + sleep(5000); +} \ No newline at end of file diff --git a/netscript_tests/tb_functions.script b/netscript_tests/tb_functions.script new file mode 100644 index 000000000..58a1b0ce7 --- /dev/null +++ b/netscript_tests/tb_functions.script @@ -0,0 +1,119 @@ +import {test} from "tb_basic.script"; + +test("run", (args.length === 1 && args[0] === "OK")); + +//scan +res = scan(); +test("scan1", res.includes("iron-gym") && res.includes("foodnstuff") && + res.includes("sigma-cosmetics") && res.includes("joesguns") && + res.includes("hong-fang-tea") && res.includes("harakiri-sushi")); +test("scan2", res.length === 6); +res = scan("foodnstuff"); +test("scan3", res.includes("home")); + +//hasRootAccess and nuke +svr = "foodnstuff"; +test("hasRootAccess1", !hasRootAccess(svr)); +test("nuke", nuke(svr)); +test("hasRootAccess2", hasRootAccess(svr)); + +//sleep and Date.now(); +time = Date.now(); +sleep(10000); +time2 = Date.now(); +test("sleep", time2 - time > 8000); + +//hack, grow, weaken, and their effects +FORTIFYAMOUNT = 0.002; +WEAKENAMOUNT = 0.05; + +playerStartingMoney = getServerMoneyAvailable("home"); +serverStartingMoney = getServerMoneyAvailable("foodnstuff"); +startingSecLvl = getServerSecurityLevel("foodnstuff"); + +res = hack(svr); + +playerEndingMoney = getServerMoneyAvailable("home"); +serverEndingMoney = getServerMoneyAvailable("foodnstuff"); +endingSecLvl = getServerSecurityLevel("foodnstuff"); + +success = !(res == 0); + +if (success) { + tprint("Hack succeeded"); + test("hackplyrmoney", res === (playerEndingMoney - playerStartingMoney)); + test("hacksvrmoney", res === (serverStartingMoney - serverEndingMoney)); + //Dumb JS precision + test("seclevel", (endingSecLvl - startingSecLvl) - FORTIFYAMOUNT < 1e2 * Number.EPSILON); +} else { + tprint("Hack failed"); + test("hackres", res === 0); + test("hackplymoney", playerEndingMoney === playerStartingMoney); + test("hacksvrmoney", serverEndingMoney === serverStartingMoney); + test("seclevel", endingSecLvl === startingSecLvl); +} + +serverStartingMoney = getServerMoneyAvailable(svr); +res = grow(svr); +serverEndingMoney = getServerMoneyAvailable(svr); +test("grow", serverEndingMoney > serverStartingMoney); +test("growtest", res * serverStartingMoney - serverEndingMoney < Number.EPSILON); + +startingSecLvl = getServerSecurityLevel(svr); +res = weaken(svr); +endingSecLvl = getServerSecurityLevel(svr); +test("weaken", res === WEAKENAMOUNT); +test("weakenres", startingSecLvl - endingSecLvl - res < 1e2 * Number.EPSILON); + +//misc getter functions +test("getHostname", getHostname() === "home"); +test("getHackingLevel", getHackingLevel() >= 1); //Can vary based on aug mults +res = getHackingMultipliers(); +test("getHackingMultipliers", res.chance >= 1 && res.speed >= 1 && + res.money >= 1 && res.growth >= 1); +svr = "joesguns"; +baseSecLvl = getServerBaseSecurityLevel(svr); +minSecLvl = getServerMinSecurityLevel(svr); +test("getServerBase/MinSecurityLevel1", minSecLvl < baseSecLvl); +test("getServerBase/MinSecurityLevel1", minSecLvl === Math.max(1, Math.round(baseSecLvl / 3))); +test("getServerRequiredHackingLevel", getServerRequiredHackingLevel(svr) === 10); +test("getServerMaxMoney", getServerMaxMoney(svr) > getServerMoneyAvailable(svr)); //Can vary by BN +test("getServerGrowth", getServerGrowth(svr) >= 1); //Can vary by BN +test("getServerNumPortsRequired1", getServerNumPortsRequired(svr) === 0); +test("getServerNumPortsRequired1", getServerNumPortsRequired("neo-net") === 1); +test("getServerRam", getServerRam("home")[0] === 8 || + getServerRam("home")[0] === 16 || + getServerRam("home")[0] === 32); +test("serverExists1", serverExists("home")); +test("serverExists2", !serverExists("foofooofofofof")); +test("fileExists1", fileExists("tb_start.script")); +test("fileExists2", !fileExists("tosdifoodafgbiofdagbaod.txt")); + +//run a misc script +test("isRunning1", !isRunning("tb_foo.script", "home")); +run("tb_foo.script", 1, 1, 2, 3); +test("isRunning2", !isRunning("tb_foo.script", "home", "foo")); +test("isRunning3", isRunning("tb_foo.script", "home", 1, 2, 3)); + +//kill +kill("tb_foo.script", "home", "fee"); +sleep(10000); +test("isRunning4", isRunning("tb_foo.script", "home", 1, 2, 3)); +kill("tb_foo.script", "home", 1, 2, 3); +sleep(10000); +test("isRunning4", !isRunning("tb_foo.script", "home", 1, 2, 3)); + +//scp +svr = "foodnstuff"; +test("fileExists3", !fileExists("tb_remote.script", svr)); +test("fileExists4", !fileExists("tb_basic.script", svr)); +scp("tb_remote.script", "home", svr); +scp("tb_basic.script", svr); +test("fileExists5", fileExists("tb_remote.script", svr)); +test("fileExists6", fileExists("tb_basic.script", svr)); + +write("tb_results.txt", ",tb_functions"); //Done, pretty much + +//exec and spawn +exec("tb_remote.script", "foodnstuff", 1, "OK"); +spawn("tb_functions2.script", 1, "OK"); \ No newline at end of file diff --git a/netscript_tests/tb_multiarray.script b/netscript_tests/tb_multiarray.script new file mode 100644 index 000000000..6468c95a0 --- /dev/null +++ b/netscript_tests/tb_multiarray.script @@ -0,0 +1,90 @@ +//Tests for multidimensional arrays +import {test} from "tb_basic.script"; + +runSuccess = (args.length === 1 && args[0] === "OK"); +test("run", runSuccess); + +arr = []; +arr[0] = []; +arr[1] = []; +arr.push([]); + +test("multiarr1", arr.toString() === ",,"); +test("multiarr2", arr.length === 3); +arr[0].push(0); +arr[0].push(0); +arr[0].push(0); +test("multiarr3", arr[0].length === 3); +test("multiarr4", arr[0].toString() === "0,0,0"); +arr[1] = [0, 0, 0]; +test("multiarr5", arr.length === 3); +test("multiarr6", arr[1].length === 3); +test("multiarr7", arr[1].toString() === "0,0,0"); +arr.pop(); +arr.push([0,0,0]); +test("multiarr8", arr.length === 3); +test("multiarr9", arr[2].length === 3); +test("multiarr10", "0,0,0,0,0,0,0,0,0" === arr.toString()); +for (r = 0; r < arr.length; ++r) { + for (c = 0; c < arr[r].length; ++c) { + arr[r][c] = r * 3 + c + 1; + } +} +test("multiarr11", "1,2,3,4,5,6,7,8,9" === arr.toString()); + +arr = [[0,0,0,0], [0,0,0,0], [0,0,0,0], [0,0,0,0]]; +test("multiarr12", 4 === arr.length); +for (i = 0; i < arr.length; ++i) { + test("multiarr" + (13 + i), arr[i].length === 4); +} + +for (r = 0; r < arr.length; ++r) { + for (c = 0; c < arr[r].length; ++c) { + arr[r][c] = r * 10 + c + 1; + } +} + +test("multiarr17", arr.toString() === "1,2,3,4,11,12,13,14,21,22,23,24,31,32,33,34"); + + +//3D array +arr = [[], [], [], []]; +arr[0].push([0, 0, 0]); +arr[0].push([0, 0, 0]); +arr[0].push([0, 0, 0]); + +arr[1].push([0, 0, 0]); +arr[1].push([0, 0, 0]); +arr[1].push([0, 0, 0]); + +arr[2].push([0, 0, 0]); +arr[2].push([0, 0, 0]); +arr[2].push([0, 0, 0]); + +arr[3].push([0, 0, 0]); +arr[3].push([0, 0, 0]); +arr[3].push([0, 0, 0]); + +i = 0; + +for (r = 0; r < arr.length; ++r) { + for (c = 0; c < arr[r].length; ++c) { + for (d = 0; d < arr[r][c].length; ++d) { + arr[r][c][d] = i; + ++i; + } + } +} + +test("multiarr18", "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35" === arr.toString()); +ref = 0; +for (r = 0; r < arr.length; ++r) { + for (c = 0; c < arr[r].length; ++c) { + for (d = 0; d < arr[r][c].length; ++d) { + test("multiarr" + (19 + ref), arr[r][c][d] === ref); + ++ref; + } + } +} + +write("tb_results.txt", ",tb_multiarray"); \ No newline at end of file diff --git a/netscript_tests/tb_ports.script b/netscript_tests/tb_ports.script new file mode 100644 index 000000000..a96cd56c7 --- /dev/null +++ b/netscript_tests/tb_ports.script @@ -0,0 +1,73 @@ +import {test} from "tb_basic.script"; + +test("run", (args.length === 1 && args[0] === "OK")); + + +MAXPORTS = 20; +MAXPORTSIZE = 100; + +for (i = 1; i <= MAXPORTS; ++i) { + clear(i); +} + +//write +for (i = 1; i <= MAXPORTS; ++i) { + for (j = 1; j <= 5; ++j) { + write(i, j); + } +} + +for (i = 1; i <= MAXPORTS; ++i) { + port = getPortHandle(i); + test("write" + i, port.data.length === 5); +} + +//read +for (i = 1; i <= MAXPORTS; ++i) { + for (j = 1; j <= 2; ++j) { + res = read(i); + test("read-p" + i + "-" + j, res === j); + } +} + +for (i = 1; i <= MAXPORTS; ++i) { + port = getPortHandle(i); //Check that read removes elements + test("readpops" + i, port.data.length === 3); +} + +//peek +for (i = 1; i <= MAXPORTS; ++i) { + test("peek" + i, peek(i) === 3); + port = getPortHandle(i); + test("peeknopop" + i, port.data.length === 3); +} + +//clear and empty +for (i = 1; i <= MAXPORTS; ++i) { + clear(i); + port = getPortHandle(i); + test("clear" + i, port.data.length === 0); + test("empty" + i, port.empty()); +} + +//Write so that the port is full (only port 1 for this) +for (i = 0; i < MAXPORTSIZE + 1; ++i) { + write(1, i) +} + +//full +port = getPortHandle(1); +test("full", port.full()); +test("notempty", !port.empty()); + +//tryWrite +firstElem = peek(1); +test("trywritefails", !port.tryWrite("foo")); +test("trywritenochange", peek(1) === firstElem); +read(1); +test("trywritesucceeds", port.tryWrite("foo")); +test("trywritewrites", port.data.pop() === "foo"); +test("notfull", !port.full()); + +write("tb_results.txt", ",tb_ports"); +run("tb_functions.script", 1, "OK"); \ No newline at end of file diff --git a/netscript_tests/tb_remote.script b/netscript_tests/tb_remote.script new file mode 100644 index 000000000..123928db7 --- /dev/null +++ b/netscript_tests/tb_remote.script @@ -0,0 +1,17 @@ +import {test} from "tb_basic.script"; + +test("run", args.length === 1 && args[0] === "OK"); + +svr = "foodnstuff"; +test("getHostname", getHostname() === svr); +//ls +res = ls(svr); +test("ls1", res.includes("sector-12-crime.lit")); +test("ls2", res.includes("tb_remote.script")); +test("ls3", res.includes("tb_basic.script")); +test("ls4", res.length === 3); +res = ls(svr, ".lit"); +test("ls5", res.length === 1); +test("ls6", res.includes("sector-12-crime.lit")); + +write("tb_results.txt", "tb_remote"); \ No newline at end of file diff --git a/netscript_tests/tb_start.script b/netscript_tests/tb_start.script new file mode 100644 index 000000000..13d2bfd94 --- /dev/null +++ b/netscript_tests/tb_start.script @@ -0,0 +1,35 @@ +tprint("Beginning testbench. A soft reset MUST be performed before running this."); +tprint("This should be run on a Bitnode between 1 and 7, with $100k+, 16GB RAM+ " + + "and access to Singularity functions otherwise some tests may fail"); + +run("tb_basic.script", 1, "OK"); +write("tb_results.txt", "tb_start", "w"); + +while(true) { + sleep(10000); + res = read("tb_results.txt"); + if (res.includes("FAIL")) { + tprint("TESTBENCH FAILED"); + killall(); + } + if (res.includes("tb_start") && res.includes("tb_basic") && + res.includes("tb_ports") && res.includes("tb_multiarray") && + res.includes("tb_functions")) { + break; + } +} + + +//Check remote +scp("tb_results.txt", "foodnstuff", "home"); +res = read("tb_results.txt"); +if (res.includes("FAIL")) { + tprint("TESTBENCH FAILED"); + killall(); +} +if (res.includes("tb_remote")) { + tprint("TESTBENCH SUCCESS"); +} else { + tprint("TESTBENCH FAILED"); + killall(); +} \ No newline at end of file diff --git a/src/BitNode.js b/src/BitNode.js index 1710e4974..57b907193 100644 --- a/src/BitNode.js +++ b/src/BitNode.js @@ -51,7 +51,7 @@ function initBitNodes() { "In this BitNode you can create and manage your own corporation. Running a successful corporation " + "has the potential of generating massive profits. All other forms of income are reduced by 75%. Furthermore:

    " + "The price and reputation cost of all Augmentations is tripled
    " + - "The starting and maximum amount of money on servers is halved
    " + + "The starting and maximum amount of money on servers is reduced by 75%
    " + "Server growth rate is reduced by 80%
    " + "You will start out with $150b so that you can start your corporation
    " + "You now only need 75 reputation with a faction in order to donate to it, rather than 150

    " + @@ -81,6 +81,7 @@ function initBitNodes() { "The starting money on servers is halved, but the maximum money remains the same
    " + "Most methods of earning money now give significantly less
    " + "Infiltration gives 50% more reputation and money
    " + + "Corporations have 50% lower valuations and are therefore less profitable
    " + "Augmentations are more expensive
    " + "Hacking experience gain rates are reduced

    " + "Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will " + @@ -125,6 +126,7 @@ function initBitNodes() { "The growth rate of servers is halved
    " + "Weakening a server is twice as effective
    " + "Company wages are decreased by 50%
    " + + "Corporation valuations are 99% lower and are therefore significantly less profitable
    " + "Hacknet Node production is significantly decreased
    " + "Crime and Infiltration are more lucrative
    " + "Augmentations are twice as expensive

    " + @@ -137,11 +139,11 @@ function initBitNodes() { "Level 3: 42%"); //Books: Frontera, Shiner - BitNodes["BitNode12"] = new BitNode(12, "Eye of the World", "COMING SOON"); //Become AI + BitNodes["BitNode12"] = new BitNode(12, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes BitNodes["BitNode13"] = new BitNode(13, "", "COMING SOON"); BitNodes["BitNode14"] = new BitNode(14, "", "COMING SOON"); BitNodes["BitNode15"] = new BitNode(15, "", "COMING SOON"); - BitNodes["BitNode16"] = new BitNode(16, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes + BitNodes["BitNode16"] = new BitNode(16, "", "COMING SOON"); BitNodes["BitNode17"] = new BitNode(17, "", "COMING SOON"); BitNodes["BitNode18"] = new BitNode(18, "", "COMING SOON"); BitNodes["BitNode19"] = new BitNode(19, "", "COMING SOON"); @@ -150,14 +152,6 @@ function initBitNodes() { BitNodes["BitNode22"] = new BitNode(22, "", "COMING SOON"); BitNodes["BitNode23"] = new BitNode(23, "", "COMING SOON"); BitNodes["BitNode24"] = new BitNode(24, "", "COMING SOON"); - BitNodes["BitNode25"] = new BitNode(25, "", "COMING SOON"); - BitNodes["BitNode26"] = new BitNode(26, "", "COMING SOON"); - BitNodes["BitNode27"] = new BitNode(27, "", "COMING SOON"); - BitNodes["BitNode28"] = new BitNode(28, "", "COMING SOON"); - BitNodes["BitNode29"] = new BitNode(29, "", "COMING SOON"); - BitNodes["BitNode30"] = new BitNode(30, "", "COMING SOON"); - BitNodes["BitNode31"] = new BitNode(31, "", "COMING SOON"); - BitNodes["BitNode32"] = new BitNode(32, "", "COMING SOON"); } let BitNodeMultipliers = { @@ -188,6 +182,8 @@ let BitNodeMultipliers = { InfiltrationMoney: 1, InfiltrationRep: 1, + + CorporationValuation: 1, } function initBitNodeMultipliers() { @@ -215,8 +211,8 @@ function initBitNodeMultipliers() { BitNodeMultipliers.RepToDonateToFaction = 0.5; BitNodeMultipliers.AugmentationRepCost = 3; BitNodeMultipliers.AugmentationMoneyCost = 3; - BitNodeMultipliers.ServerMaxMoney = 0.50; - BitNodeMultipliers.ServerStartingMoney = 0.50; + BitNodeMultipliers.ServerMaxMoney = 0.25; + BitNodeMultipliers.ServerStartingMoney = 0.25; BitNodeMultipliers.ServerGrowthRate = 0.20; BitNodeMultipliers.ScriptHackMoney = 0.25; BitNodeMultipliers.CompanyWorkMoney = 0.25; @@ -241,13 +237,14 @@ function initBitNodeMultipliers() { BitNodeMultipliers.ServerMaxMoney = 2; BitNodeMultipliers.ServerStartingSecurity = 2; BitNodeMultipliers.ServerStartingMoney = 0.5; - BitNodeMultipliers.ScriptHackMoney = 0.2; + BitNodeMultipliers.ScriptHackMoney = 0.15; BitNodeMultipliers.HacknetNodeMoney = 0.2; BitNodeMultipliers.CrimeMoney = 0.5; BitNodeMultipliers.InfiltrationRep = 1.5; BitNodeMultipliers.InfiltrationMoney = 1.5; BitNodeMultipliers.AugmentationMoneyCost = 2; BitNodeMultipliers.HackExpGain = 0.5; + BitNodeMultipliers.CorporationValuation = 0.5; break; case 8: //Ghost of Wall Street BitNodeMultipliers.ScriptHackMoney = 0; @@ -256,7 +253,8 @@ function initBitNodeMultipliers() { BitNodeMultipliers.CrimeMoney = 0; BitNodeMultipliers.HacknetNodeMoney = 0; BitNodeMultipliers.InfiltrationMoney = 0; - BitNodeMultipliers.RepToDonateToFaction = 0 + BitNodeMultipliers.RepToDonateToFaction = 0; + BitNodeMultipliers.CorporationValuation = 0; break; case 11: //The Big Crash BitNodeMultipliers.ServerMaxMoney = 0.1; @@ -269,6 +267,7 @@ function initBitNodeMultipliers() { BitNodeMultipliers.AugmentationMoneyCost = 2; BitNodeMultipliers.InfiltrationMoney = 2.5; BitNodeMultipliers.InfiltrationRep = 2.5; + BitNodeMultipliers.CorporationValuation = 0.01; break; default: console.log("WARNING: Player.bitNodeN invalid"); diff --git a/src/CompanyManagement.js b/src/CompanyManagement.js index 19dcb61ae..f402d9e36 100644 --- a/src/CompanyManagement.js +++ b/src/CompanyManagement.js @@ -1,3 +1,4 @@ +import {BitNodeMultipliers} from "./BitNode.js"; import {Engine} from "./engine.js"; import {showLiterature} from "./Literature.js"; import {Locations} from "./Location.js"; @@ -64,6 +65,9 @@ var OfficeInitialCost = 4e9; var OfficeInitialSize = 3; var OfficeUpgradeBaseCost = 1e9; +var BribeThreshold = 100e12; //Money needed to be able to bribe for faction rep +var BribeToRepRatio = 1e9; //Bribe Value divided by this = rep gain + function Material(params={}) { this.name = params.name ? params.name : ""; this.qty = 0; //Quantity @@ -101,67 +105,67 @@ Material.prototype.init = function(mats={}) { this.dmd = 75; this.dmdR = [65, 85]; this.cmp = 50; this.cmpR = [40, 60]; this.bCost = 1000; this.mv = 0.2; - this.mku = 12; + this.mku = 6; break; case "Energy": this.dmd = 90; this.dmdR = [80, 100]; this.cmp = 80; this.cmpR = [65, 95]; this.bCost = 1500; this.mv = 0.2; - this.mku = 12; + this.mku = 6; break; case "Food": this.dmd = 80; this.dmdR = [70, 90]; this.cmp = 60; this.cmpR = [35, 85]; this.bCost = 5000; this.mv = 1; - this.mku = 7.5; + this.mku = 3; break; case "Plants": this.dmd = 70; this.dmdR = [20, 90]; this.cmp = 50; this.cmpR = [30, 70]; this.bCost = 3000; this.mv = 0.6; - this.mku = 10; + this.mku = 3.75; break; case "Metal": this.dmd = 80; this.dmdR = [75, 85]; this.cmp = 70; this.cmpR = [60, 80]; this.bCost = 2650; this.mv = 1; - this.mku = 12; + this.mku = 6; break; case "Hardware": this.dmd = 85; this.dmdR = [80, 90]; this.cmp = 80; this.cmpR = [65, 95]; this.bCost = 4000; this.mv = 0.5; //Less mv bc its processed twice - this.mku = 5.5; + this.mku = 1; break; case "Chemicals": this.dmd = 55; this.dmdR = [40, 70]; this.cmp = 60; this.cmpR = [40, 80]; this.bCost = 6750; this.mv = 1.2; - this.mku = 6.5; + this.mku = 2; break; case "Real Estate": this.dmd = 50; this.dmdR = [5, 100]; this.cmp = 50; this.cmpR = [25, 75]; this.bCost = 16e3; this.mv = 1.5; //Less mv bc its processed twice - this.mku = 5; + this.mku = 1.5; break; case "Drugs": this.dmd = 60; this.dmdR = [45, 75]; this.cmp = 70; this.cmpR = [40, 100]; this.bCost = 8e3; this.mv = 1.6; - this.mku = 4; + this.mku = 1; break; case "Robots": this.dmd = 90; this.dmdR = [80, 100]; this.cmp = 90; this.cmpR = [80, 100]; this.bCost = 20e3; this.mv = 0.5; //Less mv bc its processed twice - this.mku = 2.5; + this.mku = 1; break; case "AI Cores": this.dmd = 90; this.dmdR = [80, 100]; this.cmp = 90; this.cmpR = [80, 100]; this.bCost = 27e3; this.mv = 0.8; //Less mv bc its processed twice - this.mku = 1.8; + this.mku = 0.5; break; case "Scientific Research": break; @@ -352,8 +356,7 @@ Product.prototype.finishProduct = function(employeeProd, industry) { (0.05 * employeeProd[EmployeePositions.Business])); this.calculateRating(industry); var advMult = 1 + (Math.pow(this.advCost, 0.1) / 100); - console.log("advMult: " + advMult); - this.mku = 100 / (advMult * Math.pow((this.qlt + 0.001), 0.9) * (busRatio + mgmtRatio)); + this.mku = 100 / (advMult * Math.pow((this.qlt + 0.001), 0.75) * (busRatio + mgmtRatio)); this.dmd = industry.awareness === 0 ? 20 : Math.min(100, advMult * (100 * (industry.popularity / industry.awareness))); this.cmp = getRandomInt(0, 70); @@ -548,11 +551,11 @@ var ProductRatingWeights = { var IndustryUpgrades = { "0": [0, 500e3, 1, 1.05, "Coffee", "Provide your employees with coffee, increasing their energy by 5%."], - "1": [1, 1e9, 1.02, 1.01, + "1": [1, 1e9, 1.03, 1.03, "AdVert.Inc", "Hire AdVert.Inc to advertise your company. Each level of " + "this upgrade grants your company a static increase of 4 and 1 to its awareness and " + "popularity, respectively. It will then increase your company's awareness by 1%, and its popularity " + - "by a random percentage between 5% and 10%. These effects are increased by other upgrades " + + "by a random percentage between 3% and 6%. These effects are increased by other upgrades " + "that increase the power of your advertising."] } @@ -626,6 +629,7 @@ function Industry(params={}) { this.upgrades = Array(numUpgrades).fill(0); this.state = "START"; + this.newInd = true; this.init(); } @@ -915,6 +919,10 @@ Industry.prototype.process = function(marketCycles=1, state, company) { this.thisCycleRevenue = new Decimal(0); this.thisCycleExpenses = new Decimal(0); + //Once you start making revenue, the player should no longer be + //considered new, and therefore no longer needs the 'tutorial' UI elements + if (this.lastCycleRevenue.gt(0)) {this.newInd = false;} + //Process offices (and the employees in them) var employeeSalary = 0; for (var officeLoc in this.offices) { @@ -1256,7 +1264,9 @@ Industry.prototype.processProducts = function(marketCycles=1, corporation) { var prod = this.products[prodName]; if (!prod.fin) { var city = prod.createCity, office = this.offices[city]; - var total = office.employeeProd["total"], ratio; + var total = office.employeeProd[EmployeePositions.Operations] + + office.employeeProd[EmployeePositions.Engineer] + + office.employeeProd[EmployeePositions.Management], ratio; if (total === 0) { ratio = 0; } else { @@ -1437,7 +1447,7 @@ Industry.prototype.upgrade = function(upgrade, refs) { this.awareness += (4 * advMult); this.popularity += (1 * advMult); this.awareness *= (1.01 * advMult); - this.popularity *= ((1 + getRandomInt(5, 10) / 100) * advMult); + this.popularity *= ((1 + getRandomInt(3, 6) / 100) * advMult); break; default: console.log("ERROR: Un-implemented function index: " + upgN); @@ -2121,7 +2131,6 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { class:"cmpy-mgmt-warehouse-material-div", }); - //Storage size var totalExport = 0; for (var i = 0; i < mat.exp.length; ++i) { totalExport += mat.exp[i].amt; @@ -2160,17 +2169,27 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { div.appendChild(buttonPanel); //Button to set purchase amount - buttonPanel.appendChild(createElement("a", { - innerText: "Buy (" + formatNumber(mat.buy, 3) + ")", display:"inline-block", class:"a-link-button", + var tutorial = industry.newInd && Object.keys(industry.reqMats).includes(mat.name) && + mat.buy === 0 && mat.imp === 0; + var buyButtonParams = { + innerText: "Buy (" + formatNumber(mat.buy, 3) + ")", display:"inline-block", + class: tutorial ? "a-link-button flashing-button" : "a-link-button", clickListener:()=>{ var txt = createElement("p", { innerHTML: "Enter the amount of " + mat.name + " you would like " + "to purchase per second. This material's cost changes constantly" }); + var confirmBtn; var input = createElement("input", { - type:"number", value:mat.buy ? mat.buy : null, placeholder: "Purchase amount" + type:"number", value:mat.buy ? mat.buy : null, placeholder: "Purchase amount", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) { + confirmBtn.click(); + } + } }); - var confirmBtn = createElement("a", { + confirmBtn = createElement("a", { innerText:"Confirm", class:"a-link-button", clickListener:()=>{ if (isNaN(input.value)) { @@ -2184,16 +2203,29 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { } } }); + var clearButton = createElement("a", { + innerText:"Clear Purchase", class:"a-link-button", + clickListener:()=>{ + mat.buy = 0; + removeElementById(purchasePopupId); + this.createUI(parentRefs); + return false; + } + }); var cancelBtn = createElement("a", { innerText:"Cancel", class:"a-link-button", clickListener:()=>{ removeElementById(purchasePopupId); } }); - createPopup(purchasePopupId, [txt, input, confirmBtn, cancelBtn]); + createPopup(purchasePopupId, [txt, input, confirmBtn, clearButton, cancelBtn]); input.focus(); } - })); + }; + if (tutorial) { + buyButtonParams.tooltip = "Purchase your required materials to get production started!"; + } + buttonPanel.appendChild(createElement("a", buyButtonParams)); //Button to manage exports if (company.unlockUpgrades[0] === 1) { //Export unlock upgrade @@ -2366,15 +2398,24 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { "to 'MP+10' then it will always be sold at $10 above the market price.", }); var br = createElement("br", {}); + var confirmBtn; var inputQty = createElement("input", { type:"text", marginTop:"4px", - value: mat.sllman[1] ? mat.sllman[1] : null, placeholder: "Sell amount" + value: mat.sllman[1] ? mat.sllman[1] : null, placeholder: "Sell amount", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); var inputPx = createElement("input", { type:"text", marginTop:"4px", - value: mat.sCost ? mat.sCost : null, placeholder: "Sell price" + value: mat.sCost ? mat.sCost : null, placeholder: "Sell price", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); - var confirmBtn = createElement("a", { + confirmBtn = createElement("a", { innerText:"Confirm", class:"a-link-button", margin:"6px", clickListener:()=>{ //Parse price @@ -2501,13 +2542,22 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { "Setting the sell amount to 'MAX' will result in you always selling the " + "maximum possible amount of the material.

    ", }); + var confirmBtn; var inputQty = createElement("input", { - type:"text", value:product.sllman[city][1] ? product.sllman[city][1] : null, placeholder: "Sell amount" + type:"text", value:product.sllman[city][1] ? product.sllman[city][1] : null, placeholder: "Sell amount", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); var inputPx = createElement("input", { - type:"text", value: product.sCost ? product.sCost : null, placeholder: "Sell price" + type:"text", value: product.sCost ? product.sCost : null, placeholder: "Sell price", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); - var confirmBtn = createElement("a", { + confirmBtn = createElement("a", { class:"a-link-button", innerText:"Confirm", clickListener:()=>{ //Parse price @@ -2566,10 +2616,15 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { innerText:"Enter a limit to the amount of this product you would " + "like to product per second. Leave the box empty to set no limit." }); + var confirmBtn; var input = createElement("input", { - type:"number", placeholder:"Limit" + type:"number", placeholder:"Limit", + onkeyup:(e)=>{ + e.preventDefault(); + if (e.keyCode === 13) {confirmBtn.click();} + } }); - var confirmBtn = createElement("a", { + confirmBtn = createElement("a", { class:"a-link-button", display:"inline-block", innerText:"Limit production", margin:'6px', clickListener:()=>{ if (input.value === "") { @@ -2698,10 +2753,10 @@ var CorporationUpgrades = { "20 seconds."], //Makes advertising more effective - "3": [3, 4e9, 1.11, 0.1, + "3": [3, 4e9, 1.12, 0.01, "Wilson Analytics", "Purchase data and analysis from Wilson, a marketing research " + "firm. Each level of this upgrades increases the effectiveness of your " + - "advertising by 10% (additive)."], + "advertising by 1% (additive)."], //Augmentation for employees, increases cre "4": [4, 1e9, 1.06, 0.1, @@ -2776,11 +2831,32 @@ Corporation.prototype.process = function(numCycles=1) { if (this.storedCycles >= CyclesPerIndustryStateCycle) { var state = this.getState(); + //At the start of a new cycle, calculate profits from previous cycle + if (state === "START") { + this.revenue = new Decimal(0); + this.expenses = new Decimal(0); + this.divisions.forEach((ind)=>{ + this.revenue = this.revenue.plus(ind.lastCycleRevenue); + this.expenses = this.expenses.plus(ind.lastCycleExpenses); + }); + var profit = this.revenue.minus(this.expenses); + var cycleProfit = profit.times(numMarketCyclesPersist * SecsPerMarketCycle); + if (isNaN(this.funds)) { + dialogBoxCreate("There was an error calculating your Corporations funds and they got reset to 0. " + + "This is a bug. Please report to game developer.

    " + + "(Your funds have been set to $150b for the inconvenience)"); + this.funds = new Decimal(150e9); + } + this.funds = this.funds.plus(cycleProfit); + this.updateSharePrice(); + } + //Determine number of market cycles at the START state if (state === "START") { if (this.storedCycles >= 2*CyclesPerMarketCycle) { //Enough cycles stored for 2+ market cycles - numMarketCyclesPersist = Math.floor(this.storedCycles / CyclesPerMarketCycle); + //Capped out at 3 to prevent weird behavior + numMarketCyclesPersist = Math.max(3, Math.floor(this.storedCycles / CyclesPerMarketCycle)); } else { numMarketCyclesPersist = 1; } @@ -2792,25 +2868,7 @@ Corporation.prototype.process = function(numCycles=1) { ind.process(marketCycles, state, corp); }); - //At the start of a new cycle, calculate profits from previous cycle - if (state === "START") { - this.revenue = new Decimal(0); - this.expenses = new Decimal(0); - this.divisions.forEach((ind)=>{ - this.revenue = this.revenue.plus(ind.lastCycleRevenue); - this.expenses = this.expenses.plus(ind.lastCycleExpenses); - }); - var profit = this.revenue.minus(this.expenses); - var cycleProfit = profit.times(marketCycles * SecsPerMarketCycle); - if (isNaN(this.funds)) { - dialogBoxCreate("There was an error calculating your Corporations funds and they got reset to 0. " + - "This is a bug. Please report to game developer.

    " + - "(Your funds have been set to $150b for the inconvenience)"); - this.funds = new Decimal(150e9); - } - this.funds = this.funds.plus(cycleProfit); - this.updateSharePrice(); - } + this.state.nextState(); if (Engine.currentPage === Engine.Page.Corporation) {this.updateUIContent();} @@ -2833,7 +2891,7 @@ Corporation.prototype.determineValuation = function() { } val -= (val % 1e6); //Round down to nearest millionth } - return val; + return val * BitNodeMultipliers.CorporationValuation; } Corporation.prototype.getInvestment = function() { @@ -2882,8 +2940,9 @@ Corporation.prototype.goPublic = function() { var txt = createElement("p", { innerHTML: "Enter the number of shares you would like to issue " + "for your IPO. These shares will be publicly sold " + - "and you will no longer own them. You will receive " + - numeral(initialSharePrice).format('$0.000a') + " per share.

    " + + "and you will no longer own them. Your Corporation will receive " + + numeral(initialSharePrice).format('$0.000a') + " per share " + + "(the IPO money will be deposited directly into your Corporation's funds).

    " + "Furthermore, issuing more shares now will help drive up " + "your company's stock price in the future.

    " + "You have a total of " + numeral(this.numShares).format("0.000a") + " of shares that you can issue.", @@ -3101,78 +3160,87 @@ Corporation.prototype.updateUIHeaderTabs = function() { if (document.getElementById("cmpy-mgmt-expand-industry-popup") != null) {return;} var container = createElement("div", { - class:"popup-box-container", - id:"cmpy-mgmt-expand-industry-popup", - }), - content = createElement("div", {class:"popup-box-content"}), - txt = createElement("p", { - innerHTML: "Create a new division to expand into a new industry:", - }), - selector = createElement("select", { - class:"cmpy-mgmt-industry-select" - }), - industryDescription = createElement("p", {}), - nameInput = createElement("input", { - type:"text", - id:"cmpy-mgmt-expand-industry-name-input", - color:"white", - backgroundColor:"black", - display:"block", - maxLength: 30, - pattern:"[a-zA-Z0-9-_]" - }), - nameLabel = createElement("label", { - for:"cmpy-mgmt-expand-industry-name-input", - innerText:"Division name: " - }), - yesBtn = createElement("span", { - class:"popup-box-button", - innerText:"Create Division", - clickListener: ()=>{ - var ind = selector.options[selector.selectedIndex].value, - newDivisionName = nameInput.value; + class:"popup-box-container", + id:"cmpy-mgmt-expand-industry-popup", + }), + content = createElement("div", {class:"popup-box-content"}), + txt = createElement("p", { + innerHTML: "Create a new division to expand into a new industry:", + }), + selector = createElement("select", { + class:"cmpy-mgmt-industry-select" + }), + industryDescription = createElement("p", {}), + nameInput = createElement("input", { + type:"text", + id:"cmpy-mgmt-expand-industry-name-input", + color:"white", + backgroundColor:"black", + display:"block", + maxLength: 30, + pattern:"[a-zA-Z0-9-_]" + }), + nameLabel = createElement("label", { + for:"cmpy-mgmt-expand-industry-name-input", + innerText:"Division name: " + }), + yesBtn = createElement("span", { + class:"popup-box-button", + innerText:"Create Division", + clickListener: ()=>{ + var ind = selector.options[selector.selectedIndex].value, + newDivisionName = nameInput.value; - for (var i = 0; i < this.divisions.length; ++i) { - if (this.divisions[i].name === newDivisionName) { - dialogBoxCreate("This name is already in use!"); - return false; - } + for (var i = 0; i < this.divisions.length; ++i) { + if (this.divisions[i].name === newDivisionName) { + dialogBoxCreate("This name is already in use!"); + return false; } - if (this.funds.lt(IndustryStartingCosts[ind])) { - dialogBoxCreate("Not enough money to create a new division in this industry"); - } else if (newDivisionName === "") { - dialogBoxCreate("New division must have a name!"); - } else { - this.funds = this.funds.minus(IndustryStartingCosts[ind]); - var newInd = new Industry({ - name:newDivisionName, - type:ind, - }); - this.divisions.push(newInd); - this.updateUIHeaderTabs(); - this.selectHeaderTab(headerTabs[headerTabs.length-2]); - removeElementById("cmpy-mgmt-expand-industry-popup"); - this.displayDivisionContent(newInd, Locations.Sector12); - } - return false; } - }), - noBtn = createElement("span", { - class:"popup-box-button", - innerText:"Cancel", - clickListener: function() { + if (this.funds.lt(IndustryStartingCosts[ind])) { + dialogBoxCreate("Not enough money to create a new division in this industry"); + } else if (newDivisionName === "") { + dialogBoxCreate("New division must have a name!"); + } else { + this.funds = this.funds.minus(IndustryStartingCosts[ind]); + var newInd = new Industry({ + name:newDivisionName, + type:ind, + }); + this.divisions.push(newInd); + this.updateUIHeaderTabs(); + this.selectHeaderTab(headerTabs[headerTabs.length-2]); removeElementById("cmpy-mgmt-expand-industry-popup"); - return false; + this.displayDivisionContent(newInd, Locations.Sector12); } - }); + return false; + } + }), + noBtn = createElement("span", { + class:"popup-box-button", + innerText:"Cancel", + clickListener: function() { + removeElementById("cmpy-mgmt-expand-industry-popup"); + return false; + } + }); + + //Make an object to keep track of what industries you're already in + var ownedIndustries = {} + for (var i = 0; i < this.divisions.length; ++i) { + ownedIndustries[this.divisions[i].type] = true; + } //Add industry types to selector //Have Agriculture be first as recommended option - selector.add(createElement("option", { - text:Industries["Agriculture"], value:"Agriculture" - })) + if (!ownedIndustries["Agriculture"]) { + selector.add(createElement("option", { + text:Industries["Agriculture"], value:"Agriculture" + })); + } + for (var key in Industries) { - if (key !== "Agriculture" && Industries.hasOwnProperty(key)) { + if (key !== "Agriculture" && Industries.hasOwnProperty(key) && !ownedIndustries[key]) { var ind = Industries[key]; selector.add(createElement("option", { text: ind,value:key, @@ -3300,7 +3368,9 @@ Corporation.prototype.displayCorporationOverviewContent = function() { var popupId = "cmpy-mgmt-sell-shares-popup"; var currentStockPrice = this.sharePrice; var txt = createElement("p", { - innerHTML: "Enter the number of shares you would like to sell. The current price of your " + + innerHTML: "Enter the number of shares you would like to sell. The money from " + + "selling your shares will go directly to you (NOT your Corporation). " + + "The current price of your " + "company's stock is " + numeral(currentStockPrice).format("$0.000a"), }); var profitIndicator = createElement("p", {}); @@ -3308,7 +3378,7 @@ Corporation.prototype.displayCorporationOverviewContent = function() { type:"number", placeholder:"Shares to sell", margin:"5px", inputListener: ()=> { var numShares = Math.round(input.value); - if (isNaN(numShares) || shares <= 0) { + if (isNaN(numShares) || numShares <= 0) { profitIndicator.innerText = "ERROR: Invalid value entered for number of shares to sell" } else if (numShares > this.numShares) { profitIndicator.innerText = "You don't have this many shares to sell!"; @@ -3365,7 +3435,9 @@ Corporation.prototype.displayCorporationOverviewContent = function() { var popupId = "cmpy-mgmt-buyback-shares-popup"; var currentStockPrice = this.sharePrice; var txt = createElement("p", { - innerHTML: "Enter the number of shares you would like to buy back at market price. The current price of your " + + innerHTML: "Enter the number of shares you would like to buy back at market price. To purchase " + + "these shares, you must use your own money (NOT your Corporation's funds). " + + "The current price of your " + "company's stock is " + numeral(currentStockPrice).format("$0.000a") + ". Your company currently has " + formatNumber(this.issuedShares, 3) + " outstanding stock shares", }); @@ -3375,12 +3447,13 @@ Corporation.prototype.displayCorporationOverviewContent = function() { inputListener: ()=> { var numShares = Math.round(input.value); //TODO add conditional for if player doesn't have enough money - if (isNaN(numShares) || shares <= 0) { + if (isNaN(numShares) || numShares <= 0) { costIndicator.innerText = "ERROR: Invalid value entered for number of shares to buyback" } else if (numShares > this.issuedShares) { costIndicator.innerText = "There are not this many shares available to buy back. " + "There are only " + this.issuedShares + " outstanding shares."; } else { + console.log("here"); costIndicator.innerText = "Purchase " + numShares + " shares for a total of " + numeral(numShares * currentStockPrice).format('$0.000a'); } @@ -3434,6 +3507,114 @@ Corporation.prototype.displayCorporationOverviewContent = function() { companyManagementPanel.appendChild(sellShares); companyManagementPanel.appendChild(buybackShares); + + //If your Corporation is big enough, buy faction influence through bribes + var canBribe = this.determineValuation() >= BribeThreshold; + var bribeFactions = createElement("a", { + class: canBribe ? "a-link-button" : "a-link-button-inactive", + innerText:"Bribe Factions", display:"inline-block", + tooltip:canBribe + ? "Use your Corporations power and influence to bribe Faction leaders in exchange for reputation" + : "Your Corporation is not powerful enough to bribe Faction leaders", + clickListener:()=>{ + var popupId = "cmpy-mgmt-bribe-factions-popup"; + var txt = createElement("p", { + innerText:"You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation" + }); + var factionSelector = createElement("select", {margin:"3px"}); + for (var facName in Player.factions) { + if (Player.factions.hasOwnProperty(facName)) { + factionSelector.add(createElement("option"), { + text:facName, value:facName + }); + } + } + var repGainText = createElement("p"); + var stockSharesInput; + var moneyInput = createElement("input", { + type:"number", placeholder:"Corporation funds", margin:"5px", + inputListener:()=>{ + var money = moneyInput.value == null ? 0 : moneyInput.value; + var stockPrice = this.sharePrice; + var stockShares = stockSharesInput.value == null ? 0 : Math.round(stockSharesInput.value); + if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) { + repGainText.innerText = "ERROR: Invalid value(s) entered"; + } else if (this.funds.lt(money)) { + repGainText.innerText = "ERROR: You do not have this much money to bribe with"; + } else if (this.stockShares > this.numShares) { + repGainText.innerText = "ERROR: You do not have this many shares to bribe with"; + } else { + var totalAmount = money + (stockShares * stockPrice); + var repGain = totalAmount / BribeToRepRatio; + repGainText.innerText = "You will gain " + formatNumber(repGain, 0) + + " reputation with " + + factionSelector.options[factionSelector.selectedIndex].value + + " with this bribe"; + } + } + }); + stockSharesInput = createElement("input", { + type:"number", placeholder:"Stock Shares", margin: "5px", + inputListener:()=>{ + var money = moneyInput.value == null ? 0 : moneyInput.value; + var stockPrice = this.sharePrice; + var stockShares = stockSharesInput.value == null ? 0 : Math.round(stockSharesInput.value); + if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) { + repGainText.innerText = "ERROR: Invalid value(s) entered"; + } else if (this.funds.lt(money)) { + repGainText.innerText = "ERROR: You do not have this much money to bribe with"; + } else if (this.stockShares > this.numShares) { + repGainText.innerText = "ERROR: You do not have this many shares to bribe with"; + } else { + var totalAmount = money + (stockShares * stockPrice); + var repGain = totalAmount / BribeToRepRatio; + repGainText.innerText = "You will gain " + formatNumber(repGain, 0) + + " reputation with " + + factionSelector.options[factionSelector.selectedIndex].value + + " with this bribe"; + } + } + }); + var confirmButton = createElement("a", { + class:"a-link-button", innerText:"Bribe", display:"inline-block", + clickListener:()=>{ + var money = moneyInput.value == null ? 0 : moneyInput.value; + var stockPrice = this.sharePrice; + var stockShares = stockSharesInput.value == null ? 0 : Math.round(stockSharesInput.value); + var fac = Factions[factionSelector.options[factionSelector.selectedIndex].value]; + if (fac == null) { + dialogBoxCreate("ERROR: You must select a faction to bribe"); + return false; + } + if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) { + dialogBoxCreate("ERROR: Invalid value(s) entered"); + } else if (this.funds.lt(money)) { + dialogBoxCreate("ERROR: You do not have this much money to bribe with"); + } else if (this.stockShares > this.numShares) { + dialogBoxCreate("ERROR: You do not have this many shares to bribe with"); + } else { + var totalAmount = money + (stockShares * stockPrice); + var repGain = totalAmount / BribeToRepRatio; + dialogBoxCreate("You gained " + formatNumber(repGain, 0) + + " reputation with " + fac.name + " by bribing them."); + fac.playerReputation += repGain; + this.funds = this.funds.lt(money); + this.numShares -= stockShares; + removeElementById(popupId); + return false; + } + } + }); + var cancelButton = createElement("a", { + class:"a-link-button", innerText:"Cancel", display:"inline-block", + clickListener:()=>{ + removeElementById(popupId); + return false; + } + }); + } + }); + companyManagementPanel.appendChild(bribeFactions); } else { var findInvestors = createElement("a", { class: this.fundingRound >= 4 ? "a-link-button-inactive" : "a-link-button tooltip", @@ -3899,14 +4080,28 @@ Corporation.prototype.displayDivisionContent = function(division, city) { industryEmployeePanel.appendChild(industryEmployeeText); //Hire Employee button - industryEmployeeHireButton = createElement("a", { - class:"a-link-button",display:"inline-block", - innerText:"Hire Employee", fontSize:"13px", - clickListener:()=>{ - office.findEmployees({corporation:this, division:division}); - return false; - } - }); + if (office.employees.length === 0) { + industryEmployeeHireButton = createElement("a", { + class:"a-link-button",display:"inline-block", + innerText:"Hire Employee", fontSize:"13px", + tooltip:"You'll need to hire some employees to get your operations started! " + + "It's recommended to have at least one employee in every position", + clickListener:()=>{ + office.findEmployees({corporation:this, division:division}); + return false; + } + }); + //industryEmployeeHireButton.classList.add("flashing-button"); + } else { + industryEmployeeHireButton = createElement("a", { + class:"a-link-button",display:"inline-block", + innerText:"Hire Employee", fontSize:"13px", + clickListener:()=>{ + office.findEmployees({corporation:this, division:division}); + return false; + } + }); + } industryEmployeePanel.appendChild(industryEmployeeHireButton); //Autohire Employee button @@ -4240,6 +4435,9 @@ Corporation.prototype.updateDivisionContent = function(division) { if (office.employees.length >= office.size) { industryEmployeeHireButton.className = "a-link-button-inactive"; industryEmployeeAutohireButton.className = "a-link-button-inactive tooltip"; + } else if (office.employees.length === 0) { + industryEmployeeHireButton.className = "a-link-button tooltip flashing-button"; + industryEmployeeAutohireButton.className = "a-link-button tooltip"; } else { industryEmployeeHireButton.className = "a-link-button"; industryEmployeeAutohireButton.className = "a-link-button tooltip"; diff --git a/src/Constants.js b/src/Constants.js index 749b54534..12b926373 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -38,6 +38,7 @@ let CONSTANTS = { //NeuroFlux Governor cost multiplier as you level up NeuroFluxGovernorLevelMult: 1.14, + /* Netscript Constants */ //RAM Costs for different commands ScriptWhileRamCost: 0.2, ScriptForRamCost: 0.2, @@ -79,6 +80,8 @@ let CONSTANTS = { MultithreadingRAMCost: 1, + NumNetscriptPorts: 20, + //Server constants ServerBaseGrowthRate: 1.03, //Unadjusted Growth rate ServerMaxGrowthRate: 1.0035, //Maximum possible growth rate (max rate accounting for server security) @@ -1135,38 +1138,39 @@ let CONSTANTS = { "World Stock Exchange account and TIX API Access
    ", LatestUpdate: - "v0.34.5
    " + + "v0.35.0
    " + + "-Minor rebalancing of BitNodes due to the fact that Corporations provide a (relatively) new method of " + + "progressing
    " + "-Corporation Management Changes:
    " + - "---Market Research unlocks are now cheaper
    " + - "---New 'VeChain' upgrade: displays useful statistics about Corporation
    " + - "---Corporation cycles are processed 25% faster
    " + - "---Corporation valuation was lowered by ~10% (this affects stock price and investments)
    " + - "---Rebalanced the effects of advertising. Should now be more effective for every Industry
    " + - "---Fixed several bugs/exploits involving selling and buying back stock shares
    " + - "---You will now receive a Corporation Handbook (.lit file) when starting out BitNode-3. It contains a brief guide to help you get started. " + - "This same handbook can be viewed from the Corporation management screen
    " + - "---Slightly decreased the amount by which a Product's sell price can be marked up
    " + - "---Employees can now be assigned to a 'Training' task, during which they will slowly increase several of their stats
    " + - "-Hopefully fixed an exploit with Array.forEach(). If there are any issues with using forEach, let me know
    " + - "-Arguments passed into a script are now passed by value. This means modifying the 'args' array in a script " + - "should no longer cause issues
    " + - "-Scripts executed programatically (via run(), exec(), etc.) will now fail if null/undefined is passed in " + - "as an argument
    " + - "-Added peek() Netscript function
    " + - "-killall() Netscript function now returns true if any scripts were killed, and false otherwise.
    " + - "-hack() Netscript function now returns the amount of money gained for successful hacks, and 0 for failed hacks
    " + - "-scp Terminal command and Netscript function now work for txt files
    " + - "-Changes courtesy of Wraithan:
    " + - "---Text files are now displayed using 'pre' rather than 'p' elements when using the 'cat' Terminal command. " + - "This means tabs are retained and lines don't automatically wrap
    " + - "---ls() Netscript function now returns text files as well
    " + - "-Removed round() Netscript function, since you can just use Math.round() instead
    " + - "-Added disableLog() and enableLog() Netscript functions
    " + - "-Removed the 'log' argument from sleep(), since you can now use the new disableLog function
    " + - "-'Netscript Documentation' button on script editor now points to new readthedocs documentation rather than wiki
    " + - "-When working for a faction, your current faction reputation is now displayed
    " + - "-Bug Fix: Hacking Missions should no longer break when dragging an existing connection to another Node
    " + - "-Bug Fix: Fixed RAM usage of getNextHacknetNodeCost() (is not 1.5GB instead of 4GB)
    " + "---Once your Corporation gets big/powerful enough, you can now bribe Factions for reputation using company funds an/or stock shares
    " + + "---You can now only create one Division for every Industry type
    " + + "---Added several new UI/UX elements
    " + + "---Wilson Analytics multiplier was significantly reduced to 1% per level (additive).
    " + + "---Reduced the effect of Advert Inc upgrade. Advert Inc. upgrade price increases faster
    " + + "---Materials can now be marked up at higher prices
    " + + "-Added Javascript's built-in Number object to Netscript
    " + + "-Added getCharacterInformation(), getCompanyFavor(), and getFactionFavor() Netscript Singularity functions
    " + + "-Rebalanced Singularity Function RAM Costs. They now cost x8 as much when outside of BN-4 (rather than x10). Also, " + + "many of the functions now use significantly less RAM
    " + + "-Refactored Netscript Ports. You can now get a handle for a Netscript port using the " + + "getPortHandle() Netscript function. This allows you to access a port's underlying queue (which is just an array) and also " + + "makes several new functions available such as tryWrite(), full(), and empty().
    " + + "-Number of Netscript Ports increased from 10 to 20
    " + + "-Netscript assignments should now return proper values. i.e. i = 5 should return 5.
    " + + "-Added throw statements to Netscript. It's not super useful since 'catch' isn't implemented, but it can be used " + + "to generate custom runtime error messages.
    " + + "-Added import declaration to Netscript. With this, you are able to import functions (and only functions) from " + + "other files. Using export declarations is not necessary
    " + + "-Most Netscript Runtime errors (the ones that cause your script to crash) should now include the line number where the error occured
    " + + "-When working for a company, your current company reputation is now displayed
    " + + "-Whenever you get a Faction Invite it will be immediately appended to your 'invited factions' list. " + + "Therefore the checkFactionInvitations() Singularity Function should now be properly useable since you no longer " + + "need to decline a Faction Invitation before it shows up in the result.
    " + + "-Bug Fix: When purchasing servers, whitespace should now automatically be removed from the hostname
    " + + "-Bug Fix: Can no longer have whitespace in the filename of text files created using write()
    " + + "-Bug Fix: In Netscript, you can no longer assign a Hacknet Node handle (hacknetnodes[i]) to another value
    " + + "-Bug Fix: If you are in the Factions tab when you accept an invitation from a Faction, the page will now properly 'refresh'
    " + + "-Bug Fix: Scripts that run recursive functions should now be killed properly
    " } export {CONSTANTS}; diff --git a/src/Faction.js b/src/Faction.js index 7487fa872..32feeb9e7 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -14,6 +14,7 @@ import {factionInvitationBoxCreate} from "../utils/FactionInvitation import {clearEventListeners} from "../utils/HelperFunctions.js"; import {Reviver, Generic_toJSON, Generic_fromJSON} from "../utils/JSONReviver.js"; +import numeral from "../utils/numeral.min.js"; import {formatNumber, isPositiveNumber} from "../utils/StringHelperFunctions.js"; import {yesNoBoxCreate, yesNoBoxGetYesButton, yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox.js"; @@ -831,11 +832,13 @@ function displayFactionAugmentations(factionName) { for (var j = 0; j < Player.queuedAugmentations.length; ++j) { if (Player.queuedAugmentations[j].name == aug.name) { owned = true; + break; } } for (var j = 0; j < Player.augmentations.length; ++j) { if (Player.augmentations[j].name == aug.name) { owned = true; + break; } } @@ -844,7 +847,6 @@ function displayFactionAugmentations(factionName) { var aDiv = document.createElement("div"); var aElem = document.createElement("a"); var pElem = document.createElement("p"); - aElem.setAttribute("href", "#"); var req = aug.baseRepRequirement * faction.augmentationRepRequirementMult; var hasPrereqs = hasAugmentationPrereqs(aug); if (!hasPrereqs) { @@ -856,10 +858,11 @@ function displayFactionAugmentations(factionName) { pElem.innerHTML = "ALREADY OWNED"; } else if (faction.playerReputation >= req) { aElem.setAttribute("class", "a-link-button"); - pElem.innerHTML = "UNLOCKED - $" + formatNumber(aug.baseCost * faction.augmentationPriceMult, 2); + //pElem.innerHTML = "UNLOCKED - $" + formatNumber(aug.baseCost * faction.augmentationPriceMult, 2); + pElem.innerHTML = "UNLOCKED - " + numeral(aug.baseCost * faction.augmentationPriceMult).format("$0.000a"); } else { aElem.setAttribute("class", "a-link-button-inactive"); - pElem.innerHTML = "LOCKED (Requires " + formatNumber(req, 1) + " faction reputation) - $" + formatNumber(aug.baseCost * faction.augmentationPriceMult, 2); + pElem.innerHTML = "LOCKED (Requires " + formatNumber(req, 1) + " faction reputation) - " + numeral(aug.baseCost * faction.augmentationPriceMult).format("$0.000a"); pElem.style.color = "red"; } aElem.style.display = "inline"; diff --git a/src/NetscriptEnvironment.js b/src/NetscriptEnvironment.js index e9a125766..cf43b4657 100644 --- a/src/NetscriptEnvironment.js +++ b/src/NetscriptEnvironment.js @@ -1,4 +1,7 @@ +import {HacknetNode} from "./HacknetNode.js"; import {NetscriptFunctions} from "./NetscriptFunctions.js"; +import {NetscriptPort} from "./NetscriptPort.js"; + /* Environment * NetScript program environment */ @@ -73,6 +76,14 @@ Environment.prototype = { } res = res[i]; } + + //Cant assign to ports or HacknetNodes + if (res[idx[idx.length-1]] instanceof HacknetNode) { + throw new Error("Cannot assign a Hacknet Node handle to a new value"); + } + if (res[idx[idx.length-1]] instanceof NetscriptPort) { + throw new Error("Cannot assign a Netscript Port handle to a new value"); + } return res[idx[idx.length-1]] = value; }, diff --git a/src/NetscriptEvaluator.js b/src/NetscriptEvaluator.js index b94de8423..93c3b5c95 100644 --- a/src/NetscriptEvaluator.js +++ b/src/NetscriptEvaluator.js @@ -3,12 +3,12 @@ import {CONSTANTS} from "./Constants.js"; import {Player} from "./Player.js"; import {Environment} from "./NetscriptEnvironment.js"; import {WorkerScript, addWorkerScript} from "./NetscriptWorker.js"; -import {Server} from "./Server.js"; +import {Server, getServer} from "./Server.js"; import {Settings} from "./Settings.js"; import {Script, findRunningScript, RunningScript} from "./Script.js"; -import {Node} from "../utils/acorn.js"; +import {parse, Node} from "../utils/acorn.js"; import {printArray} from "../utils/HelperFunctions.js"; import {isValidIPAddress} from "../utils/IPAddress.js"; import {isString} from "../utils/StringHelperFunctions.js"; @@ -31,7 +31,7 @@ function evaluate(exp, workerScript) { var env = workerScript.env; if (env.stopFlag) {return Promise.reject(workerScript);} if (exp == null) { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Error: NULL expression")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Error: NULL expression", exp)); } if (env.stopFlag) {return Promise.reject(workerScript);} switch (exp.type) { @@ -59,11 +59,11 @@ function evaluate(exp, workerScript) { case "Identifier": //Javascript constructor() method can be used as an exploit to run arbitrary code if (exp.name == "constructor") { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Illegal usage of constructor() method. If you have your own function named 'constructor', you must re-name it.")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Illegal usage of constructor() method. If you have your own function named 'constructor', you must re-name it.", exp)); } if (!(exp.name in env.vars)){ - return Promise.reject(makeRuntimeRejectMsg(workerScript, "variable " + exp.name + " not defined")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "variable " + exp.name + " not defined", exp)); } return Promise.resolve(env.get(exp.name)) break; @@ -135,7 +135,7 @@ function evaluate(exp, workerScript) { return Promise.reject(makeRuntimeRejectMsg(workerScript, e.toString())); } }); - } else if (exp.callee.type == "MemberExpression"){ + } else if (exp.callee.type === "MemberExpression"){ return evaluate(exp.callee.object, workerScript).then(function(object) { try { if (func === "NETSCRIPTFOREACH") { @@ -148,7 +148,7 @@ function evaluate(exp, workerScript) { var res = func.apply(object,args); return Promise.resolve(res); } catch (e) { - return Promise.reject(makeRuntimeRejectMsg(workerScript, e)); + return Promise.reject(makeRuntimeRejectMsg(workerScript, e, exp)); } }); } else { @@ -158,6 +158,11 @@ function evaluate(exp, workerScript) { return out.then(function(res) { return Promise.resolve(res) }).catch(function(e) { + if (isScriptErrorMessage(e)) { + //Functions don't have line number appended in error message, so add it + var num = getErrorLineNumber(exp, workerScript); + e += " (Line " + num + ")"; + } return Promise.reject(e); }); } else { @@ -165,9 +170,14 @@ function evaluate(exp, workerScript) { } } catch (e) { if (isScriptErrorMessage(e)) { + if (isScriptErrorMessage(e)) { + //Functions don't have line number appended in error message, so add it + var num = getErrorLineNumber(exp, workerScript); + e += " (Line " + num + ")"; + } return Promise.reject(e); } else { - return Promise.reject(makeRuntimeRejectMsg(workerScript, e)); + return Promise.reject(makeRuntimeRejectMsg(workerScript, e, exp)); } } } @@ -179,19 +189,19 @@ function evaluate(exp, workerScript) { if (exp.computed){ return evaluate(exp.property, workerScript).then(function(index) { if (index >= object.length) { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid index for arrays")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid index for arrays", exp)); } return Promise.resolve(object[index]); }).catch(function(e) { if (e instanceof WorkerScript || isScriptErrorMessage(e)) { return Promise.reject(e); } else { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid MemberExpression")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid MemberExpression", exp)); } }); } else { if (exp.property.name === "constructor") { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Illegal usage of constructor() method. If you have your own function named 'constructor', you must re-name it.")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Illegal usage of constructor() method. If you have your own function named 'constructor', you must re-name it.", exp)); } if (object != null && object instanceof Array && exp.property.name === "forEach") { return "NETSCRIPTFOREACH"; @@ -199,7 +209,7 @@ function evaluate(exp, workerScript) { try { return Promise.resolve(object[exp.property.name]) } catch (e) { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to get property: " + e.toString())); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to get property: " + e.toString(), exp)); } } }); @@ -235,14 +245,14 @@ function evaluate(exp, workerScript) { } switch (exp.operator){ default: - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Unrecognized token: " + exp.type + ". You are trying to use code that is currently unsupported")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Unrecognized token: " + exp.type + ". You are trying to use code that is currently unsupported", exp)); } return Promise.resolve(env.get(exp.argument.name)) } else { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "variable " + exp.argument.name + " not defined")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "variable " + exp.argument.name + " not defined", exp)); } } else { - return Promise.reject(makeRuntimeRejectMsg(workerScript, "argument must be an identifier")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "argument must be an identifier", exp)); } break; case "EmptyStatement": @@ -263,8 +273,7 @@ function evaluate(exp, workerScript) { return evaluateIf(exp, workerScript); break; case "SwitchStatement": - var lineNum = getErrorLineNumber(exp, workerScript); - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Switch statements are not yet implemented in Netscript (line " + (lineNum+1) + ")")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Switch statements are not yet implemented in Netscript", exp)); break; case "WhileStatement": return evaluateWhile(exp, workerScript).then(function(res) { @@ -297,13 +306,24 @@ function evaluate(exp, workerScript) { env.set(exp.id.name, exp); return Promise.resolve(true); } else { - var lineNum = getErrorLineNumber(exp, workerScript); - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid function declaration at line " + lineNum+1)); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid function declaration", exp)); } break; + case "ImportDeclaration": + return evaluateImport(exp, workerScript).then(function(res) { + return Promise.resolve(res); + }).catch(function(e) { + return Promise.reject(e); + }); + break; + case "ThrowStatement": + //return Promise.reject(makeRuntimeRejectMsg(workerScript)) + return evaluate(exp.argument, workerScript).then(function(res) { + return Promise.reject(makeRuntimeRejectMsg(workerScript, res)); + }); + break; default: - var lineNum = getErrorLineNumber(exp, workerScript); - return Promise.reject(makeRuntimeRejectMsg(workerScript, "Unrecognized token: " + exp.type + " (line " + (lineNum+1) + "). This is currently unsupported in Netscript")); + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Unrecognized token: " + exp.type + ". This is currently unsupported in Netscript", exp)); break; } //End switch }).catch(function(e) { @@ -438,6 +458,9 @@ function evalAssignment(exp, workerScript) { return evaluate(exp.right, workerScript).then(function(expRight) { if (exp.left.type == "MemberExpression") { + if (!exp.left.computed) { + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Cannot assign to an object's property. This is currently unsupported in Netscript", exp)); + } //Assign to array element //Array object designed by exp.left.object.name //Index designated by exp.left.property @@ -450,37 +473,38 @@ function evalAssignment(exp, workerScript) { var arrName = res.splice(1, 1); arrName = arrName[0]; - env.setArrayElement(arrName, res, expRight); - return Promise.resolve(false); + var res; + try { + res = env.setArrayElement(arrName, res, expRight); + } catch (e) { + return Promise.reject(makeRuntimeRejectMsg(workerScript, e)); + } + return Promise.resolve(res); }).catch(function(e) { return Promise.reject(e); }); } else { //Other assignments try { + var assign; switch (exp.operator) { case "=": - env.set(exp.left.name,expRight); - break; + assign = expRight; break; case "+=": - env.set(exp.left.name,env.get(exp.left.name) + expRight); - break; + assign = env.get(exp.left.name) + expRight; break; case "-=": - env.set(exp.left.name,env.get(exp.left.name) - expRight); - break; + assign = env.get(exp.left.name) - expRight; break; case "*=": - env.set(exp.left.name,env.get(exp.left.name) * expRight); - break; + assign = env.get(exp.left.name) * expRight; break; case "/=": - env.set(exp.left.name,env.get(exp.left.name) / expRight); - break; + assign = env.get(exp.left.name) / expRight; break; case "%=": - env.set(exp.left.name,env.get(exp.left.name) % expRight); - break; + assign = env.get(exp.left.name) % expRight; break; default: return Promise.reject(makeRuntimeRejectMsg(workerScript, "Bitwise assignment is not implemented")); } - return Promise.resolve(false); + env.set(exp.left.name, assign); + return Promise.resolve(assign); } catch (e) { return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to set environment variable: " + e.toString())); } @@ -637,14 +661,117 @@ function evaluateProg(exp, workerScript, index) { } } -function killNetscriptDelay(workerScript) { - /* - if (workerScript instanceof WorkerScript) { - if (workerScript.delay) { - workerScript.delay.cancel(); +function evaluateImport(exp, workerScript, checkingRam=false) { + //When its checking RAM, it exports an array of nodes for each imported function + var ramCheckRes = []; + + var env = workerScript.env; + if (env.stopFlag) { + if (checkingRam) {return ramCheckRes;} + return Promise.reject(workerScript); + } + + //Get source script and name of all functions to import + var scriptName = exp.source.value; + var namespace, namespaceObj, allFns = false, fnNames = []; + if (exp.specifiers.length === 1 && exp.specifiers[0].type === "ImportNamespaceSpecifier") { + allFns = true; + namespace = exp.specifiers[0].local.name; + } else { + for (var i = 0; i < exp.specifiers.length; ++i) { + fnNames.push(exp.specifiers[i].local.name); } } - */ + + //Get the code + var server = getServer(workerScript.serverIp), code = ""; + if (server == null) { + if (checkingRam) {return ramCheckRes;} + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to identify server. This is a bug please report to dev", exp)); + } + for (var i = 0; i < server.scripts.length; ++i) { + if (server.scripts[i].filename === scriptName) { + code = server.scripts[i].code; + break; + } + } + if (code === "") { + if (checkingRam) {return ramCheckRes;} + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Could not find script " + scriptName + " to import", exp)); + } + + //Create the AST + try { + var ast = parse(code, {sourceType:"module"}); + } catch(e) { + console.log("Failed to parse import script"); + if (checkingRam) {return ramCheckRes;} + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Failed to import functions from " + scriptName + + " This is most likely due to a syntax error in the imported script", exp)); + } + + if (allFns) { + //A namespace is implemented as a JS obj + env.set(namespace, {}); + namespaceObj = env.get(namespace); + } + + //Search through the AST for all imported functions + var queue = [ast]; + while (queue.length != 0) { + var node = queue.shift(); + switch (node.type) { + case "BlockStatement": + case "Program": + for (var i = 0; i < node.body.length; ++i) { + if (node.body[i] instanceof Node) { + queue.push(node.body[i]); + } + } + break; + case "FunctionDeclaration": + if (node.id && node.id.name) { + if (allFns) { + //Import all functions under this namespace + if (checkingRam) { + ramCheckRes.push(node); + } else { + namespaceObj[node.id.name] = node; + } + } else { + //Only import specified functions + if (fnNames.includes(node.id.name)) { + if (checkingRam) { + ramCheckRes.push(node); + } else { + env.set(node.id.name, node); + } + + } + } + } else { + if (checkingRam) {return ramCheckRes;} + return Promise.reject(makeRuntimeRejectMsg(workerScript, "Invalid function declaration in imported script " + scriptName, exp)); + } + break; + default: + break; + } + + for (var prop in node) { + if (node.hasOwnProperty(prop)) { + if (node[prop] instanceof Node) { + queue.push(node[prop]); + } + } + } + } + if (!checkingRam) {workerScript.scriptRef.log("Imported functions from " + scriptName);} + if (checkingRam) {return ramCheckRes;} + return Promise.resolve(true); +} + +function killNetscriptDelay(workerScript) { if (workerScript instanceof WorkerScript) { if (workerScript.delay) { clearTimeout(workerScript.delay); @@ -654,19 +781,6 @@ function killNetscriptDelay(workerScript) { } function netscriptDelay(time, workerScript) { - /* - workerScript.delay = new Promise(function(resolve, reject, onCancel) { - Promise.delay(time).then(function() { - resolve(); - workerScript.delay = null; - }); - onCancel(function() { - console.log("Cancelling and rejecting this Promise"); - reject(workerScript); - }) - }); - return workerScript.delay; - */ return new Promise(function(resolve, reject) { workerScript.delay = setTimeout(()=>{ workerScript.delay = null; @@ -676,41 +790,15 @@ function netscriptDelay(time, workerScript) { }); } -function makeRuntimeRejectMsg(workerScript, msg) { - return "|"+workerScript.serverIp+"|"+workerScript.name+"|" + msg; +function makeRuntimeRejectMsg(workerScript, msg, exp=null) { + var lineNum = ""; + if (exp != null) { + var num = getErrorLineNumber(exp, workerScript); + lineNum = " (Line " + num + ")" + } + return "|"+workerScript.serverIp+"|"+workerScript.name+"|" + msg + lineNum; } -/* -function apply_op(op, a, b) { - function num(x) { - if (typeof x != "number") - throw new Error("Expected number but got " + x); - return x; - } - function div(x) { - if (num(x) == 0) - throw new Error("Divide by zero"); - return x; - } - switch (op) { - case "+": return a + b; - case "-": return num(a) - num(b); - case "*": return num(a) * num(b); - case "/": return num(a) / div(b); - case "%": return num(a) % div(b); - case "&&": return a !== false && b; - case "||": return a !== false ? a : b; - case "<": return num(a) < num(b); - case ">": return num(a) > num(b); - case "<=": return num(a) <= num(b); - case ">=": return num(a) >= num(b); - case "==": return a === b; - case "!=": return a !== b; - } - throw new Error("Can't apply operator " + op); -} -*/ - //Run a script from inside a script using run() command function runScriptFromScript(server, scriptname, args, workerScript, threads=1) { //Check if the script is already running @@ -759,13 +847,16 @@ function runScriptFromScript(server, scriptname, args, workerScript, threads=1) return Promise.resolve(false); } -//Takes in a function getErrorLineNumber(exp, workerScript) { var code = workerScript.scriptRef.scriptRef.code; //Split code up to the start of the node - code = code.substring(0, exp.start); - return (code.match(/\n/g) || []).length; + try { + code = code.substring(0, exp.start); + return (code.match(/\n/g) || []).length + 1; + } catch(e) { + return -1; + } } function isScriptErrorMessage(msg) { @@ -838,4 +929,4 @@ export {makeRuntimeRejectMsg, netscriptDelay, runScriptFromScript, scriptCalculateHackingChance, scriptCalculateHackingTime, scriptCalculateExpGain, scriptCalculatePercentMoneyHacked, scriptCalculateGrowTime, scriptCalculateWeakenTime, evaluate, - isScriptErrorMessage, killNetscriptDelay}; + isScriptErrorMessage, killNetscriptDelay, evaluateImport}; diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 3cb247c73..1b1d17463 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -54,6 +54,7 @@ import {makeRuntimeRejectMsg, netscriptDelay, runScriptFromScript, scriptCalculateExpGain, scriptCalculatePercentMoneyHacked, scriptCalculateGrowTime, scriptCalculateWeakenTime} from "./NetscriptEvaluator.js"; import {Environment} from "./NetscriptEnvironment.js"; +import {NetscriptPort} from "./NetscriptPort.js"; import Decimal from '../utils/decimal.js'; import {dialogBoxCreate} from "../utils/DialogBox.js"; @@ -99,6 +100,7 @@ function NetscriptFunctions(workerScript) { return { Math : Math, Date : Date, + Number : Number, hacknetnodes : Player.hacknetNodes, sprintf : sprintf, vsprintf: vsprintf, @@ -614,7 +616,7 @@ function NetscriptFunctions(workerScript) { return CONSTANTS.ScriptSpawnRamCost; } } - if (scriptname == null || threads == 1) { + if (scriptname == null || threads == null) { throw makeRuntimeRejectMsg(workerScript, "Invalid scriptname or numThreads argument passed to spawn()"); } setTimeout(()=>{ @@ -665,7 +667,7 @@ function NetscriptFunctions(workerScript) { return false; } }, - killall : function(ip){ + killall : function(ip=workerScript.serverIp){ if (workerScript.checkingRam) { if (workerScript.loadedFns.killall) { return 0; @@ -1601,7 +1603,7 @@ function NetscriptFunctions(workerScript) { } } var hostnameStr = String(hostname); - hostnameStr = hostnameStr.replace(/\s\s+/g, ''); + hostnameStr = hostnameStr.replace(/\s+/g, ''); if (hostnameStr == "") { workerScript.scriptRef.log("Error: Passed empty string for hostname argument of purchaseServer()"); return ""; @@ -1744,20 +1746,15 @@ function NetscriptFunctions(workerScript) { } if (!isNaN(port)) { //Write to port //Port 1-10 - if (port < 1 || port > 10) { - throw makeRuntimeRejectMsg(workerScript, "ERR: Trying to write to invalid port: " + port + ". Only ports 1-10 are valid."); + port = Math.round(port); + if (port < 1 || port > CONSTANTS.NumNetscriptPorts) { + throw makeRuntimeRejectMsg(workerScript, "ERR: Trying to write to invalid port: " + port + ". Only ports 1-" + CONSTANTS.NumNetscriptPorts + " are valid."); } - var portName = "Port" + String(port); - var port = NetscriptPorts[portName]; - if (port == null) { + var port = NetscriptPorts[port-1]; + if (port == null || !(port instanceof NetscriptPort)) { throw makeRuntimeRejectMsg(workerScript, "Could not find port: " + port + ". This is a bug contact the game developer"); } - port.push(data); - if (port.length > Settings.MaxPortCapacity) { - port.shift(); - return true; - } - return false; + return port.write(data); } else if (isString(port)) { //Write to text file var fn = port; var server = getServer(workerScript.serverIp); @@ -1790,19 +1787,15 @@ function NetscriptFunctions(workerScript) { } if (!isNaN(port)) { //Read from port //Port 1-10 - if (port < 1 || port > 10) { - throw makeRuntimeRejectMsg(workerScript, "ERR: Trying to read from invalid port: " + port + ". Only ports 1-10 are valid."); + port = Math.round(port); + if (port < 1 || port > CONSTANTS.NumNetscriptPorts) { + throw makeRuntimeRejectMsg(workerScript, "ERR: Trying to read from invalid port: " + port + ". Only ports 1-" + CONSTANTS.NumNetscriptPorts + " are valid."); } - var portName = "Port" + String(port); - var port = NetscriptPorts[portName]; - if (port == null) { + var port = NetscriptPorts[port-1]; + if (port == null || !(port instanceof NetscriptPort)) { throw makeRuntimeRejectMsg(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); } - if (port.length === 0) { - return "NULL PORT DATA"; - } else { - return port.shift(); - } + return port.read(); } else if (isString(port)) { //Read from text file var fn = port; var server = getServer(workerScript.serverIp); @@ -1828,20 +1821,18 @@ function NetscriptFunctions(workerScript) { return CONSTANTS.ScriptReadWriteRamCost; } } - if (isNaN(port) || port < 1 || port > 10) { - throw makeRuntimeRejectMsg(workerScript, "ERR: peek() called with invalid argument. Must be a port number between 1 and 10"); + if (isNaN(port)) { + throw makeRuntimeRejectMsg(workerScript, "ERR: peek() called with invalid argument. Must be a port number between 1 and " + CONSTANTS.NumNetscriptPorts); } - var portName = "Port" + String(port); - var port = NetscriptPorts[portName]; - if (port == null) { + port = Math.round(port); + if (port < 1 || port > CONSTANTS.NumNetscriptPorts) { + throw makeRuntimeRejectMsg(workerScript, "ERR: peek() called with invalid argument. Must be a port number between 1 and " + CONSTANTS.NumNetscriptPorts); + } + var port = NetscriptPorts[port-1]; + if (port == null || !(port instanceof NetscriptPort)) { throw makeRuntimeRejectMsg(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); } - if (port.length === 0) { - return "NULL PORT DATA"; - } else { - var foo = port.slice(); - return foo[0]; - } + return port.peek(); }, clear : function(port) { if (workerScript.checkingRam) { @@ -1853,15 +1844,15 @@ function NetscriptFunctions(workerScript) { } } if (!isNaN(port)) { //Clear port - if (port < 1 || port > 10) { - throw makeRuntimeRejectMsg(workerScript, "ERR: Trying to read from invalid port: " + port + ". Only ports 1-10 are valid"); + port = Math.round(port); + if (port < 1 || port > CONSTANTS.NumNetscriptPorts) { + throw makeRuntimeRejectMsg(workerScript, "ERR: Trying to clear invalid port: " + port + ". Only ports 1-" + CONSTANTS.NumNetscriptPorts + " are valid"); } - var portName = "Port" + String(port); - var port = NetscriptPorts[portName]; - if (port == null) { + var port = NetscriptPorts[port-1]; + if (port == null || !(port instanceof NetscriptPort)) { throw makeRuntimeRejectMsg(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); } - port.length = 0; + return port.clear(); } else if (isString(port)) { //Clear text file var fn = port; var server = getServer(workerScript.serverIp); @@ -1877,6 +1868,28 @@ function NetscriptFunctions(workerScript) { } return 0; }, + getPortHandle : function(port) { + if (workerScript.checkingRam) { + if (workerScript.loadedFns.getPortHandle) { + return 0; + } else { + workerScript.loadedFns.getPortHandle = true; + return CONSTANTS.ScriptReadWriteRamCost * 10; + } + } + if (isNaN(port)) { + throw makeRuntimeRejectMsg(workerScript, "ERR: Invalid argument passed into getPortHandle(). Must be an integer between 1 and " + CONSTANTS.NumNetscriptPorts); + } + port = Math.round(port); + if (port < 1 || port > CONSTANTS.NumNetscriptPorts) { + throw makeRuntimeRejectMsg(workerScript, "ERR: getPortHandle() called with invalid port number: " + port + ". Only ports 1-" + CONSTANTS.NumNetscriptPorts + " are valid"); + } + var port = NetscriptPorts[port-1]; + if (port == null || !(port instanceof NetscriptPort)) { + throw makeRuntimeRejectMsg(workerScript, "ERR: Could not find port: " + port + ". This is a bug contact the game developer"); + } + return port; + }, rm : function(fn) { if (workerScript.checkingRam) { if (workerScript.loadedFns.rm) { @@ -2153,7 +2166,7 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.universityCourse = true; var ramCost = CONSTANTS.ScriptSingularityFn1RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2246,7 +2259,7 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.gymWorkout = true; var ramCost = CONSTANTS.ScriptSingularityFn1RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2351,8 +2364,8 @@ function NetscriptFunctions(workerScript) { return 0; } else { workerScript.loadedFns.travelToCity = true; - var ramCost = CONSTANTS.ScriptSingularityFn1RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + var ramCost = CONSTANTS.ScriptSingularityFn1RamCost / 2; + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2390,7 +2403,7 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.purchaseTor = true; var ramCost = CONSTANTS.ScriptSingularityFn1RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2433,7 +2446,7 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.purchaseProgram = true; var ramCost = CONSTANTS.ScriptSingularityFn1RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2553,8 +2566,8 @@ function NetscriptFunctions(workerScript) { return 0; } else { workerScript.loadedFns.getStats = true; - var ramCost = CONSTANTS.ScriptSingularityFn1RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + var ramCost = CONSTANTS.ScriptSingularityFn1RamCost / 4; + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2575,14 +2588,55 @@ function NetscriptFunctions(workerScript) { intelligence: Player.intelligence } }, + getCharacterInformation : function() { + if (workerScript.checkingRam) { + if (workerScript.loadedFns.getCharacterInformation) { + return 0; + } else { + workerScript.loadedFns.getCharacterInformation = true; + var ramCost = CONSTANTS.ScriptSingularityFn1RamCost / 4; + if (Player.bitNodeN !== 4) {ramCost *= 8;} + return ramCost; + } + } + + if (Player.bitNodeN != 4) { + if (!(hasSingularitySF && singularitySFLvl >= 1)) { + throw makeRuntimeRejectMsg(workerScript, "Cannot run getCharacterInformation(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + return {}; + } + } + + var companyPositionTitle = ""; + if (Player.companyPosition instanceof CompanyPosition) { + companyPositionTitle = Player.companyPosition.positionName; + } + return { + bitnode: Player.bitNodeN, + company: Player.companyName, + jobTitle: companyPositionTitle, + city: Player.city, + factions: Player.factions.slice(), + tor: SpecialServerIps.hasOwnProperty("Darkweb Server"), + timeWorked: Player.timeWorked, + workHackExpGain: Player.workHackExpGained, + workStrExpGain: Player.workStrExpGained, + workDefExpGain: Player.workDefExpGained, + workDexExpGain: Player.workDexExpGained, + workAgiExpGain: Player.workAgiExpGained, + workChaExpGain: Player.workChaExpGained, + workRepGain: Player.workRepGained, + workMoneyGain: Player.workMoneyGained, + }; + }, isBusy : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.isBusy) { return 0; } else { workerScript.loadedFns.isBusy = true; - var ramCost = CONSTANTS.ScriptSingularityFn1RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + var ramCost = CONSTANTS.ScriptSingularityFn1RamCost / 4; + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2600,11 +2654,17 @@ function NetscriptFunctions(workerScript) { return 0; } else { workerScript.loadedFns.stopAction = true; - var ramCost = CONSTANTS.ScriptSingularityFn1RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + var ramCost = CONSTANTS.ScriptSingularityFn1RamCost / 2; + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } + if (Player.bitNodeN != 4) { + if (!(hasSingularitySF && singularitySFLvl >= 1)) { + throw makeRuntimeRejectMsg(workerScript, "Cannot run stopAction(). It is a Singularity Function and requires SourceFile-4 (level 1) to run."); + return false; + } + } if (Player.isWorking) { var txt = Player.singularityStopWork(); if (workerScript.disableLogs.ALL == null && workerScript.disableLogs.stopAction == null) { @@ -2614,14 +2674,14 @@ function NetscriptFunctions(workerScript) { } return false; }, - upgradeHomeRam() { + upgradeHomeRam : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.upgradeHomeRam) { return 0; } else { workerScript.loadedFns.upgradeHomeRam = true; var ramCost = CONSTANTS.ScriptSingularityFn2RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2658,14 +2718,14 @@ function NetscriptFunctions(workerScript) { } return true; }, - getUpgradeHomeRamCost() { + getUpgradeHomeRamCost : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.getUpgradeHomeRamCost) { return 0; } else { workerScript.loadedFns.getUpgradeHomeRamCost = true; - var ramCost = CONSTANTS.ScriptSingularityFn2RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + var ramCost = CONSTANTS.ScriptSingularityFn2RamCost / 2; + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2686,14 +2746,14 @@ function NetscriptFunctions(workerScript) { var mult = Math.pow(1.55, numUpgrades); return cost * mult; }, - workForCompany() { + workForCompany : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.workForCompany) { return 0; } else { workerScript.loadedFns.workForCompany = true; var ramCost = CONSTANTS.ScriptSingularityFn2RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2731,14 +2791,14 @@ function NetscriptFunctions(workerScript) { } return true; }, - applyToCompany(companyName, field) { + applyToCompany : function(companyName, field) { if (workerScript.checkingRam) { if (workerScript.loadedFns.applyToCompany) { return 0; } else { workerScript.loadedFns.applyToCompany = true; var ramCost = CONSTANTS.ScriptSingularityFn2RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2816,14 +2876,14 @@ function NetscriptFunctions(workerScript) { } return res; }, - getCompanyRep(companyName) { + getCompanyRep : function(companyName) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getCompanyRep) { return 0; } else { workerScript.loadedFns.getCompanyRep = true; - var ramCost = CONSTANTS.ScriptSingularityFn2RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + var ramCost = CONSTANTS.ScriptSingularityFn2RamCost / 4; + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2841,14 +2901,39 @@ function NetscriptFunctions(workerScript) { } return company.playerReputation; }, - checkFactionInvitations() { + getCompanyFavor : function(companyName) { + if (workerScript.checkingRam) { + if (workerScript.loadedFns.getCompanyFavor) { + return 0; + } else { + workerScript.loadedFns.getCompanyFavor = true; + var ramCost = CONSTANTS.ScriptSingularityFn2RamCost / 4; + if (Player.bitNodeN !== 4) {ramCost *= 8;} + return ramCost; + } + } + if (Player.bitNodeN != 4) { + if (!(hasSingularitySF && singularitySFLvl >= 2)) { + throw makeRuntimeRejectMsg(workerScript, "Cannot run getCompanyFavor(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + return false; + } + } + + var company = Companies[companyName]; + if (company == null || !(company instanceof Company)) { + workerScript.scriptRef.log("ERROR: Invalid companyName passed into getCompanyFavor(): " + companyName); + return -1; + } + return company.favor; + }, + checkFactionInvitations : function() { if (workerScript.checkingRam) { if (workerScript.loadedFns.checkFactionInvitations) { return 0; } else { workerScript.loadedFns.checkFactionInvitations = true; var ramCost = CONSTANTS.ScriptSingularityFn2RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2861,14 +2946,14 @@ function NetscriptFunctions(workerScript) { //Make a copy of Player.factionInvitations return Player.factionInvitations.slice(); }, - joinFaction(name) { + joinFaction : function(name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.joinFaction) { return 0; } else { workerScript.loadedFns.joinFaction = true; var ramCost = CONSTANTS.ScriptSingularityFn2RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -2904,14 +2989,14 @@ function NetscriptFunctions(workerScript) { } return true; }, - workForFaction(name, type) { + workForFaction : function(name, type) { if (workerScript.checkingRam) { if (workerScript.loadedFns.workForFaction) { return 0; } else { workerScript.loadedFns.workForFaction = true; var ramCost = CONSTANTS.ScriptSingularityFn2RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -3002,14 +3087,14 @@ function NetscriptFunctions(workerScript) { } return true; }, - getFactionRep(name) { + getFactionRep : function(name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getFactionRep) { return 0; } else { workerScript.loadedFns.getFactionRep = true; - var ramCost = CONSTANTS.ScriptSingularityFn2RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + var ramCost = CONSTANTS.ScriptSingularityFn2RamCost / 4; + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -3027,14 +3112,39 @@ function NetscriptFunctions(workerScript) { return Factions[name].playerReputation; }, - createProgram(name) { + getFactionFavor : function(name) { + if (workerScript.checkingRam) { + if (workerScript.loadedFns.getFactionFavor) { + return 0; + } else { + workerScript.loadedFns.getFactionFavor = true; + var ramCost = CONSTANTS.ScriptSingularityFn2RamCost / 4; + if (Player.bitNodeN !== 4) {ramCost *= 8;} + return ramCost; + } + } + if (Player.bitNodeN != 4) { + if (!(hasSingularitySF && singularitySFLvl >= 2)) { + throw makeRuntimeRejectMsg(workerScript, "Cannot run getFactionFavor(). It is a Singularity Function and requires SourceFile-4 (level 2) to run."); + return -1; + } + } + + if (!factionExists(name)) { + workerScript.scriptRef.log("ERROR: Faction specified in getFactionFavor() does not exist."); + return -1; + } + + return Factions[name].favor; + }, + createProgram : function(name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.createProgram) { return 0; } else { workerScript.loadedFns.createProgram = true; var ramCost = CONSTANTS.ScriptSingularityFn3RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -3136,7 +3246,7 @@ function NetscriptFunctions(workerScript) { } else { workerScript.loadedFns.commitCrime = true; var ramCost = CONSTANTS.ScriptSingularityFn3RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -3222,14 +3332,14 @@ function NetscriptFunctions(workerScript) { throw makeRuntimeRejectMsg(workerScript, "Invalid crime passed into commitCrime(): " + crime); } }, - getCrimeChance(crime) { + getCrimeChance : function(crime) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getCrimeChance) { return 0; } else { workerScript.loadedFns.getCrimeChance = true; var ramCost = CONSTANTS.ScriptSingularityFn3RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -3269,14 +3379,14 @@ function NetscriptFunctions(workerScript) { throw makeRuntimeRejectMsg(workerScript, "Invalid crime passed into getCrimeChance(): " + crime); } }, - getOwnedAugmentations(purchased=false) { + getOwnedAugmentations : function(purchased=false) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getOwnedAugmentations) { return 0; } else { workerScript.loadedFns.getOwnedAugmentations = true; var ramCost = CONSTANTS.ScriptSingularityFn3RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -3297,14 +3407,14 @@ function NetscriptFunctions(workerScript) { } return res; }, - getAugmentationsFromFaction(facname) { + getAugmentationsFromFaction : function(facname) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getAugmentationsFromFaction) { return 0; } else { workerScript.loadedFns.getAugmentationsFromFaction = true; var ramCost = CONSTANTS.ScriptSingularityFn3RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -3327,14 +3437,14 @@ function NetscriptFunctions(workerScript) { } return res; }, - getAugmentationCost(name) { + getAugmentationCost : function(name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.getAugmentationCost) { return 0; } else { workerScript.loadedFns.getAugmentationCost = true; var ramCost = CONSTANTS.ScriptSingularityFn3RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -3353,14 +3463,14 @@ function NetscriptFunctions(workerScript) { var aug = Augmentations[name]; return [aug.baseRepRequirement, aug.baseCost]; }, - purchaseAugmentation(faction, name) { + purchaseAugmentation : function(faction, name) { if (workerScript.checkingRam) { if (workerScript.loadedFns.purchaseAugmentation) { return 0; } else { workerScript.loadedFns.purchaseAugmentation = true; var ramCost = CONSTANTS.ScriptSingularityFn3RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } @@ -3422,14 +3532,14 @@ function NetscriptFunctions(workerScript) { return false; } }, - installAugmentations(cbScript) { + installAugmentations : function(cbScript) { if (workerScript.checkingRam) { if (workerScript.loadedFns.installAugmentations) { return 0; } else { workerScript.loadedFns.installAugmentations = true; var ramCost = CONSTANTS.ScriptSingularityFn3RamCost; - if (Player.bitNodeN !== 4) {ramCost *= 10;} + if (Player.bitNodeN !== 4) {ramCost *= 8;} return ramCost; } } diff --git a/src/NetscriptPort.js b/src/NetscriptPort.js new file mode 100644 index 000000000..23ec2f109 --- /dev/null +++ b/src/NetscriptPort.js @@ -0,0 +1,51 @@ +import {Settings} from "./Settings.js"; + +function NetscriptPort() { + this.data = []; +} + +NetscriptPort.prototype.write = function(data) { + this.data.push(data); + if (this.data.length > Settings.MaxPortCapacity) { + return this.data.shift(); + } + return null; +} + +NetscriptPort.prototype.tryWrite = function(data) { + if (this.data.length >= Settings.MaxPortCapacity) { + return false; + } + this.data.push(data); + return true; +} + +NetscriptPort.prototype.read = function() { + if (this.data.length === 0) { + return "NULL PORT DATA"; + } + return this.data.shift(); +} + +NetscriptPort.prototype.peek = function() { + if (this.data.length === 0) { + return "NULL PORT DATA"; + } else { + var foo = this.data.slice(); + return foo[0]; + } +} + +NetscriptPort.prototype.full = function() { + return this.data.length == Settings.MaxPortCapacity; +} + +NetscriptPort.prototype.empty = function() { + return this.data.length === 0; +} + +NetscriptPort.prototype.clear = function() { + this.data.length = 0; +} + +export {NetscriptPort}; diff --git a/src/NetscriptWorker.js b/src/NetscriptWorker.js index 0729f0304..61b31c34f 100644 --- a/src/NetscriptWorker.js +++ b/src/NetscriptWorker.js @@ -6,6 +6,7 @@ import {Engine} from "./engine.js"; import {Environment} from "./NetscriptEnvironment.js"; import {evaluate, isScriptErrorMessage, killNetscriptDelay} from "./NetscriptEvaluator.js"; +import {NetscriptPort} from "./NetscriptPort.js"; import {AllServers} from "./Server.js"; import {Settings} from "./Settings.js"; @@ -40,17 +41,9 @@ WorkerScript.prototype.getServer = function() { //Array containing all scripts that are running across all servers, to easily run them all let workerScripts = []; -let NetscriptPorts = { - Port1: [], - Port2: [], - Port3: [], - Port4: [], - Port5: [], - Port6: [], - Port7: [], - Port8: [], - Port9: [], - Port10: [], +var NetscriptPorts = []; +for (var i = 0; i < CONSTANTS.NumNetscriptPorts; ++i) { + NetscriptPorts.push(new NetscriptPort()); } function prestigeWorkerScripts() { @@ -95,8 +88,8 @@ function runScriptsLoop() { //If it isn't running, start the script if (workerScripts[i].running == false && workerScripts[i].env.stopFlag == false) { try { - var ast = parse(workerScripts[i].code); - //console.log(ast); + var ast = parse(workerScripts[i].code, {sourceType:"module"}); + console.log(ast); } catch (e) { console.log("Error parsing script: " + workerScripts[i].name); dialogBoxCreate("Syntax ERROR in " + workerScripts[i].name + ":
    " + e); @@ -168,9 +161,12 @@ function killWorkerScript(runningScriptObj, serverIp) { compareArrays(workerScripts[i].args, runningScriptObj.args)) { workerScripts[i].env.stopFlag = true; killNetscriptDelay(workerScripts[i]); - if (workerScripts[i].fnWorker) { - workerScripts[i].fnWorker.env.stopFlag = true; - killNetscriptDelay(workerScripts[i].fnWorker); + //Recursively kill all functions + var curr = workerScripts[i]; + while (curr.fnWorker) { + curr.fnWorker.env.stopFlag = true; + killNetscriptDelay(curr.fnWorker); + curr = curr.fnWorker; } return true; } diff --git a/src/Player.js b/src/Player.js index 86ed0cd46..6d758c4ba 100644 --- a/src/Player.js +++ b/src/Player.js @@ -48,9 +48,9 @@ function PlayerObject() { this.intelligence = 0; //Hacking multipliers - this.hacking_chance_mult = 1; //Increase through ascensions/augmentations - this.hacking_speed_mult = 1; //Decrease through ascensions/augmentations - this.hacking_money_mult = 1; //Increase through ascensions/augmentations. Can't go above 1 + this.hacking_chance_mult = 1; + this.hacking_speed_mult = 1; + this.hacking_money_mult = 1; this.hacking_grow_mult = 1; //Experience and multipliers @@ -692,11 +692,10 @@ PlayerObject.prototype.finishWork = function(cancelled, sing=false) { var mainMenu = document.getElementById("mainmenu-container"); mainMenu.style.visibility = "visible"; this.isWorking = false; - //Engine.loadTerminalContent(); Engine.loadLocationContent(); if (sing) { - return "You worked a short shift of " + convertTimeMsToTimeElapsedString(this.timeWorked) + " and " + + var res = "You worked a short shift of " + convertTimeMsToTimeElapsedString(this.timeWorked) + " and " + "earned $" + formatNumber(this.workMoneyGained, 2) + ", " + formatNumber(this.workRepGained, 4) + " reputation, " + formatNumber(this.workHackExpGained, 4) + " hacking exp, " + @@ -705,7 +704,10 @@ PlayerObject.prototype.finishWork = function(cancelled, sing=false) { formatNumber(this.workDexExpGained, 4) + " dexterity exp, " + formatNumber(this.workAgiExpGained, 4) + " agility exp, and " + formatNumber(this.workChaExpGained, 4) + " charisma exp."; + this.resetWorkStatus(); + return res; } + this.resetWorkStatus(); } PlayerObject.prototype.startWork = function() { @@ -767,9 +769,17 @@ PlayerObject.prototype.work = function(numCycles) { return; } + var comp = Companies[this.companyName], companyRep = "0"; + if (comp == null || !(comp instanceof Company)) { + console.log("ERROR: Could not find Company: " + this.companyName); + } else { + companyRep = comp.playerReputation; + } + var txt = document.getElementById("work-in-progress-text"); txt.innerHTML = "You are currently working as a " + this.companyPosition.positionName + - " at " + this.companyName + "

    " + + " at " + this.companyName + " (Current Company Reputation: " + + formatNumber(companyRep, 0) + ")

    " + "You have been working for " + convertTimeMsToTimeElapsedString(this.timeWorked) + "

    " + "You have earned:

    " + "$" + formatNumber(this.workMoneyGained, 2) + " ($" + formatNumber(this.workMoneyGainRate * cyclesPerSec, 2) + " / sec)

    " + @@ -886,10 +896,9 @@ PlayerObject.prototype.finishWorkPartTime = function(sing=false) { var mainMenu = document.getElementById("mainmenu-container"); mainMenu.style.visibility = "visible"; this.isWorking = false; - //Engine.loadTerminalContent(); Engine.loadLocationContent(); if (sing) { - return "You worked for " + convertTimeMsToTimeElapsedString(this.timeWorked) + " and " + + var res = "You worked for " + convertTimeMsToTimeElapsedString(this.timeWorked) + " and " + "earned a total of " + "$" + formatNumber(this.workMoneyGained, 2) + ", " + formatNumber(this.workRepGained, 4) + " reputation, " + @@ -899,7 +908,10 @@ PlayerObject.prototype.finishWorkPartTime = function(sing=false) { formatNumber(this.workDexExpGained, 4) + " dexterity exp, " + formatNumber(this.workAgiExpGained, 4) + " agility exp, and " + formatNumber(this.workChaExpGained, 4) + " charisma exp"; + this.resetWorkStatus(); + return res; } + this.resetWorkStatus(); } /* Working for Faction */ @@ -930,11 +942,10 @@ PlayerObject.prototype.finishFactionWork = function(cancelled, sing=false) { this.isWorking = false; - //Engine.loadTerminalContent(); Engine.loadFactionContent(); displayFactionContent(faction.name); if (sing) { - return "You worked for your faction " + faction.name + " for a total of " + convertTimeMsToTimeElapsedString(this.timeWorked) + ". " + + var res="You worked for your faction " + faction.name + " for a total of " + convertTimeMsToTimeElapsedString(this.timeWorked) + ". " + "You earned " + formatNumber(this.workRepGained, 4) + " rep, " + formatNumber(this.workHackExpGained, 4) + " hacking exp, " + @@ -943,7 +954,10 @@ PlayerObject.prototype.finishFactionWork = function(cancelled, sing=false) { formatNumber(this.workDexExpGained, 4) + " dex exp, " + formatNumber(this.workAgiExpGained, 4) + " agi exp, and " + formatNumber(this.workChaExpGained, 4) + " cha exp."; + this.resetWorkStatus(); + return res; } + this.resetWorkStatus(); } PlayerObject.prototype.startFactionWork = function(faction) { @@ -1261,6 +1275,7 @@ PlayerObject.prototype.finishCreateProgramWork = function(cancelled, sing=false) this.isWorking = false; Engine.loadTerminalContent(); + this.resetWorkStatus(); } /* Studying/Taking Classes */ @@ -1415,8 +1430,8 @@ PlayerObject.prototype.finishClass = function(sing=false) { this.isWorking = false; Engine.loadLocationContent(); - - if (sing) {return "After " + this.className + " for " + convertTimeMsToTimeElapsedString(this.timeWorked) + ", " + + if (sing) { + var res="After " + this.className + " for " + convertTimeMsToTimeElapsedString(this.timeWorked) + ", " + "you spent a total of $" + formatNumber(this.workMoneyGained * -1, 2) + ". " + "You earned a total of: " + formatNumber(this.workHackExpGained, 3) + " hacking exp, " + @@ -1424,7 +1439,11 @@ PlayerObject.prototype.finishClass = function(sing=false) { formatNumber(this.workDefExpGained, 3) + " defense exp, " + formatNumber(this.workDexExpGained, 3) + " dexterity exp, " + formatNumber(this.workAgiExpGained, 3) + " agility exp, and " + - formatNumber(this.workChaExpGained, 3) + " charisma exp";} + formatNumber(this.workChaExpGained, 3) + " charisma exp"; + this.resetWorkStatus(); + return res; + } + this.resetWorkStatus(); } //The EXP and $ gains are hardcoded. Time is in ms @@ -1598,6 +1617,7 @@ PlayerObject.prototype.finishCrime = function(cancelled) { var mainMenu = document.getElementById("mainmenu-container"); mainMenu.style.visibility = "visible"; this.isWorking = false; + this.resetWorkStatus(); Engine.loadLocationContent(); } diff --git a/src/Script.js b/src/Script.js index 1d41da160..eff060dd0 100644 --- a/src/Script.js +++ b/src/Script.js @@ -17,6 +17,7 @@ import {CONSTANTS} from "./Constants.js"; import {Engine} from "./engine.js"; import {iTutorialSteps, iTutorialNextStep, iTutorialIsRunning, currITutorialStep} from "./InteractiveTutorial.js"; +import {evaluateImport} from "./NetscriptEvaluator.js"; import {NetscriptFunctions} from "./NetscriptFunctions.js"; import {addWorkerScript, killWorkerScript, WorkerScript} from "./NetscriptWorker.js"; @@ -96,19 +97,47 @@ function scriptEditorInit() { /* Script editor options */ //Theme var themeDropdown = document.getElementById("script-editor-option-theme"); - themeDropdown.selectedIndex = 2; + if (Settings.EditorTheme) { + var initialIndex = 2; + for (var i = 0; i < themeDropdown.options.length; ++i) { + if (themeDropdown.options[i].value === Settings.EditorTheme) { + initialIndex = i; + break; + } + } + themeDropdown.selectedIndex = initialIndex; + } else { + themeDropdown.selectedIndex = 2; + } + themeDropdown.onchange = function() { var val = themeDropdown.value; + Settings.EditorTheme = val; var themePath = "ace/theme/" + val.toLowerCase(); editor.setTheme(themePath); }; + themeDropdown.onchange(); //Keybinding var keybindingDropdown = document.getElementById("script-editor-option-keybinding"); + if (Settings.EditorKeybinding) { + var initialIndex = 0; + for (var i = 0; i < keybindingDropdown.options.length; ++i) { + if (keybindingDropdown.options[i].value === Settings.EditorKeybinding) { + initialIndex = i; + break; + } + } + keybindingDropdown.selectedIndex = initialIndex; + } else { + keybindingDropdown.selectedIndex = 0; + } keybindingDropdown.onchange = function() { var val = keybindingDropdown.value; + Settings.EditorKeybinding = val; editor.setKeyboardHandler(keybindings[val.toLowerCase()]); }; + keybindingDropdown.onchange(); //Highlight Active line var highlightActiveChkBox = document.getElementById("script-editor-option-highlightactiveline"); @@ -174,7 +203,6 @@ function scriptEditorInit() { } editor.completers = [autocompleter]; } -document.addEventListener("DOMContentLoaded", scriptEditorInit, false); //Updates RAM usage in script function updateScriptEditorContent() { @@ -188,6 +216,8 @@ function updateScriptEditorContent() { var ramUsage = calculateRamUsage(codeCopy); if (ramUsage !== -1) { scriptEditorRamText.innerText = "RAM: " + formatNumber(ramUsage, 2).toString() + "GB"; + } else { + scriptEditorRamText.innerText = "RAM: Syntax Error"; } } @@ -295,15 +325,17 @@ Script.prototype.updateRamUsage = function() { function calculateRamUsage(codeCopy) { //Create a temporary/mock WorkerScript and an AST from the code + var currServ = Player.getCurrentServer(); var workerScript = new WorkerScript({ filename:"foo", scriptRef: {code:""}, args:[] }); workerScript.checkingRam = true; //Netscript functions will return RAM usage + workerScript.serverIp = currServ.ip; try { - var ast = parse(codeCopy); + var ast = parse(codeCopy, {sourceType:"module"}); } catch(e) { return -1; } @@ -315,6 +347,14 @@ function calculateRamUsage(codeCopy) { while (queue.length != 0) { var exp = queue.shift(); switch (exp.type) { + case "ImportDeclaration": + //Gets an array of all imported functions as AST expressions + //and pushes them on the queue. + var res = evaluateImport(exp, workerScript, true); + for (var i = 0; i < res.length; ++i) { + queue.push(res[i]); + } + break; case "BlockStatement": case "Program": for (var i = 0; i < exp.body.length; ++i) { @@ -659,4 +699,4 @@ AllServersMap.fromJSON = function(value) { Reviver.constructors.AllServersMap = AllServersMap; export {updateScriptEditorContent, loadAllRunningScripts, findRunningScript, - RunningScript, Script, AllServersMap}; + RunningScript, Script, AllServersMap, scriptEditorInit}; diff --git a/src/Server.js b/src/Server.js index 24f42c7eb..683ea4f01 100644 --- a/src/Server.js +++ b/src/Server.js @@ -75,7 +75,7 @@ function Server(ip=createRandomIp(), hostname="", organizationName="", Server.prototype.setHackingParameters = function(requiredHackingSkill, moneyAvailable, hackDifficulty, serverGrowth) { this.requiredHackingSkill = requiredHackingSkill; if (isNaN(moneyAvailable)) { - this.moneyAvailable = 1000000; + this.moneyAvailable = 1e6; } else { this.moneyAvailable = moneyAvailable * BitNodeMultipliers.ServerStartingMoney; } diff --git a/src/Settings.js b/src/Settings.js index 69ef2751f..4210fd443 100644 --- a/src/Settings.js +++ b/src/Settings.js @@ -11,6 +11,8 @@ let Settings = { ThemeHighlightColor: "#ffffff", ThemeFontColor: "#66ff33", ThemeBackgroundColor: "#000000", + EditorTheme: "Monokai", + EditorKeybinding: "ace", } function loadSettings(saveString) { diff --git a/src/Terminal.js b/src/Terminal.js index 2f74ec1ff..30d004fe3 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -434,9 +434,9 @@ let Terminal = { ''; var hdr = document.getElementById("terminal-input-header"); hdr.style.display = "inline"; - var lineWidth = document.getElementById("terminal-input-td").offsetWidth; - var width = lineWidth - hdr.offsetWidth - 10; - document.getElementById("terminal-input-text-box").style.width = width + "px"; + //var lineWidth = document.getElementById("terminal-input-td").offsetWidth; + //var width = lineWidth - hdr.offsetWidth - 10; + //document.getElementById("terminal-input-text-box").style.width = width + "px"; }, //Complete the hack/analyze command diff --git a/src/TextFile.js b/src/TextFile.js index d05cc1ef8..711bc2422 100644 --- a/src/TextFile.js +++ b/src/TextFile.js @@ -5,6 +5,7 @@ import {Reviver, Generic_toJSON, function TextFile(fn="", txt="") { this.fn = fn.endsWith(".txt") ? fn : fn + ".txt"; + this.fn = this.fn.replace(/\s+/g, ''); this.text = String(txt); } diff --git a/src/engine.js b/src/engine.js index e5dcbd71c..9adaa83ab 100644 --- a/src/engine.js +++ b/src/engine.js @@ -42,7 +42,7 @@ import {prestigeAugmentation, prestigeSourceFile} from "./Prestige.js"; import {redPillFlag} from "./RedPill.js"; import {saveObject, loadGame} from "./SaveObject.js"; -import {loadAllRunningScripts, +import {loadAllRunningScripts, scriptEditorInit, updateScriptEditorContent} from "./Script.js"; import {AllServers, Server, initForeignServers} from "./Server.js"; import {Settings, setSettingsLabels} from "./Settings.js"; @@ -605,7 +605,7 @@ let Engine = { Engine.sector12LocationsList.style.display = "inline"; //City hall only in BitNode-3/with Source-File 3 - if (Player.bitNodeN === 3 || hasCorporationSF) { + if ((Player.bitNodeN === 3 || hasCorporationSF) && Player.bitNodeN !== 8) { document.getElementById("sector12-cityhall-li").style.display = "block"; } else { document.getElementById("sector12-cityhall-li").style.display = "none"; @@ -1319,6 +1319,7 @@ let Engine = { } //Initialize labels on game settings setSettingsLabels(); + scriptEditorInit(); Terminal.resetTerminalInput(); }, diff --git a/utils/FactionInvitationBox.js b/utils/FactionInvitationBox.js index 55dcae2d0..7fc1de8cf 100644 --- a/utils/FactionInvitationBox.js +++ b/utils/FactionInvitationBox.js @@ -1,4 +1,5 @@ import {Faction, joinFaction} from "../src/Faction.js"; +import {Engine} from "../src/engine.js"; import {Player} from "../src/Player.js"; import {clearEventListeners} from "./HelperFunctions.js"; @@ -26,20 +27,33 @@ function factionInvitationSetMessage(msg) { //ram argument is in GB function factionInvitationBoxCreate(faction) { factionInvitationSetText("You have received a faction invitation from " + faction.name); - //TODO Faction invitation message + faction.alreadyInvited = true; + Player.factionInvitations.push(faction.name); + + if (Engine.currentPage === Engine.Page.Factions) { + Engine.loadFactionsContent(); + } var newYesButton = clearEventListeners("faction-invitation-box-yes"); newYesButton.addEventListener("click", function() { + //Remove from invited factions + var i = Player.factionInvitations.findIndex((facName)=>{return facName === faction.name}); + if (i === -1) { + console.log("ERROR: Could not find faction in Player.factionInvitations"); + } else { + Player.factionInvitations.splice(i, 1); + } joinFaction(faction); factionInvitationBoxClose(); + if (Engine.currentPage === Engine.Page.Factions) { + Engine.loadFactionsContent(); + } return false; }); var noButton = clearEventListeners("faction-invitation-box-no"); noButton.addEventListener("click", function() { factionInvitationBoxClose(); - faction.alreadyInvited = true; - Player.factionInvitations.push(faction.name); return false; }); diff --git a/utils/HelperFunctions.js b/utils/HelperFunctions.js index 06f83fb57..9b1b63141 100644 --- a/utils/HelperFunctions.js +++ b/utils/HelperFunctions.js @@ -65,7 +65,7 @@ function removeChildrenFromElement(el) { } } -function createElement(type, params) { +function createElement(type, params={}) { var el = document.createElement(type); if (params.id) {el.id = params.id;} if (params.class) {el.className = params.class;}